Re: Compiler Errors



Team,

We are using libxml++ and using below entries under Makefile.am as below:

If i dont include them, it throws tons of errors. As mentioned in
other mail to use pkg_config to g++ compiler directly works and  no
issues.

Question1: I wanted to know as how can i include pkg_config directly
under Makefile.am to avoid many includes below?

INCLUDES =  -I${includedir} -I${COMMON}/include
-I${top_srcdir}/appconfig/include
-I/usr/include/libxml++-2.6/libxml++/ -I/usr/include/libxml++-2.6
-I/usr/include/libxml++-2.6/libxml++/exceptions
-I/usr/include/libxml++-2.6/libxml++/parsers
-I/usr/include/libxml++-2.6/libxml++/validators
-I/usr/include/glibmm-2.4 -I/usr/include/glibmm-2.4/glibmm
-I/usr/include/glib-2.0 -I/usr/include/glib-2.0/glib
-I/usr/include/glib-2.0/include
-I${top_srcdir}/sysroot/usr/local/lib64/glib-2.0/include/
-I/usr/lib64/glibmm-2.4/include/ -I/usr/lib64/libxml++-2.6/include/

Question2: Also, we have made a static library which is written using
libxml++ lib. Now, this static library is used by various modules. Do
they also had to refer to pkg-config in their makefile.am to get the
module working? currently, when i have written a test program
consuming this static library, it throws those errors and only when
executed with pkg-config cflags...etc to g++ compiler, it works.

Any thoughts?

Thanks in Advance!
Santhosh

On 5/16/12, Kjell Ahlstedt <kjell ahlstedt bredband net> wrote:
> 2012-05-16 16:00, Santhosh Edukulla skrev:
>> Hi All,
>>
>> I have installed libxml++ from below link:
>>
>> 1/ When i compile my code file using the command below (EX), It works fine
>> :
>>
>> g++  -g res_parser.cpp -o program `pkg-config --cflags --libs
>> libxml++-2.6`
>>
>> 2/ But, when i run like below. It gives tons of errors.
>> g++  -g res_parser.cpp -o program
>>
>> Few of the errors are below:
>>
>> /usr/include/libxml++/validators/dtdvalidator.h:24: error: expected
>> ‘,’ or ‘...’ before ‘::’ token
>> /usr/include/libxml++/validators/dtdvalidator.h:25: error: expected
>> ‘,’ or ‘...’ before ‘::’ token
>> /usr/include/libxml++/validators/dtdvalidator.h:25: error:
>> ‘xmlpp::DtdValidator::DtdValidator(int)’ cannot be overloaded
>> /usr/include/libxml++/validators/dtdvalidator.h:24: error: with
>> ‘xmlpp::DtdValidator::DtdValidator(int)’
>> /usr/include/libxml++/validators/dtdvalidator.h:28: error: expected
>> ‘,’ or ‘...’ before ‘::’ token
>> /usr/include/libxml++/validators/dtdvalidator.h:29: error: expected
>> ‘,’ or ‘...’ before ‘::’ token
>> /usr/include/libxml++/validators/dtdvalidator.h:30: error: expected
>> ‘,’ or ‘...’ before ‘::’ token
>>
>> Any idea as to why these errors are?
>>
>> Thanks in Advance!
>> Santhosh
>>
> These errors (at least the first few, I didn't check all of them) comes
> from lines where Glib::ustring is mentioned. Some of the libxml++ header
> files include <glibmm/ustring.h>, and without `pkg-config --cflags
> --libs libxml++-2.6` g++ can't find that file.
>
> What makes you think that you should be able to compile and link without
> `pkg-config --cflags --libs libxml++-2.6`? Is there any documentation
> that says so? In that case, it's wrong. Or what's the problem with
> including `pkg-config --cflags --libs libxml++-2.6` in the g++ command?
> You can store it in a makefile or a shell script. You don't have to
> write it every time you compile your program.
>
> Kjell
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]