Looking for undefined symbol: _ZN5boost11this_thread6hidden9sleep_forERK8timespec - undefined

In my program, libboost_thread-gcc48-mt-d-1_61.so.1.61.0 is linked to build a shared library. But when loading the shared library, an error occurred:
undefined symbol: _ZN5boost11this_thread6hidden9sleep_forERK8timespec
and libboost_thread-gcc48-mt-d-1_61.so.1.61.0 only have the symbol below:
nm -D libboost_thread-gcc48-mt-d-1_61.so.1.61.0 | grep timespec
000000000003aa6f T _ZN5boost11this_thread5hiden9sleep_forERK8timespec
The name difference is thread6hidden and thread5hiden. What are the possible reasons that the shared library looks for this non-existing symbol?
Please help me solve this issue.

Versioning, your libboost is newer

Related

Is GNU linker "ld" creating undefined reference to `fftw_alloc_complex

Thje error that I got ae as follows
fftw_oct.f90:(.text+0x26a): undefined reference to `fftw_alloc_real'
/usr/local/bin/ld: fftw_oct.f90:(.text+0x3a7): undefined reference to `fftw_alloc_complex'
/usr/local/bin/ld: fftw_oct.f90:(.text+0x4fb): undefined reference to `fftw_alloc_complex'
Is this error arises due to GNU LINKER ?
The linker doesn't invent references; if you have an undefined reference, it means you (or something you linked) made a reference to something you didn't link.
That can mean a couple of things - for example, you could be missing a library on your link line (check for missing -l flags), or that something you compiled contained conditionals that weren't enabled (#ifdef and the like), so those symbols were omitted.
If it didn't give you heck at compile time (check your warnings), you likely have a header that contains declarations of the missing symbols. That should help you narrow down the location of their implementations.

Identifier "cusparseXXX" is undefined on cuda11

I'm building a package tested for CUDA 9,10 from source, trying to compile it for CUDA11.
I've already changed gencode=arch=compute_70 (was set on 30), and added
target_link_libraries(tsnecuda ${CUDA_cusparse_LIBRARY})
Unfortunately, I still get
tsne-cuda/src/util/math_utils.cu(153): error: identifier "cusparseScsr2csc" is undefined
tsne-cuda/src/util/math_utils.cu(165): error: identifier "cusparseXcsrgeamNnz" is undefined
tsne-cuda/src/util/math_utils.cu(195): error: identifier "cusparseScsrgeam" is undefined
3 errors detected in the compilation of "tsne-cuda/src/util/math_utils.cu".
CMake Error at tsnecuda_generated_math_utils.cu.o.cmake:276 (message):
Error generating file
tsne-cuda/build/CMakeFiles/tsnecuda.dir/src/util/./tsnecuda_generated_math_utils.cu.o
Is there a chance the build process somehow ignores my target_link_libraries? Should I add something else?
Undefined identifier is a compilation issue, not a linking issue.
At least part of the problem here is that CUDA deprecated and removed some functionality from cusparse, including cusparse<t>csr2csc(). The code would need to be rewritten to compile correctly under the latest versions of CUDA 11.x.
For example, for csr2csc, the call to cusparseScsr2csc might be refactored to use this function instead.
One example of deprecation/removal notice for cusparse<t>csr2csc is given here.

Cython: calling C function throws 'undefined symbol'

I am attempting to use the LMDB C API with Cython.
I want to import the following definitions from the header file:
typedef struct MDB_env MDB_env;
int mdb_env_create(MDB_env **env);
So I created a .pxd file:
cdef extern from 'lmdb.h':
struct MDB_env:
pass
int mdb_env_create(MDB_env **env)
And I am using it in a Cython script:
cdef MDB_env *e
x = mdb_env_create(&e)
This code compiles fine, but If I run it, I get:
ImportError: /home/me/.cache/ipython/cython/_cython_magic_15705c11c6f56670efe6282cbabe4abc.cpython-36m-x86_64-linux-gnu.so: undefined symbol: mdb_env_create
This happens both in a Cython .pyx + .pxd setup and in a prototype typed in IPython.
If I import another symbol, say a constant, I can access it. So I seem to be looking at the right header file.
I don't see any discrepancy between my syntax and the documentation, but I am clearly doing something wrong. Can somebody give me a hint?
Thanks.
To compile it with IPythons-magic (would be nice if you would mention this explicitly in your question) you have to provide library-path (via -L-option) and library name (via -l-option) of the built c-library you want to wrap, see also the documentation:
%%cython -L=<path to your library> -l=<your_library>
The library you are trying to wrap is not a header-only library. That means that some symbols (e.g. mdb_env_create) are only declared but not defined in the header. When you build the library, the definitions of those symbols can be found in the resulting artifact, which should be provided to the linker when your extension is built. These definitions is what is needed when the program runs.
If you don't do it, the following happens on Linux: When the extension (the *.so-file) is built,the linker allows undefined symbols per default - so this step is "successful" - but the failure is only postponed. When the extension is loaded via import, Python loads the corresponding *.so with help of ldopen and in this step loader checks that the definitions of all symbols are known. But we didn't provide a definition of mdb_env_create so, the loader fails with
undefined symbol: mdb_env_create
It is differently for symbols which are defined in the header-file, for example enums MDB_FIRST&Co - the compiled library isn't necessary and thus the extension can be loaded, as there are no undefined symbols.

mxGetProperty function in octave

I'm trying to adopt some C-coded matlab module to octave. mkoctave returns batch of warning, but no errors and generates mex file. However octave cannot load this file and returns an error:
error: JustKmodel.m: /home/simulations/exampls/RetinalMap-master/stepFastGlobal.mex:
failed to load: /home/simulations/exampls/RetinalMap-master/stepFastGlobal.mex: undefined symbol: mxGetProperty
As far as I can understand there is no such function GetProperty or library isn't available.
I'll appreciate any ideas how to work around this problem

How to remove error created using cocos2d-x v2.2.3 (Language cpp) for windows phone?

I'm trying to run my Game created using cocos2d-x-v2.2.3 (language cpp) for windows phone. But it shows following error.
error C2440: 'type cast' : cannot convert from 'void (__cdecl StartScene::* )(void)' to 'cocos2d::extension::SEL_CCControlHandler'
If I include pch.h file in all class file above error is removed then new error created. The error is
"Cannot open include file: 'pch.h': No such file or directory"
Though pch.h and pch.cpp are presented in CocosDenshion. In this circumstances what should i do?
Thanks in Advance
i think this because you use wrong function, fowllow this (CCObject::SEL_CCControlHandler)(CCObject, CCControlEvent) so the func you use must have func(CCObject*, CCControlEvent),