View Full Version : [C++] Any tutorial for library linking ?

4th December 2016, 19:27
Gentlemen ! Greetings :)

So, the gist is as follows : on my journey to learn how to make C++ programs for later purposes regarding Mugen (sprite making is my first priority), I've attempted to build a C++ IDE composed of MinGW (for the compiler), Visual Studio, and the OpenCV module.
Aware that I've only made a few steps in my travel, I stumble upon an error message that I have many troubles trying to solve it : undefined reference to `cv::blahblahblah' (replace blahblahblah by FastFree(void), MatCreate,...).
After some first researches on what it could mean in terms of causality, I've learnt that it's due to an error of library linking.
And there, it became hard : after tinkerings with environment variables, parameters with the "-L" flags, cutting-and-pasting libraries here and there in lib directories, nothing.
All I could do is open the command prompt, and type "hoist.exe -White" to raise the white flag following fruitless hours.

So, after this paragraph written in a way that resembles C++ ... complexity, I leave my ears eyes open to any suggestion of a tutorial that could scatter the fog I'm crossing.
With my early gratitude, have a good day :)

6th December 2016, 15:27
mingw uses GCC so you generally need 2 options to add libraries.
tell the compiler to check the directory the library is in
and tell it to use a certain library. if its name is something like libfoo.dll/so just use -lfoo

also this could help.

i dont use windows so there might be some other details im not sure about, specially with visual studio.

7th December 2016, 20:55
Gotta try that again tomorrow with the link you've sent me. Thanks ;)