-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile pugixml #66
Comments
It's helpful to provide information about your environment. I would think at a minimum: What distro are you running? gcc version? i686 or x86_64? |
Please also specify the full command line that you use for compiling pugixml, in addition to the exact version of whatever compiler you're using (if you're using gcc or clang you can get it via 'gcc -v' or 'clang -v') |
Sorry, totally forgot. You are right, i used an older 32 bit mingw compiler. |
What's the specific version? I generally try to make pugixml compatible across all MinGW versions. This error implies that limits.h is pre-C99. Since you're using MinGW it's probably detected as MSVC and thus is trying to use long long. I think I tested MinGW versions down to 3.4 but I'll double check. |
Should have been MinGW 32 bit Version 3.8 but it seems like there was something else wrong. I got it running now with MinGW nuwen 4.0 64 bit. I also had to enable C++11 support in Eclipse. Thanks for your help! |
As far as I can tell this is essentially an issue in MinGW 3.8. My distributions of MinGW 3.4 and MinGW 4+ all have the following guards for LLONG_MIN/etc. declarations:
So regardless of STRICT_ANSI mode (activated automatically when you specify -std= option) you'll get the definitions. MinGW 3.8 headers I can find on SourceForge do something else:
Which is very wrong (violates C99 standard). Here's a thread with the same issue AFAICT: http://compgroups.net/comp.lang.c/long-long/711656 |
Based on this thread maybe this is not even related to the version of MinGW as much as the distribution - looks like the headers can come from different packages or something. Why is this such a mess :-/ |
Ok, MinGW does not define _MSC_VER. I can sort-of reproduce this by building with these buggy headers from SourceForge if I specify -DPUGIXML_HAS_LONG_LONG explicitly - if I don't I can't reproduce this since I can't use -std=c++11 (compiler is too old for that). So you must have had a pretty recent MinGW compiler (C++11-aware) with headers that don't know about LLONG_MAX in strict ANSI mode (not C++11-aware). |
As you pointed out correctly the problem is not only dependent on the MinGW Version. I was playing around with different distros (nuwen, 64bit and so on). I will look into the issue further when I got time, as I would like to use the nuwen distro. Thanks |
Since I have applied the workaround in 2cf599b, you should be able to use the latest master without issues. |
I just stumbled on the same error here. Didn't dig into the problem, but resolved including instead of <limits.h> in pugixml.cpp. compiler is GCC 6.3.0 built from sources myself. Strange enough, this problem disappears using default OS compiler (Ubuntu 5.4.0). Any hint about how to provide more insightful data for you to process? |
Doh, for some reason github postprocessing cuts out my "climits" inside brackets but I think you get the point... :) |
@seatedscribe Would you mind uploading the limits.h file that pugixml.cpp includes somewhere so that I can take a look at it? You can get the precise path by compiling pugixml with -MD flag, e.g.
|
I also had a report before about pugixml not compiling correctly on a custom-built GCC but in that case the headers installed by gcc were just broken - specifically, assert.h installed to /usr/local/include/asset.h couldn't be compiled for whatever reason. |
Well, compiler throws the error so it doesn't produce any output file. Only way is compiling with climits header, but I guess it's not what you want. |
Ah right, -MD requires the compilation to succeed :( If that's the case you could use -E in a similar fashion:
|
That command worked. I will upload it tomorrow, but the name of folder is quite odd :/ |
Hey,
I tried to use pugixml for my current project but I am not able to compile it. Three errors occur:
Maybe you encountered this problem before.
Best Regards
Chris
The text was updated successfully, but these errors were encountered: