Is the compilation instructions accurate for 64-bit Windows?

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

Moderator: Moderator

Message
Author
Mithril
Archmage
Posts: 327
Joined: Fri Oct 01, 2010 5:43 pm

Is the compilation instructions accurate for 64-bit Windows?

#1 Post by Mithril »

So I tried to follow the instructions at http://te4.org/wiki/howtocompile but it did not work. Now, since I have Windows 7 64-bit may it be related to this? Is a 64-bit version of something required?

I am really eager to try out some of the new enhancements so since this attempt failed I am yearning for the next release to be ready soon. :mrgreen:

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

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

#2 Post by Rectifier »

I have an x64 system as well, and it can run any x86 (that means 32-bit) program.

I haven't tried compiling an svn for anything since my old laptop died, so I can't help much.
I recommend posting an error log for some tips.

Mithril
Archmage
Posts: 327
Joined: Fri Oct 01, 2010 5:43 pm

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

#3 Post by Mithril »

Rectifier wrote:I have an x64 system as well, and it can run any x86 (that means 32-bit) program.

I haven't tried compiling an svn for anything since my old laptop died, so I can't help much.
I recommend posting an error log for some tips.
I think that for example certain anti-virus program for 32-bit Windows cannot be run on 64-bit Windows due to low level OS differences such as "Patchguard". Whether such issues affect compilation I have no idea, I just raised the possibility.

However, the problem is likely something else. The compilation instruction seems unclear. I should enter the correct paths in premake4.lua to certain folders. Such as correcting the path to "/c/mingw2/include/SDL_image-1.2.10/include/". But these folders do not seem to exist. There is no such folders in the mingw2/include folder. Looking at the older Windows instruction these folders seems to be created from separate downloads that are not mentioned in the newer instruction. Is the newer instruction correct?

The error message I get after entering the make command is:
Building physfs (debug)
physfs.c
/bin/sh: gcc: command not found
make[1]: *** [..obj/Debug/physfs/physfs.o] Error 127
make: *** [physfs] Error 2

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

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

#4 Post by Rectifier »

Okay so I read up a bit on the compiling instructions for windows.

Seems to me that both instructions sets are "correct" but the newer one is a bit vague.

Those folders that you are missing, you need to actually download these and put them into your mingw folder, all the bolded lines are things that you have to obtain apart from that original mingw installation.
  • "/c/mingw2/include/vorbis",
    "/c/mingw2/include/SDL",
    "/c/mingw2/include/SDL_ttf-2.0.9/include/",
    "/c/mingw2/include/SDL_image-1.2.10/include/",
    "/c/mingw2/include/SDL_mixer-1.2.11/include/",
    "/c/mingw2/include/libvorbis-1.3.2/include",
    "/c/mingw2/include/libogg-1.2.2/include",
After looking at the instructions a bit more it seems as though the older instructions are the same (though more explicit in detail) as the newer set except that the new one has you edit an environment variable as part of the mingw setup.

Mithril
Archmage
Posts: 327
Joined: Fri Oct 01, 2010 5:43 pm

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

#5 Post by Mithril »

Thanks!

However, it seems unclear if SDL 1.2 or 1.3 should be used? Despite what the text says sometimes, I assume that SDL 1.3 should be used? And that it is this file? http://tomenotes.wikispaces.com/file/detail/SDL.dll

Have any other the other requirements changed? The statement "Most of the instructions on this page have not yet been updated for beta 32's new requirements" seems enigmatic.

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

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

#6 Post by greycat »

Mithril wrote: /bin/sh: gcc: command not found
Sounds like you don't have gcc (the C compiler) installed.

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

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

#7 Post by Rectifier »

greycat wrote:
Mithril wrote: /bin/sh: gcc: command not found
Sounds like you don't have gcc (the C compiler) installed.
Or he hasn't created the new environment variable yet.
Which by the way Mithril if you want to use the mingw C compiler you have to do an extra step to integrate it into the command line.

This is how I integrated MinGw into my x64 windows 7 command line:

Code: Select all

Start > Control Panel > System > Advanced System Settings > Advanced Tab >

Environment Variables Button > Under SYSTEM VARIABLES look for the "PATH" or "Path" variable >

Highlight that variable and click on Edit > Click on the variable value box, then press the END key >

Make sure that box ends with a semi colon character ";" if it doesn't have one, TYPE IT IN >

Enter the minGw/bin/ directory, EXAMPLE[ C:\MinGW\bin ] > Add a semi colon at the end >

Click OK 3 times until you are out of system settings > Test the gcc compiler with a simple program

Congrats you integrated MinGw into your command prompt!
Also Mithril, as to that SDL.dll file, I would get those other folders, the libraries and includes, and do a search for an SDL.dll file.

Then, rename that original .dll file to something like SDL.dll.orig which isn't a used file extension.

Finally take the newly downloaded SDL.dll and place it in the place where the original was once located.

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

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

#8 Post by Rectifier »

I hate to bump this, but did my advice help you or did you give up?

Mithril
Archmage
Posts: 327
Joined: Fri Oct 01, 2010 5:43 pm

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

#9 Post by Mithril »

Well, the 35 alpha arrived so I gave up...

Someone knowledgeable may consider combining the new and old instructions in the wiki in order to get a complete set for Windows.

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

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

#10 Post by Rectifier »

Hmm, maybe when I don't have classes during the holidays and remember this little thread or ask a question in the dev sub-section, hmm.

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

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

#11 Post by Rectifier »

Been trying my own hand at compiling tome for my desktop.

Followed these steps:
1. Get svn program and create the folder C:\tengine
2. Checkout latest svn, number 4651
3. Downloaded the following: SDL, SDL_mixer, SDL_image, SDL_ttf, premake4, mingw (the SDL libs must be the developer type)
4. Create the folder C:\tengine\libs
5. Extract .zip files from step 3 into libs folder
6. Install mingw, checked the boxes C compiler, C++ compiler, MSYS, and Dev utilities
7. Edit the environment variable PATH for mingw
8. In the folder C:\tengine open premake4.lua using notepad++
9. Edited my premake4.lua to correctly point at my libs and includes
Meaning the version numbers in the following code block must match the folders in C:\tengine\libs

Code: Select all

configuration "windows"
	libdirs {
		"libs/SDL-1.2.14/lib",
		"libs/SDL_ttf-2.0.10/lib",
		"libs/SDL_image-1.2.10/lib",
		"libs/SDL_mixer-1.2.11/lib",
		"libs/libvorbis-1.3.2/lib/.libs",
		"libs/libogg-1.3.0/src/.libs",
		"/c/MinGW/lib",
	}
	includedirs {
		"libs/SDL-1.2.14/include/SDL",
		"libs/SDL_ttf-2.0.10/include/",
		"libs/SDL_image-1.2.10/include/",
		"libs/SDL_mixer-1.2.11/include/",
		"libs/libvorbis-1.3.2/include",
		"libs/libogg-1.3.0/include",
		"/c/MinGW/include/GL",
	}
Noticed extra libs and includes not from the compile instructions!!
Downloaded them, google search libvorbis, clicked on the first result, get the .zip files for libvorbis and libogg
Extract these new .zip into the C:\tengine\libs folder

10. Open MSYS, Start > All Programs > MinGW > MinGW Shell
11. Type [ cd /c/tengine ], this will point the shell to that directory
12. Type [ premake4.exe gmake ], this will generate roughly 20 lines and some files in your tengine directory
13. Type [ make -e CC=gcc ], this will attempt to build Tome

This is as far as I get, MSYS returns a fatal error and ends compilation:

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:40:17: fatal error: png.h: No such file or directory
compilation terminated.
make[1]: *** [../obj/Debug/TEngine/core_lua.o] Error 1
make: *** [TEngine] Error 2
I tried using lpng156 (the latest png library), putting it in my libs folder and adding a line in premake4.lua pointing to it, but that did nothing.

Dekar
Spiderkin
Posts: 559
Joined: Wed Jan 26, 2011 3:47 pm

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

#12 Post by Dekar »

Some timed ago I successfully compiled with 64-bit Windows.
Your steps look like what I wrote on the talk page back then, so that should be ok.

I grabbed the latest version and tried to compile, worked fine.

The redefine doesn't matter, but you are clearly missing a file there: png.h which is require for core.lua.
png.h should be in MinGW/include. I see a libpng12.a file so thats probably my version.

Here is my premake4.lua: http://pastebin.com/disemr1S

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

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

#13 Post by Rectifier »

I added png.h and pngconfig.h; then get this.

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:42:1: error: unknown type name 'SDL_Window'
../src/core_lua.c: In function 'lua_get_scancode_name':
../src/core_lua.c:196:2: error: unknown type name 'SDL_Scancode'
../src/core_lua.c:197:2: warning: passing argument 2 of 'lua_pushstring' makes pointer from integer without a cast [enabled by default]
../src/luajit2/src/lua.h:164:16: note: expected 'const char *' but argument is of type 'int'
../src/core_lua.c: In function 'lua_flush_key_events':
../src/core_lua.c:203:31: error: 'SDL_TEXTINPUT' undeclared (first use in this function)
../src/core_lua.c:203:31: note: each undeclared identifier is reported only once for each function it appears in
../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]
../src/core_lua.c: In function 'lua_key_get_clipboard':
../src/core_lua.c:225:15: warning: initialization makes pointer from integer without a cast [enabled by default]
../src/core_lua.c: In function 'sdl_set_mouse_cursor':
../src/core_lua.c:1743:21: warning: assignment makes pointer from integer without a cast [enabled by default]
../src/core_lua.c:1761:16: warning: assignment makes pointer from integer without a cast [enabled by default]
make[1]: *** [../obj/Debug/TEngine/core_lua.o] Error 1
make: *** [TEngine] Error 2
Getting flashbacks to my first c/c++ class, ugh.

Dekar
Spiderkin
Posts: 559
Joined: Wed Jan 26, 2011 3:47 pm

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

#14 Post by Dekar »

A stab in the dark:
3. Downloaded the following: SDL, SDL_mixer, SDL_image, SDL_ttf, premake4, mingw (the SDL libs must be the developer type)
4. Create the folder C:\tengine\libs
5. Extract .zip files from step 3 into libs folder
Don't make a new lib folder but use MinGW/lib and MinGW/include.

Code: Select all

Then edit your premake4.lua and write the full file path, e.g.:
    includedirs {
        "/c/mingw/include/SDL",
        "/c/mingw/include/SDL_ttf-2.0.9/include/",
        "/c/mingw/include/SDL_image-1.2.10/include/",
        "/c/mingw/include/SDL_mixer-1.2.11/include/",
        "/c/mingw/include/libvorbis-1.3.2/include",
        "/c/mingw/include/libogg-1.2.2/include",
        "/c/mingw/include/GL",
        "/c/mingw/include/vorbis",
        "/c/mingw/include",
Or maybe you just forgot to put some of the files in the include directory?

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

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

#15 Post by Rectifier »

Tried your suggestion, barfs out the same errors.


I'm sure theres something stupid that I'm forgetting somewhere, but no clue what it is. :?

I think its because I don't have libpng.a, but I can't find that file in the source; and it won't let me compile lpng without zlib, and zlib won't let me compile using the makefile...gawd.

Post Reply