Search code examples
cxmleclipselibxml2multiple-definition-error

"First defined here" error in Eclipse with C


I'm trying to compile a C program using libxml2 in Eclipse. It seems like my code doesn't have problems, but there are errors when I build my project.

The error output is in this screenshot: https://drive.google.com/file/d/0BwV-0_2diIaaQlZHM2Fwa2R0LWc/edit

Before this error, I had an “Undefined reference to” error, but it was because I forgot to link the library libxml2. Now it's the problem in the screenshot. I don't what to do.

[EDITED] I solved my problem I just need to put -nostartfiles in the linker flags.


Solution

  • I solved my problem I just need to write -nostartfiles in the Linker Flags box :D To find "Linker Flags" box go to Your Project > Properties > C/C++Build > Settings > GCC C Linker > Miscellaneous

    That's it.

    Thanks for help.