mbcrawfo/GenericMakefile

Adjustments for libxml2

Closed this issue · 2 comments

prvst commented

Hi, I know that this is not a real issue with your C Makefile, but I need to reorganize some directives in order to compile a project containing the libxml2 libraries.

According to other users:

The libraries should be specified only after the source file so that the linker can resolve the undefined references in the source file.
gcc -I/usr/local/include/libxml2 -L/usr/local/lib xmltest.c -lxml2 -lm

I would be really grateful if you could point to me where to do the changes without braking anything else.
Thanks

Sorry for the delay. -I/usr/local/include/libxml2 should be added to the INCLUDES option, and -L/usr/local/lib -lxml2 -lm should be added to LINK_FLAGS.

prvst commented

Hey @mbcrawfo , Thanks for the reply!
That works for me, I really appreciate. I only had to adjust the Include parameter, using -I/usr/include/libxml2 instead of -I/usr/local/include/libxml2.

Thanks again.