Git Product home page Git Product logo

Comments (17)

hobbes1069 avatar hobbes1069 commented on August 28, 2024

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?

from pugixml.

zeux avatar zeux commented on August 28, 2024

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')

from pugixml.

chrisUHD avatar chrisUHD commented on August 28, 2024

Sorry, totally forgot. You are right, i used an older 32 bit mingw compiler.

from pugixml.

zeux avatar zeux commented on August 28, 2024

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.

from pugixml.

chrisUHD avatar chrisUHD commented on August 28, 2024

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!

from pugixml.

zeux avatar zeux commented on August 28, 2024

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:

#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
     || !defined(__STRICT_ANSI__)

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:

#if !defined(__STRICT_ANSI__) && defined(__GNUC__)

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

from pugixml.

zeux avatar zeux commented on August 28, 2024

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 :-/

from pugixml.

zeux avatar zeux commented on August 28, 2024

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).

from pugixml.

chrisUHD avatar chrisUHD commented on August 28, 2024

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

from pugixml.

zeux avatar zeux commented on August 28, 2024

Since I have applied the workaround in 2cf599b, you should be able to use the latest master without issues.

from pugixml.

seatedscribe avatar seatedscribe commented on August 28, 2024

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?

from pugixml.

seatedscribe avatar seatedscribe commented on August 28, 2024

Doh, for some reason github postprocessing cuts out my "climits" inside brackets but I think you get the point... :)

from pugixml.

zeux avatar zeux commented on August 28, 2024

@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.

gcc pugixml.cpp -c -MD && cat pugixml.d | grep limits

from pugixml.

zeux avatar zeux commented on August 28, 2024

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.

from pugixml.

seatedscribe avatar seatedscribe commented on August 28, 2024

Well, compiler throws the error so it doesn't produce any output file.
I tried with -H and the only interesting file is located at use/local/lib/GCC/x86_64-pc-linux-gnu/6.3.0/include-fixed/limits.h. I will upload if you think could help.

Only way is compiling with climits header, but I guess it's not what you want.
How can we get the include path then?

from pugixml.

zeux avatar zeux commented on August 28, 2024

Ah right, -MD requires the compilation to succeed :( If that's the case you could use -E in a similar fashion:

gcc pugixml.cpp -E | grep limits.h

from pugixml.

seatedscribe avatar seatedscribe commented on August 28, 2024

That command worked.
I confirm the path of the file is
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include-fixed/limits.h

I will upload it tomorrow, but the name of folder is quite odd :/

from pugixml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.