Problem compiling

  • Big


    First, thanx for TinyXML! I'm using it for different projects.

    I'm using TinyXML in a C++ library (called "mylib" here) which is then used by another project.

    I can compile and create shared/static version of my library. There is a test main() included in the lib tree so I can test the library: it also works.

    I cannot _compile_ a project file calling a function from the library which uses tinyxml...

    My library has headers installed to /usr/mylib/ionization. I have put tinyxml headers in /usr/include/mylib/tinyxml

    Here is the error:
    g++ -O0 -g -DYDEBUG -Wno-write-strings -Wall -Wfatal-errors -I/usr/include/mylib -I./src -c src/treecode.c -o build/treecode.o
    In file included from /usr/include/mylib/ReadXML.hpp:6,
                     from /usr/include/mylib/Ionization.hpp:10,
                     from src/treecode.c:79:
    /usr/include/mylib/tinyxml/tinyxml.h:687: error: expected `)' before ‘->’token
    compilation terminated due to -Wfatal-errors.

    In my project source, I have:
    #include "mylibrary.hpp" // Include everything from the lib
    Read_XML_Inputfile([...], filename);

    Thank you for your help.

    • Big

      No problem with tinyxml after all.

      It was a header dependency problem. Working on a big project you never know what others will include... Doing some #include cleanups corrected the problem.