Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors #9832

Closed
Vasago opened this issue May 20, 2013 · 9 comments
Closed

Compile errors #9832

Vasago opened this issue May 20, 2013 · 9 comments

Comments

@Vasago
Copy link

Vasago commented May 20, 2013

Hi,
After updating my OS system and cmake to:
cmake version 2.8.10.1
I get this error on all revision of TrinityCore:

Linking CXX executable authserver
/usr/bin/ld: CMakeFiles/authserver.dir/Server/RealmSocket.cpp.o: undefined reference to symbol 'pthread_condattr_setpshared@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_condattr_setpshared@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/x86_64-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [src/server/authserver/authserver] Error 1
make[1]: *** [src/server/authserver/CMakeFiles/authserver.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Any help? Thx in advance Also added here: http://www.trinitycore.org/f/topic/8524-compiling-problem-on-new-linux/ But realized it should be posted in issues ...

@Aokromes
Copy link
Member

downgrade cmake to 2.8.9

@Vasago
Copy link
Author

Vasago commented May 20, 2013

Seems it did not help (If I did irt right) I also found this #9740 where someone also tried it and did not help him.

@xurxogr
Copy link
Contributor

xurxogr commented May 20, 2013

Test this:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72d1a22..b5db167 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,8 @@ include(CheckPlatform)
 find_package(PCHSupport)
 find_package(ACE REQUIRED)
 find_package(OpenSSL REQUIRED)
+find_package(Threads REQUIRED)
+
 if( NOT USE_MYSQL_SOURCES )
   find_package(MySQL REQUIRED)
 endif()
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index 57ab1ff..2152e61 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -80,6 +80,7 @@ target_link_libraries(authserver
   shared
   ${MYSQL_LIBRARY}
   ${OPENSSL_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
 )

 if( WIN32 )
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 933d545..17c9d59 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -179,6 +179,7 @@ target_link_libraries(worldserver
   ${MYSQL_LIBRARY}
   ${OPENSSL_LIBRARIES}
   ${ZLIB_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
 )

 if( WIN32 )

@Vasago
Copy link
Author

Vasago commented May 20, 2013

Tested and here it is - new error : http://paste2.org/4nhBhDJK

@Vasago
Copy link
Author

Vasago commented May 20, 2013

So I tried provided patch - it did not work, also I tried to downgrade to 2.8.0 (is had error at the begining) versions 2.8.5 + 2.8.9 has the same error even 2.8.10 and the latest 2.8.11

@saqirmdev
Copy link

Delete Cmake Cache, use
$TrinityCore/
mkdir build
cd build
cmake ..
make -j3 && make install

@xurxogr
Copy link
Contributor

xurxogr commented May 20, 2013

@Vasago: now it needs to link ${ACE_LIBRARIES} in src/server/authserver/CMakeLists.txt

@Vasago
Copy link
Author

Vasago commented May 20, 2013

@saqirmdev I always do clean compile ...

@Spp- I added this line in src/server/authserver/CMakeLists.txt :

@@ -81,6 +81,7 @@
${MYSQL_LIBRARY}
${OPENSSL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}

  • ${ACE_LIBRARIES}
    )

if( WIN32 )

But still the same error with ace so should I add it elsewhere in this cmakelist?

When I added both ${ACE_LIBRARIES} and ${ACE_LIBRARY} and clean recompiled ACE 6.1.9 it seems to be working just fine.

@xurxogr
Copy link
Contributor

xurxogr commented May 21, 2013

My mistake, it should be ${ACE_LIBRARY} as you tried.

raczman pushed a commit to raczman/TrinityCore that referenced this issue Apr 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants