Is the compilation instructions accurate for 64-bit Windows?

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#16 Post by tiger_eye »

Sounds like you're getting closer, Rectifier. I am wondering, though, what steps you took to install the SDL library (nevermind the "other" SDL_* libs such as SDL_mixer and SDL_image). Did you get 1.3 from here:
http://www.libsdl.org/hg.php
and build it yourself, or are you using something different?

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#17 Post by Rectifier »

Now that you mention it, I do not recall whatsoever where I got sdl, so I grabbed the source and built it.
Its version 1.2.14, do I need 1.3?

Still seeing the same error output in msys.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#18 Post by tiger_eye »

Yup, you need version 1.3.

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#19 Post by Rectifier »

Okay I built sdl 1.3.6050, and now I get this in the output.

Code: Select all

==== Building TEngine (debug) ====
Running pre-build commands
windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res
core_lua.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../src/core_lua.c: In function 'lua_key_set_clipboard':
../src/core_lua.c:216:14: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
display_sdl.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
dmnd_square.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
fov.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
getself.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
glew.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
main.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from ../src/main.c:40:0:
../src/music.h:29:19: fatal error: AL/al.h: No such file or directory
compilation terminated.
make[1]: *** [../obj/Debug/TEngine/main.o] Error 1
make: *** [TEngine] Error 2

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: Is the compilation instructions accurate for 64-bit Wind

#20 Post by greycat »

Sounds like you have SDL working, and now you need the OpenAL library, or libal, or whatever it's called.

On Debian the package name is libopenal-dev, and the package documentation says it came from http://kcat.strangesoft.net/openal.html . Hope that helps.

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#21 Post by Rectifier »

Added the open-al files, the .dll to my win's system folders like the instructions pointed out and the .h files to /c/mingw/include/al/
Tried linking premade4.lua straight to the openal folder I made, but it yelled at me so I made the folder and moved them.


This is where I'm at now...does not seem to like one of the sdl files.

Code: Select all

==== Building TEngine (debug) ====
Running pre-build commands
windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res
main.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../src/main.c:75:32: warning: initialization makes integer from pointer without a cast [enabled by default]
../src/main.c:76:33: warning: initialization makes integer from pointer without a cast [enabled by default]
../src/main.c: In function 'setupRealtime':
../src/main.c:653:21: warning: assignment makes integer from pointer without a cast [enabled by default]
map.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../src/map.c: In function 'map_set_grid':
../src/map.c:779:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
music.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../src/music.c: In function 'loadsoundLua':
../src/music.c:278:3: warning: passing argument 2 of 'SDL_CreateThread' from incompatible pointer type [enabled by default]
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: expected 'const char *' but argument is of type 'struct Sound *'
../src/music.c:278:3: error: too few arguments to function 'SDL_CreateThread'
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: declared here
make[1]: *** [../obj/Debug/TEngine/music.o] Error 1
make: *** [TEngine] Error 2

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#22 Post by tiger_eye »

Great! You are almost there. DarkGod is currently using an older version of sdl-1.3 (from three-ish months ago), so you'll need to make a simple change three different places (in "music.c", "particles.c", and "profile.c"):

http://forums.te4.org/viewtopic.php?f=4 ... 10&start=7

In short, you need to change code like:

Code: Select all

thread = SDL_CreateThread(thread_particles, pt);
to

Code: Select all

const char *name = "Particles";
thread = SDL_CreateThread(thread_particles, name, pt);

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#23 Post by Rectifier »

Did what was mentioned in those threads, the error output changed slightly, but yeah...

Code: Select all

==== Building TEngine (debug) ====
Running pre-build commands
windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res
music.c
<command-line>:0:0: warning: "TENGINE_HOME_PATH" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../src/music.c: In function 'loadsoundLua':
../src/music.c:278:5: warning: passing argument 2 of 'SDL_CreateThread' from incompatible pointer type [enabled by default]
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: expected 'const char *' but argument is of type 'struct Sound *'
../src/music.c:278:5: error: too few arguments to function 'SDL_CreateThread'
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: declared here
../src/music.c:280:3: warning: passing argument 2 of 'SDL_CreateThread' from incompatible pointer type [enabled by default]
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: expected 'const char *' but argument is of type 'struct Sound *'
../src/music.c:280:3: error: too few arguments to function 'SDL_CreateThread'
c:/MinGW/sdl13/include/SDL_thread.h:145:1: note: declared here
make[1]: *** [../obj/Debug/TEngine/music.o] Error 1
make: *** [TEngine] Error 2

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#24 Post by tiger_eye »

Are you sure you applied the code changes correctly? I just updated to the most recent SDL to verify it still works, and it does for me.

The issue is that "SDL_CreateThread" now requires three parameters, whereas it used to only have two. What used to be the second parameter is now the third. The compilation error you posted would happen if the second parameter is still the second parameter. So, please double-check the following changes:

profile.c, line 210-1:

Code: Select all

        const char *name = "Profile";
        thread = SDL_CreateThread(thread_profile, name, profile);
music.c, line 278-9:

Code: Select all

                const char *name = "Sound";
                sound->loaderThread = SDL_CreateThread(streamingLoader, name, sound);
particles.c, line 893-4:

Code: Select all

                const char *name = "Particles";
                thread = SDL_CreateThread(thread_particles, name, pt);
Good luck! If it still doesn't work and you think it should, then do "make clean" then "make".

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#25 Post by Rectifier »

Fixed the last problem but nao I get dis :o

Code: Select all

Linking TEngine
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lSDLmain
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lopenal32
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lvorbisfile
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lpng12
collect2: ld returned 1 exit status
make[1]: *** [../bin/Debug/t-engine.exe] Error 1
make: *** [TEngine] Error 2

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#26 Post by tiger_eye »

Cool, so you compiled. You're getting very close. Now the linker doesn't know where to find the libraries (*.dll's). Double check your paths, and make sure the *dll's are where the paths say they are. I haven't compiled ToME in Windows before, so I doubt I can be much more help.

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#27 Post by Rectifier »

Okay so I've looked at the mingw website and figured out where it looks for the libraries, but what exactly does that jargon mean?

Code: Select all

-lSDLmain
-lopenal32
-lvorbisfile
-lpng12
Are these supposed to be .a, .h, or .dll ?

If they are supposed to be .dll the filenames don't exactly match...

Based on the contents of one of the folders they seem to be .a files.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#28 Post by tiger_eye »

Rectifier wrote:Okay so I've looked at the mingw website and figured out where it looks for the libraries, but what exactly does that jargon mean?

Code: Select all

-lSDLmain
-lopenal32
-lvorbisfile
-lpng12
That the linker is trying to link against these library objects, which can be *.dll or *.a (or *.so in linux).

So, in your premake4.lua file, "libdirs {" should include the locations where the necessary library objects are located (such as "libSDL.dll" or something similar). You can also check the file "build/TEngine.make" and look at the "LIBS = " line to see if it includes the location for the libraries (such as via "-L/c/mingw/lib").

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: Is the compilation instructions accurate for 64-bit Wind

#29 Post by Rectifier »

Moved the various .a files into mingw/lib, where I know is the place msys/gcc looks at.


Okay then. Had to compile libogg and libvorbis to continue, and I got this error over a hundred times where the (.text+) thing changed the hex number.

Code: Select all

c:/MinGW/lib/libvorbisfile.a(vorbisfile.o):vorbisfile.c:(.text+0x2c1c): undefined reference to `vorbis_synthesis_halfrate_p'

Which of course leads to:

Code: Select all

collect2: ld returned 1 exit status
make[1]: *** [../bin/Debug/t-engine.exe] Error 1
make: *** [TEngine] Error 2
This is why trying to program on windows suuuuucks.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Is the compilation instructions accurate for 64-bit Wind

#30 Post by tiger_eye »

If I understand correctly, you tried to compile ogg and vorbis but encountered errors, right? I think somebody else who has experience in building ToME in Windows should probably try to help you now. My suggestion would be to find pre-built library objects of ogg and vorbis, which shouldn't be too terribly difficult to find.

Post Reply