How to add a library to an eclipse C project?

I need to add a C library to a C project in an Eclipse Indigo. What I have done so far. I downloaded and installed the library. All headers are in the / usr / include folder, library.so files are in the / usr / lib folder. After reading the tutorial, I tried to do it as follows: When in Eclipse -> Project -> C / C ++ Build -> Settings -> GCC C Linker -> Libaries -> Add libary -> "ibxml2" (the library name is libxml2) But this still doesn't work. I am a super newbie in Linux, so please could you advise me how to do this? there is a screenshot, that might be helpfful

By the way, one more thing. After creating a new C / C ++ project at startup, the error "Launch failed! Binary not found" occurs. I checked "Binary Parsers" in the project settings and "Elf Parser" is installed (I read that this is normal for Linux), so what is wrong? This is not so important, since it works when I only first create a project and then run it, but maybe there is a way to solve it?

+5
source share
1 answer

In the linker settings you should not add "libxml2", but simply "xml2". All binary libraries on Linux (so files) have the prefix "lib", which is not part of the library name.

+3
source

Source: https://habr.com/ru/post/905831/


All Articles