I'm neutral about Linux, and I think the reason Linux has been slow for so many years is because the desktop is bad or not good enough, so I prefer Ubuntu.
As a result of the previous project is makefile, I personally do not like makefile, because he looks more laborious, and compiled after the problem debugging is a big problem, not everyone is proficient in gdb, and VI to start more difficult. So will the project into Codeblocks CBP, originally want to use CMake, but feel to write more, so forget, after all, the code is not cross-platform, Windows can not use.
After the compile link, reported a undefined reference ' dlclose@xxx function ', do not know what the problem, Shing Cheng came to see the next, said is the DL library did not pack in, checked the next DL library is used to do dynamic library load, (dynamic load), The project uses the libmysqld.so, after added still has the question, changes the-LDL link option to be possible finally.
This paper sums up the common problems of undefined reference:
1.DL Library
Undefined reference to ' dlerror '
Undefined reference to ' Dlopen '
Undefined reference to ' dlerror '
Add-LDL Link option (-l is the prefix of link options)
2.pthread Library
Undefined reference to ' pthread_create '
Undefined reference to ' pthread_xxxx '
Add-lpthread Link Options
3.rt Library
Undefined reference to ' clock_gettime '
Add-LRT Link Options
If you are using Codeblocks, you can add the link option, but because of the dependency order problem, if link option Riga or error, directly in the link file, adding pthread DL RT can be
If it is your own library appears this undefined reference what function, first check the source code of the library, to see the specific problems.