Trying to include a library, but keep getting 'undefined reference to' messages

前端 未结 3 2245
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 07:18

I am attempting to use the libtommath library. I\'m using the NetBeans IDE for my project on Ubuntu linux. I have downloaded and built the library, I have done a \'make inst

3条回答
  •  悲哀的现实
    2020-12-02 07:35

    The trick here is to put the library AFTER the module you are compiling. The problem is a reference thing. The linker resolves references in order, so when the library is BEFORE the module being compiled, the linker gets confused and does not think that any of the functions in the library are needed. By putting the library AFTER the module, the references to the library in the module are resolved by the linker.

提交回复
热议问题