Jump to content

Compiling a module on linux


Recommended Posts

hey guys,

I am trying to compile a module via makefile on Debian Lenny (x86).

It works fine on windows, but on linux I always get this error:

make: *** No rule to make target `/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include/stddef.h', needed by `CFunctions.o'.  Stop." 

Are there any additional packages, which i need?

Link to comment

First I downloaded the Module SDK from https://wiki.multitheftauto.com/wiki/Modules

Then I tried:

make 

and got that error message (look at previous post). There isn't also a configure file, required for make?.

On another debian lenny (x64), i got this message:

make: *** No rule to make target `/usr/include/gnu/stubs-32.h', needed by `CFunctions.o'.  Stop. 

I also tried to add all files to a Code::Blocks Project. First I got the compiler message that some header files are missing.

After I put in the absolute path (include/ILuaModuleManager.h) and included 'string.h' instead of 'string' (ml_base.cpp), the library was successfully compiled.

Then I loaded the module with the server and i got this message:

MODULE: Unable to find modules/libml_svn.so (/home/mtasa/mta/mods/dea 
thmatch/modules/libml_svn.so: undefined symbol: lua_type)! 

I also uploaded the Code::Blocks Project including all files: http://gamer-search.dyndns.org/ml_svn.tar.gz

edit:

Have you compiled lua first ?

Do I have to compile lua first? How? Isn't including lua.h and others headerfiles enough?

Link to comment

First of all, thank you.

If i try to compile lua, i'll get the output that there's a dependency to readline.

Because of that I downloaded readline from http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html (I tried 6.2&6.3), but if I now try to compile lua, i'll get this output:

make[1]: Entering directory `/root/ml_svn/lib/lua51/src' 
make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" 
make[2]: Entering directory `/root/ml_svn/lib/lua51/src' 
gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses 
/usr/bin/ld: cannot find -lreadline 
collect2: ld returned 1 exit status 
make[2]: *** [lua] Error 1 
make[2]: Leaving directory `/root/ml_svn/lib/lua51/src' 
make[1]: *** [linux] Error 2 
make[1]: Leaving directory `/root/ml_svn/lib/lua51/src' 
make: *** [linux] Error 2 

I moved readline's source to /usr/local/include/readline/ and I also tried to compile readline and moved the compiled libraries to /usr/local/libs/, but the output is always the same.

Link to comment
  • 2 years later...

Hello.

I'm trying to compile ml_base on Wheezy. This is what I'm getting after doing "make" in the module dir:

gallardo@er-mta:~/ml_base$ make 
gcc  -g -MD -Wall -I./ -m32  -c -o CFunctions.o CFunctions.cpp 
gcc  -g -MD -Wall -I./ -m32  -c -o CThread.o CThread.cpp 
gcc  -g -MD -Wall -I./ -m32  -c -o CThreadData.o CThreadData.cpp 
gcc  -g -MD -Wall -I./ -m32  -c -o ml_base.o ml_base.cpp 
gcc -g -MD -Wall -I./ -m32 -fPIC -shared -Wl,-soname,ml_base.so.1,-R./ -o ml_base.so ./CFunctions.o ./CThread.o ./CThreadData.o ./ml_base.o -lpthread -lstdc++ -llua 
/usr/bin/ld: skipping incompatible /usr/local/lib/liblua.a when searching for -llua 
/usr/bin/ld: cannot find -llua 

Any solutions? Thanks.

lua5.1 is installed, so are all the things for building default mta server

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...