Thread

GNU compiler (Sdk)

GNU compiler // Sdk

1  |  

esumerfd

Sep 16, 1998, 3:36pm
FYI, the GNU C compiler (GCC) requires a different object format to the
aw.lib so can not be used.

Roland, would it be possible to create a version of the the lib with
this compiler so that we poor people can use it. The best place to get
it is http://www.delorie.com/djgpp/ . The windows package is called
djgpp.

Edward Sumerfield, esumerfd at poboxes.com

puptank

Sep 21, 1998, 8:44am
[View Quote]

The GNU C compiler's utterly brilliant - and it's something we (the
barely-paid) can all get our hands on (another URL for a Windows version,
btw, is: http://www.cygnus.com/ - follow the CygWin32 link).

So yeah, I'd like to see a gcc version of aw.lib (ie. libaw.a) too... what
are the chances?

I'd guess, since the SDK's still in beta, a gcc version of the library's not
a priority. But I'm curious to know if it's likely to happen eventually (ie.
after the beta stage).


Thanks for your time...


---- puptank ----

puptank at ReMoVe.ThIs.iname.com

roland vilett

Sep 21, 1998, 2:17pm
A GNU version of the AW SDK is a possibility at some point in the future.
At this early stage I just don't have the time yet to begin porting the SDK
to any other tools/platforms. For that matter, a Unix (Sun and Linux) port
of the SDK is currently a higher priority for me than a Win32 GNU port,
since I believe ultimately that Unix will be a better platform than Windows
for running sophisticated "bot servers" (i.e. applications that manage
hundreds or even thousands of bots at once).

-Roland


[View Quote]

netropolis

Sep 23, 1998, 10:14am
[View Quote] I never used the GNU C compiler, but if it can generate win code, you
should be able write bots using the sdk dll.

To avoid the problem of the incompatible LIB you can use run-time
dynamic linking (without linking the aw.lib to your prog). You're gonna
have to rewrite the header, use function pointers, and load the dll
using LoadLibrary. It's tedious, but you won't have to wait for a
specific version of the lib ;)

I compiled the following code using Borland C++ Builder and it works
fine. You could try compiling it with GNU C. Of course, you are gonna
have write the code to make it do something :)))

HTH,

-Netro.


#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

#define AW_BUILD 5

typedef int (*pAWInit)(int);
typedef int (*pAWCreate)(char*, int, void**);
typedef void (*pAWTerm)(void);
typedef int (*pAWDestroy)(void);
typedef int (*pAWWait)(int);

main (void)
{
int rc;
HINSTANCE hAWLib;
pAWInit AWInit;
pAWCreate AWCreate;
pAWTerm AWTerm;
pAWDestroy AWDestroy;
pAWWait AWWait;

hAWLib = LoadLibrary("aw.dll");

if (hAWLib != NULL) {

AWInit = (pAWInit) GetProcAddress(hAWLib, "aw_init");
AWCreate = (pAWCreate) GetProcAddress(hAWLib, "aw_create");
AWTerm = (pAWTerm) GetProcAddress(hAWLib, "aw_term");
AWDestroy = (pAWDestroy) GetProcAddress(hAWLib, "aw_destroy");
AWWait = (pAWWait) GetProcAddress(hAWLib, "aw_wait");

if (rc = (AWInit)(AW_BUILD)) {
printf ("Unable to initialize API (reason %d)\n", rc);
exit (1);
}

if (rc = (AWCreate)(0, 0, 0)) {
printf ("Unable to create bot instance (reason %d)\n", rc);
exit (1);
}

(AWWait)(1000);

(AWDestroy)();
(AWTerm)();

FreeLibrary(hAWLib);
}

printf ("seems it worked");
return 0;
}

esumerfd

Sep 23, 1998, 3:07pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Thank you I will give it a try.
<P>Edward Sumerfield.
[View Quote]

puptank

Sep 24, 1998, 8:59am
[View Quote] <SNIPPED the how-to on using the GNU C compiler with the SDK>

Thanks! I was wondering if that sort of thing was possible - I haven't had
enough experience to be sure (or to have much idea how to go about it).
Anyway - knowing it's possible should get me somewhere with a bit (um...
well... a lot...) more learning & mucking about.

I've saved your post & reckon I'll have things sussed eventually. Thanks
again.


---- puptank ----

puptank at ReMoVe.ThIs.iname.com

edward sumerfield

Sep 27, 1998, 12:28am
Well I am getting closer. I have merged your program with the sample greeter
bot and am trying link it now.

Unresolved references for LoadLib and GetProcAddress. Would you happen to
know which libray they live in. I have a long list of .a files in the gnu
lib directory and running the nm.exe command on them hasn't helped.

Edward Sumerfield

[View Quote]

puptank

Sep 27, 1998, 10:04am
Joy!

Got the GreeterBot working with GNU C!

Edward, I didn't have any problem with LoadLibrary/GetProcAddress, so I
don't know what to tell you. I'm using the GNU compiler distributed by
http://www.cygnus.com/ ...if you're not, that could have something to do
with it (djgpp is a pretty different setup, I gather).

Email me if you like & I'll send you my greeterbot source (a merge of the
sample on the AW SDK site and the code posted here by Netropolis). It'll be
pretty much what you've already got, but you might spot something that makes
a difference, maybe.

Huge thanks to everyone.



---- puptank ----

puptank at ReMoVe.ThIs.iname.com

[View Quote]

edward sumerfield

Sep 28, 1998, 10:37pm
You the man. I am downloading the cygnus version now.

Edward Sumerfield.

[View Quote]

roland vilett

Sep 30, 1998, 5:17am
It looks like the LoadLibrary/GetProcAddress solution is a good one for
people who don't have access to Visual C++. As soon as I have a spare
moment, I'll create a generic file that will provide access to the AW API
transparently using this mechanism, and include it in subsequent
distributions of the SDK so anyone who runs into this problem in the future
will have an easy solution available. My goal will be to create the file so
that the same code will compile without modification whether you use the
aw.lib mechanism or the LoadLibrary() mechanism.

-Roland


[View Quote]

esumerfd

Sep 30, 1998, 8:02pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Sounds great Roland. I could use it in my next project if you hurry. Ha
Ha.
<P>My next goal was to wrap the sdk in a C++ wrapper and try to extrapolate
some class from it. I am not quite sure how to break it down yet.
<P>My first thoughts came up with the following classes:
<P>o&nbsp;&nbsp;&nbsp; ActiveWorld
<P>&nbsp;&nbsp;&nbsp; Static class responsible for concept wide information.
Will do the aw_init and contain any constants that may be necesssary.
<P>o&nbsp;&nbsp;&nbsp; Universe
<P>&nbsp;&nbsp;&nbsp; Responsible for aw_login.
<P>o&nbsp;&nbsp;&nbsp; World
<P>&nbsp;&nbsp;&nbsp; Responsible for aw_enter
<P>o&nbsp;&nbsp;&nbsp; Citizen
<P>&nbsp;&nbsp;&nbsp; To encapsulate all information necessary to define
a user.
<P>o&nbsp;&nbsp;&nbsp; Robot
<P>&nbsp;&nbsp;&nbsp; Responsible for defining a bot. Will use the aw_create,
aw_say, aw_int_set (???) and aw_string_set(???) functions necessary to
set bot position, avatar, etc.
<P>Well very rough ideas at the moment. I am thinking that you could end
up with a program that looks like this.
<P>&nbsp;&nbsp;&nbsp; ActiveWorlds.init();
<BR>&nbsp;&nbsp;&nbsp; Universe u = new Universe();
<BR>&nbsp;&nbsp;&nbsp; Citizen c = new Citizen(user id, priv password);
<BR>&nbsp;&nbsp;&nbsp; u.login(c);
<P>&nbsp;&nbsp;&nbsp; World w = new World("Beta");
<BR>&nbsp;&nbsp;&nbsp; Robot r = new Robot("Name", "Application name");
<BR>&nbsp;&nbsp;&nbsp; r.setPosition(xN, yW, zA);
<BR>&nbsp;&nbsp;&nbsp; w.enter(r);
<BR>&nbsp;&nbsp;&nbsp; r.say("Hello World");
<P>One of the nicest paybacks for doing this is not having to keep track
of the robot instance. the Robot class will keep track of that for me and
set it every time a method is called.
<P>The callback interface is going to be interesting. Much rarther do it
in Java but any way C++ does have abstract functions so I am thinking of
a single abstract callback class that will force the programmer to inherit
each function from it and implement whatever is needed.
<P>I am not planning on putting in the semaphors to make it thread safe
in this phase. Maybe down the road.
<P>Edward Sumerfield.
[View Quote]

roland vilett

Sep 30, 1998, 9:29pm
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01BDEC8F.6E7546E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I was also planning to write a C++ class to encapsulate the API at some =
point...I wasn't personally planning to break the API down in to =
multiple different classes. It seems like a single class would be =
sufficient to encapsulate the entire interface, and people who wanted =
specific applications could derive their own classes from it. Of =
course, I'm not the worlds greatest OO programmer so I might not be =
looking at it the right way...you're correct in pointing out that the =
big payoff is that the management of the instance handle could be =
completely encapsulated within the class and the developer would no =
longer have to worry about it.

I'm not sure I like the class names "Citizen" or "Robot"...Citizen would =
be a misnomer since SDK applications are not citizens...maybe call it =
"Owner" instead? And "Robot" is perhaps too restrictive a concept, since =
SDK apps can be things other than bots roaming around in a world talking =
to people...anyway, just a thought. You're of course welcome to create =
any classes you like. :)

-Roland

[View Quote] My first thoughts came up with the following classes:=20

o ActiveWorld=20

Static class responsible for concept wide information. Will do =
the aw_init and contain any constants that may be necesssary.=20

o Universe=20

Responsible for aw_login.=20

o World=20

Responsible for aw_enter=20

o Citizen=20

To encapsulate all information necessary to define a user.=20

o Robot=20

Responsible for defining a bot. Will use the aw_create, aw_say, =
aw_int_set (???) and aw_string_set(???) functions necessary to set bot =
position, avatar, etc.=20

Well very rough ideas at the moment. I am thinking that you could =
end up with a program that looks like this.=20

ActiveWorlds.init();=20
Universe u =3D new Universe();=20
Citizen c =3D new Citizen(user id, priv password);=20
u.login(c);=20

World w =3D new World("Beta");=20
Robot r =3D new Robot("Name", "Application name");=20
r.setPosition(xN, yW, zA);=20
w.enter(r);=20
r.say("Hello World");=20

One of the nicest paybacks for doing this is not having to keep =
track of the robot instance. the Robot class will keep track of that for =
me and set it every time a method is called.=20

The callback interface is going to be interesting. Much rarther do =
it in Java but any way C++ does have abstract functions so I am thinking =
of a single abstract callback class that will force the programmer to =
inherit each function from it and implement whatever is needed.=20

I am not planning on putting in the semaphors to make it thread safe =
in this phase. Maybe down the road.=20

Edward Sumerfield.=20

[View Quote] It looks like the LoadLibrary/GetProcAddress solution is a good =
one for=20
people who don't have access to Visual C++. As soon as I have a =
spare=20
moment, I'll create a generic file that will provide access to =
the AW API=20
transparently using this mechanism, and include it in subsequent =

distributions of the SDK so anyone who runs into this problem in =
the future=20
will have an easy solution available. My goal will be to create =
the file so=20
that the same code will compile without modification whether you =
use the=20
aw.lib mechanism or the LoadLibrary() mechanism.=20
-Roland=20

[View Quote]

------=_NextPart_000_0007_01BDEC8F.6E7546E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 =
Transitional//EN">
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>I was also planning to write a C++ =
class to=20
encapsulate the API at some point...I wasn't personally planning to =
break the=20
API down in to multiple different classes.&nbsp; It seems like a single =
class=20
would be sufficient to encapsulate the entire interface, and people who =
wanted=20
specific applications could derive their own classes from it.&nbsp; Of =
course,=20
I'm not the worlds greatest OO programmer so I might not be looking at =
it the=20
right way...you're correct in pointing out that the big payoff is that =
the=20
management of the instance handle could be completely encapsulated =
within the=20
class and the developer would no longer have to worry about =
it.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I'm not sure I like the class names =
&quot;Citizen&quot; or=20
&quot;Robot&quot;...Citizen would be a misnomer since SDK applications =
are not=20
citizens...maybe call it &quot;Owner&quot; instead? And =
&quot;Robot&quot; is=20
perhaps too restrictive a concept, since SDK apps can be things other =
than bots=20
roaming around in a world talking to people...anyway, just a =
thought.&nbsp;=20
You're of course welcome to create any classes you like. :)</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>-Roland</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
[View Quote] <P>My next goal was to wrap the sdk in a C++ wrapper and try to =
extrapolate=20
some class from it. I am not quite sure how to break it down yet.=20
<P>My first thoughts came up with the following classes:=20
<P>o&nbsp;&nbsp;&nbsp; ActiveWorld=20
<P>&nbsp;&nbsp;&nbsp; Static class responsible for concept wide =
information.=20
Will do the aw_init and contain any constants that may be =
necesssary.=20
<P>o&nbsp;&nbsp;&nbsp; Universe=20
<P>&nbsp;&nbsp;&nbsp; Responsible for aw_login.=20
<P>o&nbsp;&nbsp;&nbsp; World=20
<P>&nbsp;&nbsp;&nbsp; Responsible for aw_enter=20
<P>o&nbsp;&nbsp;&nbsp; Citizen=20
<P>&nbsp;&nbsp;&nbsp; To encapsulate all information necessary to =
define a=20
user.=20
<P>o&nbsp;&nbsp;&nbsp; Robot=20
<P>&nbsp;&nbsp;&nbsp; Responsible for defining a bot. Will use the=20
aw_create, aw_say, aw_int_set (???) and aw_string_set(???) functions =

necessary to set bot position, avatar, etc.=20
<P>Well very rough ideas at the moment. I am thinking that you could =
end up=20
with a program that looks like this.=20
<P>&nbsp;&nbsp;&nbsp; ActiveWorlds.init(); <BR>&nbsp;&nbsp;&nbsp; =
Universe u=20
=3D new Universe(); <BR>&nbsp;&nbsp;&nbsp; Citizen c =3D new =
Citizen(user id,=20
priv password); <BR>&nbsp;&nbsp;&nbsp; u.login(c);=20
<P>&nbsp;&nbsp;&nbsp; World w =3D new World(&quot;Beta&quot;);=20
<BR>&nbsp;&nbsp;&nbsp; Robot r =3D new Robot(&quot;Name&quot;,=20
&quot;Application name&quot;); <BR>&nbsp;&nbsp;&nbsp; =
r.setPosition(xN, yW,=20
zA); <BR>&nbsp;&nbsp;&nbsp; w.enter(r); <BR>&nbsp;&nbsp;&nbsp;=20
r.say(&quot;Hello World&quot;);=20
<P>One of the nicest paybacks for doing this is not having to keep =
track of=20
the robot instance. the Robot class will keep track of that for me =
and set=20
it every time a method is called.=20
<P>The callback interface is going to be interesting. Much rarther =
do it in=20
Java but any way C++ does have abstract functions so I am thinking =
of a=20
single abstract callback class that will force the programmer to =
inherit=20
each function from it and implement whatever is needed.=20
<P>I am not planning on putting in the semaphors to make it thread =
safe in=20
this phase. Maybe down the road.=20
<P>Edward Sumerfield.=20
[View Quote] <BR>&gt;&gt;&gt;Joy! <BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt;Got the =
GreeterBot=20
working with GNU C! <BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt;Edward, I =
didn't=20
have any problem with LoadLibrary/GetProcAddress, so I=20
<BR>&gt;&gt;&gt;don't know what to tell you. I'm using the GNU =
compiler=20
distributed by <BR>&gt;&gt;&gt;<A=20
href=3D"http://www.cygnus.com/">http://www.cygnus.com/</A> ...if =
you're=20
not, that could have something to do <BR>&gt;&gt;&gt;with it =
(djgpp is a=20
pretty different setup, I gather). <BR>&gt; <BR>&gt; <BR>&gt; =
<BR>&gt;=20
<BR></P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0007_01BDEC8F.6E7546E0--

jan-willem de bleser

Sep 30, 1998, 9:57pm
This is a multi-part message in MIME format.
--------------75282AB7A8FB6BE990822715
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Whats a GUI compiler?

[View Quote] > FYI, the GNU C compiler (GCC) requires a different object format to the
> aw.lib so can not be used.
>
> Roland, would it be possible to create a version of the the lib with
> this compiler so that we poor people can use it. The best place to get
> it is http://www.delorie.com/djgpp/ . The windows package is called
> djgpp.
>
> Edward Sumerfield, esumerfd at poboxes.com



--------------75282AB7A8FB6BE990822715
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jan-willem De Bleser
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Jan-willem De Bleser
n: De Bleser;Jan-willem
org: High school
email;internet: debleser at mediaone.net
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------75282AB7A8FB6BE990822715--

jan-willem de bleser

Sep 30, 1998, 9:58pm
This is a multi-part message in MIME format.
--------------71146D6973FBE09FE09ED543
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Whats a GNU compiler?

[View Quote] > FYI, the GNU C compiler (GCC) requires a different object format to the
> aw.lib so can not be used.
>
> Roland, would it be possible to create a version of the the lib with
> this compiler so that we poor people can use it. The best place to get
> it is http://www.delorie.com/djgpp/ . The windows package is called
> djgpp.
>
> Edward Sumerfield, esumerfd at poboxes.com



--------------71146D6973FBE09FE09ED543
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jan-willem De Bleser
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Jan-willem De Bleser
n: De Bleser;Jan-willem
org: High school
email;internet: debleser at mediaone.net
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------71146D6973FBE09FE09ED543--

drchandra

Oct 1, 1998, 2:09pm
My advice is to write the API encapsulation as a single class, with full
access to all of the SDK calls as methods. Make the class as transparent as
possible, so that the C++ code has exactly the same access to the API that
is available to C. Further refinements of the class structure into "real
world oriented" classes such as Instance, World, and Citizen can be
constructed on top of that.

This is a the approach I am taking with the Java encapsulation I am working
on. I have an AWJNI object, which is a Java Native Interface (JNI)
representation of the API. I plan to finish the API so that the Java side
has as faithful a representation of the native C code API as is possible.
Once this is done, the individualized objects can all be created in Java.

What might be an interesting outgrowth of this project is to combine the C++
objects with Java. Aside fromt he API encapsulation, I (and anyone else who
has the same itch) can produce a JNI interface to the C++ real world
oriented objects, and the (almost) exact same object would then be available
to Java programmers.

What is my goal? An open source, multi-platform version of the aw client.
Obviously performance will be an issue once we get to the 3D rendering, but
before then, we may be able to produce something which will allow someone to
stand at ground zero and chat in text mode. It will run anywhere, too. Maybe
even from within a Web page.

I plan to finish the AWJNI Java class and Visual C++ Native call catcher
before posting the source on web site. I have all the calls done which take
and return primitive variable types, like ints and arrays. What I'm
wrestling with right now is how to represent the Instance pointers so that
multiple Java Instance objects can all be making calls to their own C
Instance. That and the callback handlers. Any ideas from the group would
save time, and would be appreciated.

DrChandra/PK-37(281646)

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote] I'm not sure I like the class names "Citizen" or "Robot"...Citizen would be
a misnomer since SDK applications are not citizens...maybe call it "Owner"
instead? And "Robot" is perhaps too restrictive a concept, since SDK apps
can be things other than bots roaming around in a world talking to
people...anyway, just a thought. You're of course welcome to create any
classes you like. :)

-Roland

[View Quote]

drchandra

Oct 1, 1998, 2:11pm
It's a free, open source compiler which can be compiled and installed on
many platforms, including the PC.

Check out http://www.cygnus.com/

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page


[View Quote]

jan-willem de bleser

Oct 1, 1998, 6:42pm
This is a multi-part message in MIME format.
--------------3BA2118A553C66176895BBE0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



[View Quote] > It's a free, open source compiler

whats that?

> which can be compiled and installed on
> many platforms, including the PC.

whats the difference between it and other c compilers?

>
>
> Check out http://www.cygnus.com/
>
> --
> Andrew C. Esh mailto:andrew_esh at cnt.com
> http://www.mtn.org/~andrewes - ACE Home Page
>
[View Quote]

--------------3BA2118A553C66176895BBE0
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jan-willem De Bleser
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Jan-willem De Bleser
n: De Bleser;Jan-willem
org: High school
email;internet: debleser at mediaone.net
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------3BA2118A553C66176895BBE0--

drchandra

Oct 1, 1998, 7:13pm
[View Quote] It's free, as in without cost. No money required. Open Source means you get
the source code to it. If you find a bug, you can fix it yourself.

>
>whats the difference between it and other c compilers?

Because it's open source, there are a lot of people on the Internet who
submit bugfixes for it. It tends to be very advanced, and stable. Since so
many people use it, it gets a lot of review, so chances are there are few
bugs that will surprise you, and any that are will be quickly fixed. Other
than that, there is little difference between this compiler and most
others. In fact, gcc is the de facto standard compiler for most Unix
systems, and all Linux systems. In other words, this is not some little
known toy compiler, it's simply the best compiler recommendation I can make.

>

--
Andrew C. Esh mailto:andrew_esh at cnt.com
http://www.mtn.org/~andrewes - ACE Home Page

cableguy

Oct 1, 1998, 7:44pm
AND...the letters G N U stand for ..GNU's Not Unix.., a recursive acronym :o]

[View Quote] [View Quote]

puptank

Oct 1, 1998, 7:52pm
[View Quote]
Since you can get your hands on the source code for the actual compiler
itself, you're free to compile it, learn from it, change it - even
contribute to its "official development" if you'd like to. Basically, that's
what "open source" is. The compiler has been & is being developed by
volunteers & enthusiasts. You do not have to pay for GNU.


>
>whats the difference between it and other c compilers?


See above. I should add that (...though I've gotta admit, the only other C
compiler I ever used much was Turbo C on a 286...;) the GNU C compiler (gcc)
is damn fine.





Also check out http://www.gnu.org/ for info about GNU, open source, etc...

Anyway. This is meant to be a SDK newsgroup, so I'll shut up. My excuse: if
there was no GNU C, I couldn't play with the SDK at all (you know, being
poor and starving these days and all that).


--- puptank ---

puptank at ReMoVe.ThIs.iname.com

esumerfd

Oct 1, 1998, 8:55pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
[View Quote]

edward sumerfield

Oct 3, 1998, 12:04pm
This is a multi-part message in MIME format.

------=_NextPart_000_009A_01BDEEB5.2DCCF520
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Well I was half way through implementing and changed my mind. DrChandra, =
you were right.

The big advantages of issolating the sdk in one C++ class are

1. It issolates Cof changes to the sdk making it simpler to keep up =
with new versions.
2. It localizes the complications of calling function points to =
loaded dlls.

Edward Sumerfield.
[View Quote] Aside fromt he API encapsulation, I (and anyone else who=20
has the same itch) can produce a JNI interface to the C++ real =
world=20
oriented objects, and the (almost) exact same object would then =
be available=20
to Java programmers.
This would be my prefered language so I look forward to working with =
your results.=20
What is my goal? An open source, multi-platform version of the =
aw client.=20
Obviously performance will be an issue once we get to the 3D =
rendering, but=20
before then, we may be able to produce something which will =
allow someone to=20
stand at ground zero and chat in text mode. It will run =
anywhere, too. Maybe=20
even from within a Web page.
I was thinking of a telnet server model were you write a bot that =
accepts telnet connections and passes any text IO as a check message to =
an assigned bot int he world.=20
What I'm=20
wrestling with right now is how to represent the Instance =
pointers so that=20
multiple Java Instance objects can all be making calls to their =
own C=20
Instance. That and the callback handlers. Any ideas from the =
group would=20
save time, and would be appreciated.
If by instance you mean bot instance then you just have to =
encapsulate the instance number inside a bot object and set the instance =
for every call to its methods. It all has to be sychronized to prevent =
multi-threading problems so that shouldn't be hard.=20
DrChandra/PK-37(281646)=20
--=20
Andrew C. Esh mailto:andrew_esh at cnt.com=20
http://www.mtn.org/~andrewes - ACE Home Page=20

[View Quote] applications could derive their own classes from it. Of course, =
I'm not the=20
worlds greatest OO programmer so I might not be looking at it =
the right=20
way...you're correct in pointing out that the big payoff is that =
the=20
management of the instance handle could be completely =
encapsulated within=20
the class and the developer would no longer have to worry about =
it.=20

I'm not sure I like the class names "Citizen" or =
"Robot"...Citizen would be=20
a misnomer since SDK applications are not citizens...maybe call =
it "Owner"=20
instead? And "Robot" is perhaps too restrictive a concept, since =
SDK apps=20
can be things other than bots roaming around in a world talking =
to=20
people...anyway, just a thought. You're of course welcome to =
create any=20
classes you like. :)=20

-Roland=20

[View Quote] distributions of the SDK so anyone who runs into this problem in =
the future=20
will have an easy solution available. My goal will be to create =
the file so=20
that the same code will compile without modification whether you =
use the=20
aw.lib mechanism or the LoadLibrary() mechanism.=20
-Roland=20
[View Quote]

------=_NextPart_000_009A_01BDEEB5.2DCCF520
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 =
Transitional//EN">
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Well I was half way through =
implementing and=20
changed my mind. DrChandra, you were right.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>The big advantages of issolating the sdk in one C++ =
class=20
are</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>1.&nbsp;&nbsp;&nbsp; It issolates Cof changes to the =
sdk=20
making it simpler to keep up with new versions.</FONT></DIV>
<DIV><FONT size=3D2>2.&nbsp;&nbsp;&nbsp; It localizes the complications =
of calling=20
function points to loaded dlls.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Edward Sumerfield.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
[View Quote] <BLOCKQUOTE TYPE =3D CITE>What is my goal? An open source, =
multi-platform=20
version of the aw client. <BR>Obviously performance will be an =
issue=20
once we get to the 3D rendering, but <BR>before then, we may be =
able to=20
produce something which will allow someone to <BR>stand at =
ground zero=20
and chat in text mode. It will run anywhere, too. Maybe <BR>even =
from=20
within a Web page.</BLOCKQUOTE>I was thinking of a telnet server =
model were=20
you write a bot that accepts telnet connections and passes any text =
IO as a=20
check message to an assigned bot int he world.=20
<BLOCKQUOTE TYPE =3D CITE>What I'm <BR>wrestling with right now is =
how to=20
represent the Instance pointers so that <BR>multiple Java =
Instance=20
objects can all be making calls to their own C <BR>Instance. =
That and=20
the callback handlers. Any ideas from the group would <BR>save =
time, and=20
would be appreciated.</BLOCKQUOTE>If by instance you mean bot =
instance then=20
you just have to encapsulate the instance number inside a bot object =
and set=20
the instance for every call to its methods. It all has to be =
sychronized to=20
prevent multi-threading problems so that shouldn't be hard.=20
<BLOCKQUOTE TYPE =3D CITE>DrChandra/PK-37(281646)=20
<P>-- <BR>Andrew C. Esh&nbsp;&nbsp; <A=20
href=3D"mailto:andrew_esh at cnt.com">mailto:andrew_esh at cnt.com</A> =
<BR><A=20
=
href=3D"http://www.mtn.org/~andrewes">http://www.mtn.org/~andrewes</A> - =

ACE Home Page=20
[View Quote] <BR>way...you're correct in pointing out that the big payoff is =
that the=20
<BR>management of the instance handle could be completely =
encapsulated=20
within <BR>the class and the developer would no longer have to =
worry=20
about it.=20
<P>I'm not sure I like the class names &quot;Citizen&quot; or=20
&quot;Robot&quot;...Citizen would be <BR>a misnomer since SDK=20
applications are not citizens...maybe call it &quot;Owner&quot;=20
<BR>instead? And &quot;Robot&quot; is perhaps too restrictive a =
concept,=20
since SDK apps <BR>can be things other than bots roaming around =
in a=20
world talking to <BR>people...anyway, just a thought.&nbsp; =
You're of=20
course welcome to create any <BR>classes you like. :)=20
<P>-Roland=20
[View Quote] <BR>moment, I'll create a generic file that will provide access =
to the=20
AW API <BR>transparently using this mechanism, and include it in =

subsequent <BR>distributions of the SDK so anyone who runs into =
this=20
problem in the future <BR>will have an easy solution =
available.&nbsp; My=20
goal will be to create the file so <BR>that the same code will =
compile=20
without modification whether you use the <BR>aw.lib mechanism or =
the=20
LoadLibrary() mechanism. <BR>-Roland <BR>Edward Sumerfield wrote =
in=20
message &lt;36119c83.0 at homer&gt;... <BR>&gt;Here is the complete =
version=20
of sample Greeter program using the dll <BR>instead <BR>&gt;of =
the lib=20
all compiled and linked with the Cygnus GNU C++ compiler. =
<BR>&gt;=20
<BR>&gt;I added a readme.txt that describes how I got it all =
working=20
with input <BR>from <BR>&gt;Netropolis and puptank. Thank you. =
<BR>&gt;=20
<BR>&gt;I hope it is useful to someone. <BR>&gt; <BR>&gt;Edward=20
[View Quote] ------=_NextPart_000_009A_01BDEEB5.2DCCF520--

walter knupe

Oct 10, 1998, 3:45pm
Almost all versions of MS Visual C++ are able to produce a new import
library for dlls.
so the Visual 5 version of it does not have to be used.

I woudln't be surprised if GNU C would offer a similar service.

the method i am talking about used to be called implib. It takes a dll-File
and creates an import library from it.


Roland, the sdk i downloaded carried only aw.h, aw.lib and aw.dll. is there
a way to tell what version it is or could
you provide a version.txt with the archive to give that information ?
thanks :)

otherwise, the sdk has been working great for me :)


Roland Vilett schrieb in Nachricht <3611d99e.0 at homer>...
>It looks like the LoadLibrary/GetProcAddress solution is a good one for
>people who don't have access to Visual C++. As soon as I have a spare
>moment, I'll create a generic file that will provide access to the AW API
>transparently using this mechanism, and include it in subsequent
>distributions of the SDK so anyone who runs into this problem in the future
>will have an easy solution available. My goal will be to create the file
so
>that the same code will compile without modification whether you use the
>aw.lib mechanism or the LoadLibrary() mechanism.
>
>-Roland
>

edward sumerfield

Oct 10, 1998, 5:10pm
Interesting. I do not know what an import file is. Unix background, sorry.

The name mangling algorithm in GNU is different from VC++ so you can't
combine MS and GNU DLLs. I don't know if an "inport file" would solve this.

Anyway we are dealing with a C sdk. Would an import file get us around
having to code wrappers around the DLL load?

Edward Sumerfield,

[View Quote]

roland vilett

Oct 10, 1998, 9:27pm
>Roland, the sdk i downloaded carried only aw.h, aw.lib and aw.dll. is there
>a way to tell what version it is or could
>you provide a version.txt with the archive to give that information ?
>thanks :)


Look for the "#define AW_BUILD" in aw.h. It is defined as the current SDK
build number for that distribution.

-Roland

walter knupe

Oct 11, 1998, 1:19am
Edward Sumerfield schrieb in Nachricht <361fb09d.0 at homer>...
>Interesting. I do not know what an import file is. Unix background, sorry.
>
>The name mangling algorithm in GNU is different from VC++ so you can't
>combine MS and GNU DLLs. I don't know if an "inport file" would solve this.

actually, all DLLs are sort of required to use c function exports in order
to avoid
the name mangling problem.

that means dll exports are usually PASCAL exported functions (the name is
not decorated at all) or sometimes CDECL exported functions (name is
decorated with a leading underscore).

and third option is to export dll functions by ordinal value, which avoids
using function names at all. but i am not sure if a proper import library
can be regenerated in that case, and with aw.dll i can't find any function
names in there.

so you either use the code wrappers or have the import library, but name
mangling settings shouldn't have anything to do with the issue.


>
>Anyway we are dealing with a C sdk. Would an import file get us around
>having to code wrappers around the DLL load?
>
>Edward Sumerfield,
>
[View Quote]

edward sumerfield

Oct 11, 1998, 7:19pm
I must be thinking of libs instead of dlls. So no GNU compiled function can
call a MS compiled C++ library. Does that sound more likley?

So the implib program is dynamically creating something like a dll wrapper
then? I will take a look through GNUdome and see what I can see. Writing
wrappers is tiersome and mainenance intensive, it would be nice to find an
alternative.

Edward Sumerfield

[View Quote]

walter knupe

Oct 11, 1998, 8:07pm
Edward,


Edward Sumerfield schrieb in Nachricht <36212052.0 at homer>...
>I must be thinking of libs instead of dlls. So no GNU compiled function can
>call a MS compiled C++ library. Does that sound more likley?

yes, that is correct for libraries, and for DLLS which require exported c++
mangled names. (rare, but neccessary if you have function overloading or
complete classes)

>So the implib program is dynamically creating something like a dll wrapper
>then? I will take a look through GNUdome and see what I can see. Writing
>wrappers is tiersome and mainenance intensive, it would be nice to find an
>alternative.

Well, implib used to be just that, a tool to create dll wrapper libraries..
but that "knowledge" moved more and more into the linker, so that the import
libraries differ from normal libraries in the way that they do not contain
real functions anymore, just additional linking information... the linker
generates the wrappers then.

which did not change the procedure... you have to use implib to create your
import library. it's just that these days the MS IDEs do that autmatically
when creating a dll, so the "implib.exe" is actually gone by now , it is
intregated in the dll building process. which leads to the problem that you
can't use current visual c++ installations anymore for automated wrapper lib
builing of alien dlls.

i must admit that the information i give gets more and more accurate every
time i answer, which unfortunately changes that information more and more :)

implib.exe is not an option for VisualC5.0, and i think not for Visual C 4.0
as well. it used to be for the older versions.

but, since DLLs are so major under windows, i am quite sure gnu C for win32
must have some supporting environment for it.

Walter

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn