Page 1 of 2

Compilation

Posted: Sat Dec 29, 2012 8:50 am
by OpaqueOcculus
Wow, premake is strange compared to cmake and automake. I got it to work though. I'm trying to compile the new version on the Mac. I've gotten pretty far into the build process; actually, I used the same instructions as the compile instructions for Linux Debian (Mac's not very different with liberal use of macports). I'll write about it if I succeed in building this. Now please don't let your eyes glaze over when you hear Mac OSX... mine is more of a programming question.

I generated a makefile successfully with premake. Now I'm just trying to get the build to work. The issues are mostly compiler issues, I found one that is, well; irritating, not quite sure how to handle it.

>> make

-------------------------------
==== Building luajit2 (debug) ====
Running pre-build commands
gcc -o ../src/luajit2/src/buildvm ../src/luajit2/src/buildvm*.c
../src/luajit2/src/buildvm -m machasm -o ../src/luajit2/src/lj_vm.s
../src/luajit2/src/buildvm -m bcdef -o ../src/luajit2/src/lj_bcdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m ffdef -o ../src/luajit2/src/lj_ffdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m libdef -o ../src/luajit2/src/lj_libdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m recdef -o ../src/luajit2/src/lj_recdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m vmdef -o ../src/luajit2/vmdef.lua ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m folddef -o ../src/luajit2/src/lj_folddef.h ../src/luajit2/src/lj_opt_fold.c
lib_base.c
lib_bit.c
lib_debug.c
lib_ffi.c
lib_io.c
lib_jit.c
lib_math.c
lib_os.c
lib_string.c
lib_table.c
lj_bc.c
lj_dispatch.c
lj_err.c
lj_ffrecord.c
lj_opt_fold.c
lj_record.c
lj_vm.s
Linking luajit2
ranlib: file: ../bin/Debug/liblua.a(lj_gdbjit.o) has no symbols
==== Building fov (debug) ====
==== Building luasocket (debug) ====
==== Building luaprofiler (debug) ====
==== Building lualanes (debug) ====
==== Building lpeg (debug) ====
==== Building tcodimport (debug) ====
==== Building lxp (debug) ====
==== Building expatstatic (debug) ====
==== Building luamd5 (debug) ====
==== Building luazlib (debug) ====
==== Building luabitop (debug) ====
==== Building te4-bzip (debug) ====
==== Building TEngine (debug) ====
bspatch.c
../src/bspatch.c:34: error: expected ‘)’ before ‘*’ token
../src/bspatch.c: In function ‘spatch’:
../src/bspatch.c:66: error: ‘u_char’ undeclared (first use in this function)
../src/bspatch.c:66: error: (Each undeclared identifier is reported only once
../src/bspatch.c:66: error: for each function it appears in.)
../src/bspatch.c:66: error: expected ‘;’ before ‘header’
../src/bspatch.c:67: error: ‘old’ undeclared (first use in this function)
../src/bspatch.c:67: error: ‘new’ undeclared (first use in this function)
../src/bspatch.c:92: error: ‘header’ undeclared (first use in this function)
../src/bspatch.c:145: error: ‘buf’ undeclared (first use in this function)
make[1]: *** [../obj/Debug/TEngine/bspatch.o] Error 1
make: *** [TEngine] Error 2
----------------------------

Oh blargh! It doesn't recognize u_char? It knows what u_char is in my testfile!!! If you've run across this before, do you have a suggestion as to how to fix it? I could replace it with char, but that might have some nasty side effects. Dark God? Anyone?


An unrelated question: Is Tales of Maj' Eyal what used to be Troubles of Middle Earth, what used to be Pernband (before Anne Macaffery tried to sue it's developer)?

Re: Compilation

Posted: Sat Dec 29, 2012 5:31 pm
by OpaqueOcculus
Ok, u_char is a critter that exists in SDL.h, and guess what bspatch.c wasn't calling? I appreciate the chance to rant at the forum. You folks seem to be pretty active, probably nice folks too; a roguelike community. I have my suspicions about this source code; lua for scripting? Brilliant depending on how you implemented it. One could write a small library to translate lua into efficient c code. Now you might just be using lua to write all of the game content and allow the c functions and libraries to act as the framework for the engine. That would still be smart. It would be a pleasure to see how you designed it. I haven't dug into this yet, first things first, get the compilation off the ground. Well, bspatch.c compiles, on to the next crash and error!

Sono venuto, ho visto, voglio conquistare!

Re: Compilation

Posted: Sat Dec 29, 2012 5:39 pm
by OpaqueOcculus
The next crash:

Hmm... I may not have png.h... back to the download screen. Blargh!

--------------------------------------
>> make

core_lua.c
../src/core_lua.c:40:17: warning: png.h: No such file or directory
../src/core_lua.c: In function ‘lua_key_set_clipboard’:
../src/core_lua.c:351: warning: initialization discards qualifiers from pointer target type
../src/core_lua.c: At top level:
../src/core_lua.c:2471: error: expected ‘)’ before ‘png_ptr’
../src/core_lua.c:2476: error: expected ‘)’ before ‘png_ptr’
../src/core_lua.c: In function ‘sdl_get_png_screenshot’:
../src/core_lua.c:2490: error: ‘png_structp’ undeclared (first use in this function)
../src/core_lua.c:2490: error: (Each undeclared identifier is reported only once
../src/core_lua.c:2490: error: for each function it appears in.)
../src/core_lua.c:2490: error: expected ‘;’ before ‘png_ptr’
../src/core_lua.c:2491: error: ‘png_infop’ undeclared (first use in this function)
../src/core_lua.c:2491: error: expected ‘;’ before ‘info_ptr’
../src/core_lua.c:2492: error: ‘png_colorp’ undeclared (first use in this function)
../src/core_lua.c:2492: error: expected ‘;’ before ‘palette’
../src/core_lua.c:2493: error: ‘png_byte’ undeclared (first use in this function)
../src/core_lua.c:2493: error: ‘image’ undeclared (first use in this function)
../src/core_lua.c:2494: error: ‘png_bytep’ undeclared (first use in this function)
../src/core_lua.c:2494: error: ‘row_pointers’ undeclared (first use in this function)
../src/core_lua.c:2496: error: ‘png_ptr’ undeclared (first use in this function)
../src/core_lua.c:2496: error: ‘PNG_LIBPNG_VER_STRING’ undeclared (first use in this function)
../src/core_lua.c:2503: error: ‘info_ptr’ undeclared (first use in this function)
../src/core_lua.c:2506: error: ‘png_infopp’ undeclared (first use in this function)
../src/core_lua.c:2518: error: ‘png_write_data_fn’ undeclared (first use in this function)
../src/core_lua.c:2518: error: ‘png_output_flush_fn’ undeclared (first use in this function)
../src/core_lua.c:2520: error: ‘PNG_COLOR_TYPE_RGB’ undeclared (first use in this function)
../src/core_lua.c:2521: error: ‘PNG_INTERLACE_NONE’ undeclared (first use in this function)
../src/core_lua.c:2521: error: ‘PNG_COMPRESSION_TYPE_DEFAULT’ undeclared (first use in this function)
../src/core_lua.c:2521: error: ‘PNG_FILTER_TYPE_DEFAULT’ undeclared (first use in this function)
../src/core_lua.c:2523: error: expected expression before ‘)’ token
../src/core_lua.c:2531: error: expected expression before ‘)’ token
../src/core_lua.c:2546: error: expected ‘;’ before ‘image’
../src/core_lua.c:2550: error: ‘PNG_TRANSFORM_IDENTITY’ undeclared (first use in this function)

Re: Compilation

Posted: Sat Dec 29, 2012 5:46 pm
by OpaqueOcculus
Solved. This next error is a bit of a doozy... If you know the solution, please don't hesitate to post. I intend to figure it out, but I'm not as bright as I'd like to be. There might be some that I don't know how to solve.

---------------------
unknowne4ce8f38ceec:t-engine4 jon$ sudo port install libpng
Password:
---> Computing dependencies for libpng
---> Fetching archive for libpng
---> Attempting to fetch libpng-1.5.13_0.darwin_10.i386.tbz2 from http://packages.macports.org/libpng
---> Attempting to fetch libpng-1.5.13_0.darwin_10.i386.tbz2 from http://mse.uk.packages.macports.org/sit ... org/libpng
---> Attempting to fetch libpng-1.5.13_0.darwin_10.i386.tbz2 from http://lil.fr.packages.macports.org/libpng
---> Fetching distfiles for libpng
---> Attempting to fetch libpng-1.5.13.tar.xz from http://superb-dca3.dl.sourceforge.net/p ... g15/1.5.13
---> Verifying checksum(s) for libpng
---> Extracting libpng
---> Configuring libpng
---> Building libpng
---> Staging libpng into destroot
---> Installing libpng @1.5.13_0
---> Activating libpng @1.5.13_0
---> Cleaning libpng
---> Updating database of binaries: 100.0%
---> Scanning binaries for linking errors: 100.0%
---> No broken files found.
unknowne4ce8f38ceec:t-engine4 jon$ make
==== Building physfs (debug) ====
==== Building luajit2 (debug) ====
Running pre-build commands
gcc -o ../src/luajit2/src/buildvm ../src/luajit2/src/buildvm*.c
../src/luajit2/src/buildvm -m machasm -o ../src/luajit2/src/lj_vm.s
../src/luajit2/src/buildvm -m bcdef -o ../src/luajit2/src/lj_bcdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m ffdef -o ../src/luajit2/src/lj_ffdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m libdef -o ../src/luajit2/src/lj_libdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m recdef -o ../src/luajit2/src/lj_recdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m vmdef -o ../src/luajit2/vmdef.lua ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m folddef -o ../src/luajit2/src/lj_folddef.h ../src/luajit2/src/lj_opt_fold.c
lib_base.c
lib_bit.c
lib_debug.c
lib_ffi.c
lib_io.c
lib_jit.c
lib_math.c
lib_os.c
lib_string.c
lib_table.c
lj_bc.c
lj_dispatch.c
lj_err.c
lj_ffrecord.c
lj_opt_fold.c
lj_record.c
lj_vm.s
Linking luajit2
ranlib: file: ../bin/Debug/liblua.a(lj_gdbjit.o) has no symbols
==== Building fov (debug) ====
==== Building luasocket (debug) ====
==== Building luaprofiler (debug) ====
==== Building lualanes (debug) ====
==== Building lpeg (debug) ====
==== Building tcodimport (debug) ====
==== Building lxp (debug) ====
==== Building expatstatic (debug) ====
==== Building luamd5 (debug) ====
==== Building luazlib (debug) ====
==== Building luabitop (debug) ====
==== Building te4-bzip (debug) ====
==== Building TEngine (debug) ====
core_lua.c
../src/core_lua.c: In function ‘lua_key_set_clipboard’:
../src/core_lua.c:351: warning: initialization discards qualifiers from pointer target type
display_sdl.c
dmnd_square.c
fov.c
getself.c
../src/getself.c: In function ‘get_self_executable’:
../src/getself.c:72: warning: passing argument 2 of ‘_NSGetExecutablePath’ from incompatible pointer type
../src/getself.c:73: warning: incompatible implicit declaration of built-in function ‘malloc’
../src/getself.c:74: warning: passing argument 2 of ‘_NSGetExecutablePath’ from incompatible pointer type
glew.c
main.c
In file included from ../src/main.c:40:
../src/music.h:27:24: warning: vorbisfile.h: No such file or directory
../src/music.h:38:17: error: SDL.h: No such file or directory
../src/music.h:39:24: error: SDL_thread.h: No such file or directory
In file included from ../src/main.c:40:
../src/music.h:54: error: expected specifier-qualifier-list before ‘OggVorbis_File’
make[1]: *** [../obj/Debug/TEngine/main.o] Error 1
make: *** [TEngine] Error 2

Re: Compilation

Posted: Sat Dec 29, 2012 5:58 pm
by OpaqueOcculus
Ok, using macports to grab vorbis-tools. I found a nasty error, probably the most pernicious one yet.

""""
core_lua.c
../src/core_lua.c: In function ‘lua_key_set_clipboard’:
../src/core_lua.c:351: warning: initialization discards qualifiers from pointer target type
display_sdl.c
dmnd_square.c
fov.c
getself.c
../src/getself.c: In function ‘get_self_executable’:
../src/getself.c:72: warning: passing argument 2 of ‘_NSGetExecutablePath’ from incompatible pointer type
../src/getself.c:73: warning: incompatible implicit declaration of built-in function ‘malloc’
../src/getself.c:74: warning: passing argument 2 of ‘_NSGetExecutablePath’ from incompatible pointer type
glew.c
main.c
In file included from ../src/main.c:40:
../src/music.h:27:24: warning: vorbisfile.h: No such file or directory
../src/music.h:38:17: error: SDL.h: No such file or directory
../src/music.h:39:24: error: SDL_thread.h: No such file or directory
In file included from ../src/main.c:40:
../src/music.h:54: error: expected specifier-qualifier-list before ‘OggVorbis_File’
make[1]: *** [../obj/Debug/TEngine/main.o] Error 1
make: *** [TEngine] Error 2
"""

The error it crashed on is easy to fix. It's getself.c, and core_lua.c that has all of my spider senses tingling. I've never seen an incompatible pointer type error before. It's not as decisive as a seg fault... but it looks like it could be bad, like "I compiled TOME and my screen is all white now"-type bad.

Re: Compilation

Posted: Sat Dec 29, 2012 6:11 pm
by OpaqueOcculus
Passing the error, for now; I'll come back to it if perniciousness persists . Just downloaded lib-vorbis and ogg tools.

Re: Compilation

Posted: Sat Dec 29, 2012 6:18 pm
by OpaqueOcculus
Would it be alright to add a MacOSX trunk to svn? I've changed a lot and I really don't want to break the build for other folks. With everything that I've done, all of the header files for SDL are found in <SDL2/***sdl*stuff***.h>. Then again, I could go in and change things in the conditional include statements... growls... that would take awhile.

Re: Compilation

Posted: Sat Dec 29, 2012 6:43 pm
by OpaqueOcculus
The thing that I dread. Leaves me in a cold sweat at night... linking errors! I have about as much expertise in fixing these as your average parakeet. This is going to add an extra hour to the compilation process. I will swear, I will rage, I will persevere. No, seriously, if you have a desire to help, I need as much as I can get when it comes to these things.


--------
==== Building fov (debug) ====
==== Building luasocket (debug) ====
==== Building luaprofiler (debug) ====
==== Building lualanes (debug) ====
==== Building lpeg (debug) ====
==== Building tcodimport (debug) ====
==== Building lxp (debug) ====
==== Building expatstatic (debug) ====
==== Building luamd5 (debug) ====
==== Building luazlib (debug) ====
==== Building luabitop (debug) ====
==== Building te4-bzip (debug) ====
==== Building TEngine (debug) ====
main.c
music.c
Linking TEngine
ld: framework not found SDL
collect2: ld returned 1 exit status
make[1]: *** [t-engine.app/Contents/MacOS/t-engine] Error 1
make: *** [TEngine] Error 2
--------

Re: Compilation

Posted: Sat Dec 29, 2012 7:19 pm
by OpaqueOcculus
Ok, so, I will need to change the makefile... problem is, I don't really know how to read the things.

I have the libraries. They should work.

unknowne4ce8f38ceec:t-engine4 jon$ ls /usr/local/lib
libSDL2-2.0.0.dylib libSDL2_image-1.2.0.dylib libSDL2_test.a libSDL2_ttf.la
libSDL2.a libSDL2_image.a libSDL2_ttf-2.0.0.dylib libSDL2main.a
libSDL2.dylib libSDL2_image.dylib libSDL2_ttf.a pkgconfig
libSDL2.la libSDL2_image.la libSDL2_ttf.dylib

"""
Linking TEngine
ld: framework not found SDL
"""

Let me tell you a bit about how linking works in MacOSX: say that I want to link the OpenGL, and GLUT libraries; well, unlike in Linux, there is an extra directory structure called: /Developer/, it contains all of the frameworks in this structure. These are a backwards way of having libraries interact with the Macintosh operating system, to be honest, I think that Apple was just trying to be cute. I wouldn't design it that way because I actually care about cross-compatibility between architectures, and I hate having to bend over backwards every time I want something to compile. Adding 4-8 hours to every compilation process is not my idea of efficiency, but ok Apple, you're the one who's designing the shiny computers, not me.

Anyways, to do this, I need to say:

gcc --framework Carbon --framework OpenGL --framework GLUT myShinyProgram.c

This example might not be completely accurate, but it conveys the right idea. Incidentally, the Carbon framework is what interacts with the graphics in a Macintosh operating system. Whose idea was it to tie the graphical behaviors of a computer to the operating system? Oh, that's right, that's one of the many accidents of history. And the reason why OpenGL has an R-G-B color description scheme for it's functions and why DirectX has an R-B-G color description scheme. Want to know why games are usually made for Windows and not Macintosh? It's a tale of intrigue, business, backstabbing, and many other "B"s that we won't get into right now. Somewhere in the makefile, it's calling:

gcc *stuff* --framework SDL *more-stuff* -o executable.

For this to compile and link correctly, I think we can get away with:

gcc *stuff* *more-stuff* -o executable.

Because I am using SDL2 and not SDL. (I don't actually have the SDL framework, that's the source of the error). Now to fix it. I need to alter the Makefile, or/and change the settings in the premake4.lua file. Now I'm very afraid that I'll break something.

Re: Compilation

Posted: Sat Dec 29, 2012 8:07 pm
by OpaqueOcculus
By the way, take my account of the histories and the architectures with a grain of salt. I just learned that "Carbon consists of a broad set of functions for managing files, memory, data, the user interface, and other system services."

I've interacted with it in the context of graphics, so I assumed that's what it was for, I was understanding things incorrectly. I'll get around to referencing and correcting my various statements, assertions, and attempts at humor someday.

Re: Compilation

Posted: Sat Dec 29, 2012 10:59 pm
by OpaqueOcculus
Help on this project hasn't been very forth-coming. Development has always been a somewhat lonely endeavor. After installing the SDL, SDL_ttf, SDL_image, SDL_mixer frameworks, I've succeeded in moving beyond the original linker error, now I have something even more difficult to contend with. There are several symbols that the linker doesn't seem to know how to deal with. Read the compilation routine below.

I suspect that the problem has something to do with the fact that SDL2 is being used for most of these definitions, and these functions are reading SDL_1.4:

To be honest, I may just take a break and do something else for awhile. My head is swimming. I'm not sure how to fix this.

==== Building physfs (debug) ====
==== Building luajit2 (debug) ====
Running pre-build commands
gcc -o ../src/luajit2/src/buildvm ../src/luajit2/src/buildvm*.c
../src/luajit2/src/buildvm -m machasm -o ../src/luajit2/src/lj_vm.s
../src/luajit2/src/buildvm -m bcdef -o ../src/luajit2/src/lj_bcdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m ffdef -o ../src/luajit2/src/lj_ffdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m libdef -o ../src/luajit2/src/lj_libdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m recdef -o ../src/luajit2/src/lj_recdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m vmdef -o ../src/luajit2/vmdef.lua ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m folddef -o ../src/luajit2/src/lj_folddef.h ../src/luajit2/src/lj_opt_fold.c
lib_base.c
lib_bit.c
lib_debug.c
lib_ffi.c
lib_io.c
lib_jit.c
lib_math.c
lib_os.c
lib_string.c
lib_table.c
lj_bc.c
lj_dispatch.c
lj_err.c
lj_ffrecord.c
lj_opt_fold.c
lj_record.c
lj_vm.s
Linking luajit2
ranlib: file: ../bin/Debug/liblua.a(lj_gdbjit.o) has no symbols
==== Building fov (debug) ====
==== Building luasocket (debug) ====
==== Building luaprofiler (debug) ====
==== Building lualanes (debug) ====
==== Building lpeg (debug) ====
==== Building tcodimport (debug) ====
==== Building lxp (debug) ====
==== Building expatstatic (debug) ====
==== Building luamd5 (debug) ====
==== Building luazlib (debug) ====
==== Building luabitop (debug) ====
==== Building te4-bzip (debug) ====
==== Building TEngine (debug) ====
Linking TEngine
Undefined symbols:
"_SDL_GetScancodeName", referenced from:
_lua_get_scancode_name in core_lua.o
"_SDL_WarpMouseInWindow", referenced from:
_lua_set_mouse in core_lua.o
"_SDL_CreateWindow", referenced from:
_do_resize in main.o
"_SDL_FlushEvents", referenced from:
_lua_flush_key_events in core_lua.o
"_SDL_GetNumDisplayModes", referenced from:
_SDL_ListModes in core_lua.o
"_ov_streams", referenced from:
_loadsoundLua in music.o
"_SDL_GetClipboardText", referenced from:
_lua_key_get_clipboard in core_lua.o
"_SDL_CreateColorCursor", referenced from:
_sdl_set_mouse_cursor in core_lua.o
_sdl_set_mouse_cursor in core_lua.o
"_png_set_longjmp_fn", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_HasClipboardText", referenced from:
_lua_key_get_clipboard in core_lua.o
"_SDL_GetNumVideoDrivers", referenced from:
_tengine_main in main.o
"_ov_info", referenced from:
_staticLoader in music.o
_streamingLoader in music.o
"_SDL_GetDisplayMode", referenced from:
_SDL_ListModes in core_lua.o
"_SDL_EnableScreenSaver", referenced from:
_tengine_main in main.o
"_SDL_GetWindowID", referenced from:
_do_resize in main.o
"_ov_read", referenced from:
_readSoundData in music.o
"_SDL_GetWindowSurface", referenced from:
_do_resize in main.o
_do_resize in main.o
"_SDL_CalculateGammaRamp", referenced from:
_sdl_set_gamma in core_lua.o
"_png_set_rows", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_StopTextInput", referenced from:
_lua_key_unicode in core_lua.o
"_SDL_GetWindowSize", referenced from:
_do_resize in main.o
_draw_last_frame in wait.o
_enable in wait.o
"_SDL_GetDesktopDisplayMode", referenced from:
_SDL_GetVideoInfo in core_lua.o
"_ov_pcm_total", referenced from:
_staticLoader in music.o
"_ov_raw_seek_lap", referenced from:
_readSoundData in music.o
"_png_destroy_write_struct", referenced from:
_sdl_get_png_screenshot in core_lua.o
_sdl_get_png_screenshot in core_lua.o
_sdl_get_png_screenshot in core_lua.o
_sdl_get_png_screenshot in core_lua.o
_sdl_get_png_screenshot in core_lua.o
"_ov_raw_seek", referenced from:
_soundPlayLua in music.o
"_SDL_SetWindowIcon", referenced from:
_tengine_main in main.o
"_png_create_info_struct", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_GL_MakeCurrent", referenced from:
_do_resize in main.o
_do_resize in main.o
"_SDL_SetWindowSize", referenced from:
_do_resize in main.o
"_SDL_SetClipboardText", referenced from:
_lua_key_set_clipboard in core_lua.o
"_png_write_png", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_SetSurfaceBlendMode", referenced from:
_SDL_SetAlpha in core_lua.o
_SDL_SetAlpha in core_lua.o
"_SDL_SetWindowTitle", referenced from:
_sdl_set_window_title in core_lua.o
_boot_lua in main.o
_tengine_main in main.o
"_png_get_io_ptr", referenced from:
_png_write_data_fn in core_lua.o
"_SDL_SetWindowPosition", referenced from:
_sdl_set_window_pos in core_lua.o
"_ov_open_callbacks", referenced from:
_loadsoundLua in music.o
"_SDL_SetWindowGammaRamp", referenced from:
_sdl_set_gamma in core_lua.o
"_SDL_GL_SwapWindow", referenced from:
_on_redraw in main.o
_enable in wait.o
"_SDL_SetWindowFullscreen", referenced from:
_do_resize in main.o
_do_resize in main.o
"_SDL_GL_CreateContext", referenced from:
_do_resize in main.o
"_png_create_write_struct", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_SetSurfaceAlphaMod", referenced from:
_SDL_SetAlpha in core_lua.o
_SDL_SetAlpha in core_lua.o
"_png_set_IHDR", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_png_set_write_fn", referenced from:
_sdl_get_png_screenshot in core_lua.o
"_SDL_GetVideoDriver", referenced from:
_tengine_main in main.o
"_SDL_SetSurfaceRLE", referenced from:
_SDL_SetAlpha in core_lua.o
"_SDL_AllocFormat", referenced from:
_SDL_GetVideoInfo in core_lua.o
"_SDL_GetWindowPosition", referenced from:
_tengine_main in main.o
"_ov_clear", referenced from:
_staticLoader in music.o
_soundCollectLua in music.o
"_SDL_StartTextInput", referenced from:
_lua_key_unicode in core_lua.o
_tengine_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [t-engine.app/Contents/MacOS/t-engine] Error 1
make: *** [TEngine] Error 2

Re: Compilation

Posted: Sun Dec 30, 2012 12:36 am
by OpaqueOcculus
Ok, I've had to add a lot of the linker flags for the libraries. It's found every one of the without a problem, but there exists more that needs to be fixed.

This puppy is very nearly compiled and ready to be released as a pre-compiled binary for MacOSX 10.6.

I think I have 1 to 3 more errors to slog through.

"ld: section ._mach_header exceeds 4GB limit"

Umm... say what? How, who, what?! Help!

This last one has me completely stumped:

----------
unknowne4ce8f38ceec:t-engine4 jon$ make
==== Building physfs (debug) ====
==== Building luajit2 (debug) ====
Running pre-build commands
gcc -o ../src/luajit2/src/buildvm ../src/luajit2/src/buildvm*.c
../src/luajit2/src/buildvm -m machasm -o ../src/luajit2/src/lj_vm.s
../src/luajit2/src/buildvm -m bcdef -o ../src/luajit2/src/lj_bcdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m ffdef -o ../src/luajit2/src/lj_ffdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m libdef -o ../src/luajit2/src/lj_libdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m recdef -o ../src/luajit2/src/lj_recdef.h ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m vmdef -o ../src/luajit2/vmdef.lua ../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c
../src/luajit2/src/buildvm -m folddef -o ../src/luajit2/src/lj_folddef.h ../src/luajit2/src/lj_opt_fold.c
lib_base.c
lib_bit.c
lib_debug.c
lib_ffi.c
lib_io.c
lib_jit.c
lib_math.c
lib_os.c
lib_string.c
lib_table.c
lj_bc.c
lj_dispatch.c
lj_err.c
lj_ffrecord.c
lj_opt_fold.c
lj_record.c
lj_vm.s
Linking luajit2
ranlib: file: ../bin/Debug/liblua.a(lj_gdbjit.o) has no symbols
==== Building fov (debug) ====
==== Building luasocket (debug) ====
==== Building luaprofiler (debug) ====
==== Building lualanes (debug) ====
==== Building lpeg (debug) ====
==== Building tcodimport (debug) ====
==== Building lxp (debug) ====
==== Building expatstatic (debug) ====
==== Building luamd5 (debug) ====
==== Building luazlib (debug) ====
==== Building luabitop (debug) ====
==== Building te4-bzip (debug) ====
==== Building TEngine (debug) ====
Linking TEngine
ld: section ._mach_header exceeds 4GB limit
collect2: ld returned 1 exit status
make[1]: *** [t-engine.app/Contents/MacOS/t-engine] Error 1
make: *** [TEngine] Error 2
-----------------------

Re: Compilation

Posted: Sun Dec 30, 2012 3:54 am
by OpaqueOcculus
I have some bad news.

It looks like I can't continue from here on. I'd love to contribute to this project, I really would; but I think the 4GB limit is a hardware limitation. It means that my computer doesn't physically have enough RAM to compile the T-Engine. I'm not sure if I could break the build up into multiple smaller pieces and have that succeed or not. I could give it a shot. I would need to write a small python script to read the makefile script, append the compiler flags to a string and assemble the object files in piece-wise fashion. I can try it; but I don't honestly know what caused this issue. I've never seen this happen before.

I probably won't be pulling a solution out of thin air for this one. But I'm sure that some of the more experienced developers here might know what's going on... if they'd be willing to respond. Does anyone have any idea how to fix this?

Re: Compilation

Posted: Mon Dec 31, 2012 4:34 am
by lenocinor
In case anyone gets scared by this later, 4 GB is more than enough to compile T-Engine. I've done it many times with the 4 GB in my machine. :) If you have questions about compilation, feel free to come to the IRC channel and ask, as OpaqueOcculus did. You should find plenty of folks there willing to help.

Re: Compilation

Posted: Mon Dec 31, 2012 5:53 am
by OpaqueOcculus
Yep, this is a nice group. And they are happy to help!

I managed to get it to compile, problem is I haven't succeeded in getting it to link properly. Remember that you can't have an executable without a successful linking step.

Still trying.