Frequently Asked Questions at compile time

A list of Q&A that might arise when building your project

[Linking error] Undefined reference to …

Typically this error occurs at the last stage of compilation : linkage. The linker checks that all entries points of your binaries that refers to external libraries are validated. You encounter this error when the linker cannot find some entries point (one per error) within the provided libraries at the link stage. Here are the solutions to this error, from the most encountered to the least:

  • You did not provide the good libraries for the linking. Check configuration to see if you are missing some libraries at the link stage.
  • You provide the good libraries but they have a different configuration that the binary you are compiling. Thus, mostly on Windows platform, binaries are not compatible from one compiler to one another. 32bits built libraries are not compatible with 64bits (and vice versa). For instance, Qt built libraries for VS 2010 are not compatible neither with VS 2008 nor VS 2012 (and surely not with MinGW). Check your libraries configuration remains the same for all your libraries.
  • You did provide all the good libraries with the good configuration, but in the wrong order. Indeed, this one is the trickiest: you must indicate which libraries to link with your executable / library you are compiling in the CORRECT ORDER. This order is from the most dependent to your target from the least. Thus, check your CMake configuration to verify that order. If it deals with CamiTK extensions / libraries or applications, please contact us by an issue

[Linking error] Unresolved symbol …

If you face to error like *unresolved external symbol “public: __cdecl* when you compile with Visual Studio, read this page: DLL import/export.

[Linking error] Relocation R_X86_64_32S against `.rodata’

This error comes when you tried to link static library on a 64 bits platform. The solution is to compile the libraries you are linking against as “shared”. To do so, simply reconfigure your shared lib with the build_shared_lib flag set to on and compile them.

For more information please read the topic on StackOverflow

[Install Local error] VS doesn’t find your CEP to perform a local install

Please verify that the name of your CEP has no space between words. For example, in VS2008, the local installation of “my CEP” will failed because VS2008 try to install “my” and “CEP”.