Page 1 of 1

Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 1:23 pm
by Michael T.
Hiya. (This question is probably extremely newbie-ish and unnecesary but I still need to ask it despite my embarassment, but if you guys haven't forgotten me, you'd know that already :) I've been trying to compile the Exult sourcecode with Mingw with it's proper makefile (using make.exe of course), and I've tweaked the makefile correctly and everything as it said, but I keep ending up with this error (I'm not gonna post everyline of the compilation, just, the area of it where it messes up):

........... c:\sdllib\include\sdl -DHAVE_SNPRINTF -DUSE_EXULTSTUDIO -c -o tools/expack.o tools/expack.cc
g++: cannot specify -o with -c or -S and multiple compilations
C:\mignw\bin\make.exe: *** [tools/expack.o] Error 1

(c:\sdllib\ being where I'm keeping the sdl binary and library files.)

Please help a beggining coder? What's this all about? I've looked throughout the corresponding makefile.am in the /tools/ directory and the actual makefile in the main /exult/ directory but I'm not finding this -c or -S command anywhere in them.
This being yesterday's latest sourcecode (2-4-02).

Re: Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 3:52 pm
by suraimu
The -c is right there in the first line you pasted.

Re: Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 5:18 pm
by Michael T.
Hmm, maybe I'm just not seeing it? And yes, I can see that it's there among the other compilation routines listed, and I've looked throught he makefiles and such to remove it, but it's neither in the main makefile or in the /tools/ directory, but there's probably some missing seperator or something that's being mistaken for something else, like that -c command, I'll take a look real quick and see if I can't find it still.

Re: Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 10:32 pm
by drcode
It might be in CFLAGS. Try adding a "CFLAGS=" line near the top of the Makefile. Anyway, the error doesn't seem valid since you're not doing multiple compilations.

Re: Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 11:11 pm
by wjp
What this error generally means is that something on the commandline is interpreted as a sourcefile while it shouldn't be. Maybe a path with a space in it?

Re: Dumb compilation questions here (maybe)

Posted: Mon Feb 04, 2002 11:53 pm
by nadir
Maybe slashes the *WRONG* way round ?

Try using c:/sdllib/include/sdl

Why didn't Microsoft use proper slashes instead of backslashes as path delimiters when everyone else was doing it the other way round ?
Maybe CP/M used backslashes ?

Re: Dumb compilation questions here (maybe)

Posted: Tue Feb 05, 2002 3:50 am
by Colourless
Well why did apple use colons? There is no standard, that's why!

Also you will need to use slashes instead of blackslashes for the sdl path.

-Colourless Dragon

Re: Dumb compilation questions here (maybe)

Posted: Tue Feb 05, 2002 8:31 am
by drcode
Way back, someone once told me that MS used backslashes because they didn't want to get sued by the Unix owner (ATT?).

Re: Dumb compilation questions here (maybe)

Posted: Tue Feb 05, 2002 8:41 am
by nadir
Now they would just buy AT&T

Re: Dumb compilation questions here (maybe)

Posted: Tue Feb 05, 2002 6:12 pm
by Michael T.
Heh, look at the storm I caused. Okay, I haven't had any free time today, but I'll take your suggestions and I'll probably find the problem then, thanks. Also, if anybody else wants to post compilation questions here then go ahead, if that's alright with you, Exult team?

Re: Dumb compilation questions here (maybe)

Posted: Wed Feb 06, 2002 1:01 am
by nadir
Yes, but the most appropriate place is the mailing list

Re: Dumb compilation questions here (maybe)

Posted: Wed Feb 06, 2002 1:43 am
by suraimu
Just curious, but why the hell would MS get sued for using backslashes?
I mean, that's kind of retarded if you ask me. LOOK, I USED A PERIOD,
THE NEW YORK TIMES IS GOING TO SUE ME. You know what I mean?

*fears class action suit from descendants of Webster and Roget*

Re: Dumb compilation questions here (maybe)

Posted: Wed Feb 06, 2002 4:03 am
by Colourless
It's quite possible that a patent on using slashes as a path separator existed. I've no idea though. Such a thing is very conceivable though. Computers didn't have file systems supporting paths. I imagine the company to invent one would have been very interested in keeping the idea to themselves, and charge others to use it.

-Colourless Dragon

Re: Dumb compilation questions here (maybe)

Posted: Wed Feb 06, 2002 8:30 am
by drcode
Back then, companies were suing others over the copying of 'look-and-feel'. What I heard was that MS didn't want to make DOS look too much line Unix, for that reason. And MS wasn't the huge behometh that they are now.

So very close!

Posted: Wed Feb 06, 2002 3:46 pm
by Michael T.
Alright, I finnaly got the makefile working flawlessley (albeit with a few trial and errors but still),and now I have pretty much all the object files in the main directory, and I assume they'll compiled together into Exult? But, near the end of the compilation process, I get this error:

.....server.o servewin32.o -lmingw32 -L./sdl/lib -lSDL -mconsole -lwinmm
-lole32 -luuid
C:\MINGW\BIN\...\lib\gcc-lib\mingw32\2.95.3-6\..\..\..\..\mingw32\bin\id.exe: Cannot find -lsdl
C:\MINGW\BIN\MAKE.EXE: *** [Exult.exe] Error 1

This looks kind of odd to me, the really long root directory of id.exe that is, unless that's supposed to be normal. But it didn't give this error before while making the object files.

P.S. Hey, do larger compilations like this usually take this long? It took about 25+ minutes to get just the object files.

Re: So very close!

Posted: Wed Feb 06, 2002 7:47 pm
by Kirben
The linker is unable to find the SDL library (libSDL.a), sounds like you have not set the SDL_LIBS path correctly in makefile.
BTW in case you didn't know there is a walk through to compile Exult on Windows in the README.win32 file.

Re: So very close!

Posted: Wed Feb 06, 2002 11:54 pm
by nadir
Exult has rather large include files, and gcc cannot do precompiled headers yet, so yes, it takes a long time.

Re: So very close!

Posted: Thu Feb 07, 2002 8:10 am
by drcode
When is gcc going to support precompiled headers? It's embarrassing being behind MS:-)

Rapture!

Posted: Thu Feb 07, 2002 5:38 pm
by Michael T.
:) Sweeet. It worked!

exult.exe
(Look, he's so cute!:)

Now if only I could get red of his kernel32.dll:GetLongPathNameA error out of the way, it'll finally be up and running.

Re: Rapture!

Posted: Thu Feb 07, 2002 9:03 pm
by Colourless
Ok, I've committed the fix for the GetLongPathNameA problem. You can get the new version (of server/servewin32.cc) from CVS, or the next snapshot.

-Colourless Dragon

Re: Rapture!

Posted: Fri Feb 08, 2002 12:10 am
by nadir
DrCode: precompiled headers were scheduled for 3.1, but they missed the deadline. I guess they will be in 3.2

Re: Rapture!

Posted: Fri Feb 08, 2002 7:50 am
by Telemachos
A note about slashes - fopen works with both / and \ for directory separation under windows. 'cpp' (the preprocessor) should also work with forward slashes. So it should be possible simply always to use forward slashes in a cross-platform project.

- Telemachos

Re: Rapture!

Posted: Fri Feb 08, 2002 1:47 pm
by Michael T.
Thanks Colourless

Re: Rapture!

Posted: Fri Feb 08, 2002 2:54 pm
by Michael T.
Ack, I hate waiting for the next release. Time for extra coffee tonight I suppose.

Also, the changelog said we'll have to recompile everything in the next release for the kernel error to go away, does that mean 'everything'? Or do we just have to include the .dll in whatever directory it needs to be in and (like me), say that we already compiled it and have the object files, and then just compile using make.exe again?

Should this worry me?

Posted: Sat Feb 09, 2002 4:36 pm
by Michael T.
It shouldn't, but as soon as the latest sourcecode compiles (2-9-02), i get this sort of error, I forget what it says but it was something along the lines of: make.exe - Time scew detected, your build may be incomplete.

But oddly this doens't effect the program, at least nothing immediately apparent. Sound and everything else works too (thank God). Finally, now I can start studying Exult's code and quit being a C++ lamer whining about bugs :)

P.S. (This is probably a newbie question, but it's direct) I noticed that this Exult program is written in C++, but the makefile compilation uses the gcc.exe a few times. What's up with that?

Re: Should this worry me?

Posted: Sun Feb 10, 2002 5:08 am
by nadir
gcc is merely a frontend to the REAL compilers: cc1 and cc1plus, so it is possible to compile C++ with gcc, and C with g++.
The two frontends also add useful directives such as libraries and include paths for their specific cases

Re: Should this worry me?

Posted: Sun Feb 10, 2002 5:17 am
by Colourless
While Exult itself is C++, some things, such as Zip file handling, was written in C. Also, some of the tools were also written in C.

-Colourless Dragon