Linking Math Library in GCC 4.6.1 (Ubuntu 11.10)

后端 未结 4 346
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 01:24

I find a problem in the linking process of my application. I did not have the same with gcc 4.5. It tries to link math library with the following command.

gcc -W         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-22 01:31

    You didn't tell us what -lmems_internals is, but maybe the unresolved symbol comes from there. The order of the -l options is generally important to the linker, you should always put system libraries last.

    You can check where the unresolved symbol comes from by using something like

    nm yourLibrary | grep sqrt
    

    if there is a U in front of sqrt the symbol is undefined.

提交回复
热议问题