osm2pgrouting (#24) - problems with XMLParser.cpp (#311) - Message List

problems with XMLParser.cpp

When I try to make osm2pgrouting i get the following :

g++ -c src/Export2DB.cpp src/math_functions.cpp src/Node.cpp src/OSMDocumentParserCallback.cpp src/Way.cpp src/OSMDocument.cpp src/Type.cpp src/Class.cpp src/Configuration.cpp src/ConfigurationParserCallback.cpp -I./ -Isrc -I/usr/include/pgsql -I/usr/include/postgresql -ggdb3
g++ -c src/XMLParser.cpp -I./ -Isrc -I/usr/include/pgsql -I/usr/include/postgresql -ggdb3
src/XMLParser.cpp: In member function ‘int xml::XMLParser::Parse(xml::XMLParserCallback&, const char*)’:
src/XMLParser.cpp:49: error: ‘fopen’ was not declared in this scope
src/XMLParser.cpp:62: error: ‘BUFSIZ’ was not declared in this scope
src/XMLParser.cpp:63: error: ‘buf’ was not declared in this scope
src/XMLParser.cpp:63: error: ‘fread’ was not declared in this scope
src/XMLParser.cpp:68: error: ‘stderr’ was not declared in this scope
src/XMLParser.cpp:71: error: ‘fprintf’ was not declared in this scope
src/XMLParser.cpp:72: error: ‘fclose’ was not declared in this scope
src/XMLParser.cpp:79: error: ‘fclose’ was not declared in this scope
make: *** [all] Error 1

Don't really understand it.

Can anyone help ?

  • Message #1232

    I get same error attempting to build trunk (http://pgrouting.postlbs.org/svn/pgrouting/tools/osm2pgrouting/trunk). I'm working in Ubuntu 9.10. Did you ever resolve this problem?

  • Message #1243

    i am having the same issue here i am using ubuntu 9.10 also please let me know how you resolved this issue if you did

    thanks

    • Message #1244

      alright. i sorted it out. you just have to add the following to every CPP file in the SRC directory.

      #include <cstdio> // << add this line to the beginning of every CPP file.

      apparently there is a bug in the new GCC or something.

      hope this helps

      • Message #1424

        Ubuntu 9.04 here as well.

        Still not fixed in trunk as of 12.3.2010. Quick-fix was to add #include "stdio.h" to src/XMLPArser.cpp

        Didn't have to change any other cpp-file to compile. OSM-data for a complete country (cloudmade) was imported using osm2pgrouting after compile.

        • Message #1426

          Would be great to have a ticket for that, best with a patch if possible. I at least haven't been aware of this thread until now. Must have missed it.

          • Message #1556

            See ticket #211. Patch applied (changeset:357), thanks to fredj!