Note that there are some explanatory texts on larger screens.

plurals
  1. POCMAKE cross compile libraries are not found
    text
    copied!<p>I'm having strange problems with my cmake cross-compiler projects.</p> <p>My own libraries are found but not the (system) libraries from my toolchain.</p> <p>Previously I was using KDevelop on debian squeeze machine. now on my new machine with debian wheezy the configuring fails. It does not find the system libraries like <code>m</code> or <code>pthread</code>. </p> <p>On my old machine the following was working perfectly, but I do not remember that I did something special to make this work.</p> <p>Here is one of my <code>CMakeLists.txt</code> files</p> <pre><code>cmake_minimum_required(VERSION 2.8) SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 2.6.36.4) SET(CMAKE_C_COMPILER arm-angstrom-linux-gnueabi-gcc) SET(CMAKE_CXX_COMPILER arm-angstrom-linux-gnueabi-g++) include_directories(../include ../../../sample/include) project(testmain) add_executable(testmain some_c-source-file.c) set(CMAKE_LIBRARY_PATH ../lib/arm-26/lib ../../../sample/lib/arm-26/lib) find_library(LIBS_TEST NAMES akku) find_library(LIBS_M NAMES m) find_library(LIBS_PTHREAD NAMES pthread ) target_link_libraries(akkumain ${LIBS_TEST} ${LIBS_M} ${LIBS_PTHREAD}) set(CMAKE_C_FLAGS "-Wall -Werror") set(CMAKE_C_FLAGS_DEBUG "-g3 -O2 -rdynamic") set(CMAKE_C_FLAGS_RELEASE "-g0 -O0") set(CMAKE_CXX_FLAGS "-Wall -Werror") set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O2 -rdynamic") set(CMAKE_CXX_FLAGS_RELEASE "-g0 -O0") </code></pre> <p>This is the message displayed when trying to compile using KDevelop: (to repeat myself: this was working on my old machine)</p> <pre><code>/home/user/testmain/build&gt; /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug /home/user/testmain/ -- The C compiler identification is GNU 4.3.3 -- The CXX compiler identification is GNU 4.3.3 -- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -- Check for working CXX compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: LIBS_M linked by target "akkumain" in directory /home/user/testmain LIBS_PTHREAD linked by target "akkumain" in directory /home/user/testmain </code></pre> <p>So LIBS_TEST is found. But not <code>libm</code> or <code>libpthread</code>. I tried this with different projects: All of my libraries are found, but none of the "system" libraries.</p> <p>I already tried different things like </p> <pre><code>set(CMAKE_FIND_LIBRARY_PREFIXES lib ) set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) </code></pre> <p>and some more things I do not remember. </p> <p><strong>The only thing what IS WORKING is when I specify the directory manually:</strong></p> <pre><code>find_library(ASTLIBS_M NAMES m PATHS /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib) </code></pre> <p>After specifying this to my <code>CMakeLists.txt</code> the library is found and I can compile my project without any errors.</p> <p>BUT: This is not what I want, because I have a <em>LOT</em> of projects and many libraries and I don't want to edit all my <code>CMakeLists.txt</code>... :(</p> <p><strong>Does anybody know what made my old machine find the system-libs without specifying anything special inside my IDE/CMake files?</strong></p> <p>Edit: <strong>I just noticed for one of my executables that on Linker stage it throws some errors that it cannot find some symbols from glibc - seems there is something more wrong with my debian wheezy system. - I hope I can figure it out...</strong></p> <p>Edit:</p> <h2>Maybe I should give a short summary: My code compiles well, but all libraries from my toolchain are not found, but if I add the path to the libs of my toolchain manually it compiles but fails on linker stage.</h2>
 

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