Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

Does not build on Linux #38

Closed
grepwood opened this issue Feb 16, 2015 · 6 comments
Closed

Does not build on Linux #38

grepwood opened this issue Feb 16, 2015 · 6 comments

Comments

@grepwood
Copy link

This happens when all the .o are compiled and you're about to link the main executable.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/otserv.dir/connection.cpp.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5' /lib64/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

@grepwood
Copy link
Author

On Fedora 21, this is happening halfway through the compilation
In file included from /home/life/grepwood/git/server/src/script_manager.h:25:0, from /home/life/grepwood/git/server/src/script_listener.cpp:21: /home/life/grepwood/git/server/src/lua_manager.h: In member function ‘void LuaState::setGlobal(const string&)’: /home/life/grepwood/git/server/src/lua_manager.h:109:53: error: ‘LUA_GLOBALSINDEX’ was not declared in this scope void setGlobal(const std::string& gname) {setField(LUA_GLOBALSINDEX, gname);} ^ /home/life/grepwood/git/server/src/lua_manager.h: In member function ‘void LuaState::getGlobal(const string&)’: /home/life/grepwood/git/server/src/lua_manager.h:113:53: error: ‘LUA_GLOBALSINDEX’ was not declared in this scope void getGlobal(const std::string& gname) {getField(LUA_GLOBALSINDEX, gname);} ^ src/CMakeFiles/otserv.dir/build.make:560: recipe for target 'src/CMakeFiles/otserv.dir/script_listener.cpp.o' failed

@ivucica
Copy link
Member

ivucica commented Feb 16, 2015

While I'm not actively developing anything OT related, your report would be
far more useful to the developers if you had answered the following:

Which git commit?
Which exact distribution and distribution version in first, and which in
the second issue?
Which glibc (for first issue) and which lua (for second issue)?

Also, given that these are two distinct issues -- on two different systems,
even -- would it not be prudent to treat them as such?

On Mon, Feb 16, 2015, 13:40 Michael Dec notifications@github.com wrote:

On Fedora 21, this is happening halfway through the compilation
In file included from
/home/life/grepwood/git/server/src/script_manager.h:25:0,
from /home/life/grepwood/git/server/src/script_listener.cpp:21:
/home/life/grepwood/git/server/src/lua_manager.h: In member function ‘void
LuaState::setGlobal(const string&)’:
/home/life/grepwood/git/server/src/lua_manager.h:109:53: error:
‘LUA_GLOBALSINDEX’ was not declared in this scope
void setGlobal(const std::string& gname) {setField(LUA_GLOBALSINDEX,
gname);}
^
/home/life/grepwood/git/server/src/lua_manager.h: In member function ‘void
LuaState::getGlobal(const string&)’:
/home/life/grepwood/git/server/src/lua_manager.h:113:53: error:
‘LUA_GLOBALSINDEX’ was not declared in this scope
void getGlobal(const std::string& gname) {getField(LUA_GLOBALSINDEX,
gname);}
^
src/CMakeFiles/otserv.dir/build.make:560: recipe for target
'src/CMakeFiles/otserv.dir/script_listener.cpp.o' failed


Reply to this email directly or view it on GitHub
#38 (comment).

@grepwood
Copy link
Author

The git commit is fafeb36
For the first issue, I used Gentoo with glibc 2.19 and Lua 5.1.5.
For the second issue, I used Fedora 21 with glibc 2.20 and Lua 5.2.2

@iryont
Copy link
Contributor

iryont commented Feb 16, 2015

2nd issue - Lua 5.2 is not supported and cannot be used to compile the server.
1st issue - it works here, and it does work on travis:
https://travis-ci.org/opentibia/server/

In any case I would try to add following piece of code at the end of src/CMakeLists.txt:

if(UNIX)
  TARGET_LINK_LIBRARIES(${PROJECT_NAME} pthread)
endif()

@iryont
Copy link
Contributor

iryont commented Feb 16, 2015

I have updated CMake files with several changes. You should give it a try.

@grepwood
Copy link
Author

Compiles alright on Gentoo (1st issue)! Thank you @iryont

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants