How do I set up the linking order in code blocks?

旧城冷巷雨未停 提交于 2019-12-13 04:34:13

问题


I tried to run a program on opencv but got the following error:

test_1.cpp:(.text+0x44): undefined reference to `cv::imread(std::basic_string<char,    
std::char_traits<char>, std::allocator<char> > const&, int)'

I learnt that the order of sources and libraries on the link line matters

So, running g++ -o test_1 test_1.cpppkg-config opencv --cflags --libs works.

However, how can I setup code blocks so that when I build the code, it applies the correct order?

来源:https://stackoverflow.com/questions/18600529/how-do-i-set-up-the-linking-order-in-code-blocks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!