Note that there are some explanatory texts on larger screens.

plurals
  1. POMissing symbols from static library in linked executable
    primarykey
    data
    text
    <p>I have a problem with static library symbols missed in linked executable. Here is the description of my problem:</p> <p>I have static library built from several object files. These object files provides sevaral groups of symbols, associated with:</p> <ol> <li>A set of C functions and structs (several object files). Let's call corresponding symbols <em>level1</em> symbols.</li> <li>A set of C++ wrapper classes for this C functions and structs (another object file). Let's call corresponding symbols <em>level2</em> symbols.</li> <li>A set of C++ wrapper classes inhereted from level 2 classes (another object file) with extended functionality. Let's call corresponding symbols <em>level3</em> symbols.</li> </ol> <p>Undeground C code uses several other project and external libs. Some of them are static, so currently this lib is static too.</p> <p>Library is linked with executable file. This file used directly only <em>level2</em> symbols from lib. But some dynamic libraries loaded by this executable during execution needs <em>level3</em> symbols.</p> <p>The problem is, that <em>level3</em> symbols for some reason are missed into this executable(nm approved).</p> <p>Library itself contains all groups of symbols. ALso there is another executable linked with this library and it also contains all groups of symbols. The main difference between these executables is that second executable (where all symbols are presented) uses <em>leve3</em> symbols directly.</p> <p>The whole project is built with CMake in debug configuration (this means "-g" option is presented in g++ commands). The underlying OS is GNU/Linux x86_64. g++ version is 4.4. </p> <p>I've checked several similiar questions on StackOverflow but I haven't found any acceptable solution.</p> <p>I've already tried several linking options to solve the problem (--export-dynamic, --whole_archive) but neither helps.</p> <p>I'll be glad to see any ideas to solve this problem or, at least, possible reasons of this strange behaviour.</p> <p>This is command line used to build executable. Command was generated by CMake. I only add --whole_archive option, then delete executable and rerun command. I also hope you will excuse me for replacing all project specific names with "???". </p> <p>exec_name - name of executable we are talking about<br> lib_name - name of library we are talking about</p> <p>/usr/bin/c++ - symlink to g++ v4.4 executable</p> <p>/usr/bin/c++ -Wextra -g -fPIC CMakeFiles/exec_dir.dir/main.cpp.o CMakeFiles/exec_dir.dir/options.cpp.o CMakeFiles/exec_dir.dir/runtime.cpp.o CMakeFiles/exec_dir.dir/plugins.cpp.o CMakeFiles/exec_dir.dir/CServer.cpp.o -o exec_name -rdynamic ../lib/???/lib???.a --whole-archive ../../lib/???/???/lib_name.a ../lib/???/lib???.so ../../lib/???/???/lib???.a ../../???/???/lib???.a ../../lib/???/lib???.a -ldl -lboost_filesystem -lboost_signals -lboost_system -lboost_thread ../../lib/???/lib???.so /usr/local/ssl/lib64/libcrypto.so -ldl -luuid -lodbc ../lib/log/lib???.so ../lib/config/lib???a -lpthread ../../???/???/lib???.a -Wl,-rpath,/home/beduin/???/build/deb/???/lib/???:/home/beduin/???/build/deb/lib/???:/usr/local/ssl/lib64</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload