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

Fix undefined reference to pthread issues #106

Closed
wants to merge 1 commit into from

Conversation

susnux
Copy link

@susnux susnux commented Jul 29, 2021

The pthreads library was not linked to compiling failed on some
systems with an

QoreThreadLocalStorage.h:73: undefined reference to `pthread_key_delete'

error

Align minimum qore version inside README with the one required in the CMakeLists.txt

* The pthreads library was not linked to compiling failed on some
systems with an "QoreThreadLocalStorage.h:73: undefined reference to `pthread_key_delete'" error
* Align minimum qore version inside README with the one required in the
CMakeLists.txt
@susnux
Copy link
Author

susnux commented Jul 29, 2021

The full error looks like this:

>$ /usr/bin/c++ -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -DNDEBUG -std=c++11 -DBUILDING_DLL=1 -O2 -g -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,ssh2-api-0.24.qmod -o ssh2-api-0.24.qmod CMakeFiles/ssh2.dir/src/SFTPClient.cpp.o CMakeFiles/ssh2.dir/src/SSH2Channel.cpp.o CMakeFiles/ssh2.dir/src/SSH2Client.cpp.o CMakeFiles/ssh2.dir/src/ssh2-module.cpp.o CMakeFiles/ssh2.dir/QC_SFTPClient.cpp.o CMakeFiles/ssh2.dir/QC_SSH2Base.cpp.o CMakeFiles/ssh2.dir/QC_SSH2Channel.cpp.o CMakeFiles/ssh2.dir/QC_SSH2Client.cpp.o  -lqore -lssh2 
>$ /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccZnoJc0.ltrans0.ltrans.o: in function `kbd_callback(char const*, int, char const*, int, int, _LIBSSH2_USERAUTH_KBDINT_PROMPT const*, _LIBSSH2_USERAUTH_KBDINT_RESPONSE*, void**)':
>$ /usr/include/qore/QoreThreadLocalStorage.h:78: undefined reference to `pthread_getspecific'
>$ /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccZnoJc0.ltrans0.ltrans.o: in function `SSH2Client::sshConnectUnlocked(int, ExceptionSink*)':
>$ /usr/include/qore/QoreThreadLocalStorage.h:84: undefined reference to `pthread_setspecific'
>$ /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccZnoJc0.ltrans0.ltrans.o: in function `QoreThreadLocalStorage<char const>::~QoreThreadLocalStorage()':
>$ /usr/include/qore/QoreThreadLocalStorage.h:73: undefined reference to `pthread_key_delete'
>$ /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccZnoJc0.ltrans1.ltrans.o: in function `_sub_I_65535_0.0':
>$ <artificial>:(.text.startup+0x1b): undefined reference to `pthread_key_create'

@susnux
Copy link
Author

susnux commented Nov 1, 2021

It builds now without this patch

@susnux susnux closed this Nov 1, 2021
@davidnich
Copy link
Contributor

@susnux we put all module issues in the Qore issue tracker (https://github.com/qorelanguage/qore/issues) - issue subject module-xxxx: and add the module tag - I will have to update the module accordingly - glad it's working now in any case

@davidnich
Copy link
Contributor

oh this was a PR - somehow I didn't see it until now!

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

Successfully merging this pull request may close these issues.

None yet

2 participants