Dumb compilation questions here (maybe)

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Michael T.

Dumb compilation questions here (maybe)

Post 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).
suraimu

Re: Dumb compilation questions here (maybe)

Post by suraimu »

The -c is right there in the first line you pasted.
Michael T.

Re: Dumb compilation questions here (maybe)

Post 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.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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.
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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?
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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 ?
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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?).
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post by nadir »

Now they would just buy AT&T
Michael T.

Re: Dumb compilation questions here (maybe)

Post 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?
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post by nadir »

Yes, but the most appropriate place is the mailing list
suraimu

Re: Dumb compilation questions here (maybe)

Post 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*
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Dumb compilation questions here (maybe)

Post 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.
Michael T.

So very close!

Post 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.
Kirben
Site Admin
Posts: 14
Joined: Thu May 14, 2020 1:34 pm

Re: So very close!

Post 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.
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: So very close!

Post by nadir »

Exult has rather large include files, and gcc cannot do precompiled headers yet, so yes, it takes a long time.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: So very close!

Post by drcode »

When is gcc going to support precompiled headers? It's embarrassing being behind MS:-)
Michael T.

Rapture!

Post 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.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rapture!

Post 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
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Rapture!

Post by nadir »

DrCode: precompiled headers were scheduled for 3.1, but they missed the deadline. I guess they will be in 3.2
Telemachos

Re: Rapture!

Post 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
Michael T.

Re: Rapture!

Post by Michael T. »

Thanks Colourless
Michael T.

Re: Rapture!

Post 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?
Michael T.

Should this worry me?

Post 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?
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Should this worry me?

Post 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
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Should this worry me?

Post 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
Locked