Re: "cannot run C compiled programs" error

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

 



On Tue, Apr 26, 2011 at 8:55 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
>
>>
>>> [SNIP]
>>>
>>> Please try to reproduce the error with a minimal example to show
>>> whether you get that error just from including a header, or only under
>>> certain circumstances.
>>
>> I managed to track it down to the following test.cpp file:
>>
>> #include <cmath>
>> #include <mgl/mgl.h>
>> #include <algorithm>
>>
>> Where mgl is from the wxWidgets library, version 2.8.11
>>
>> When I changed the order to:
>> #include <cmath>
>> #include <algorithm>
>> #include <mgl/mgl.h>
>>
>> It worked.
>
> That would imply the mgl.h header does something it shouldn't, such as
> defining isnan as a macro, or something else which breaks the standard
> library header.
>
I've also seen similar in the past. I seem to recall (like Anna) that
the C++ gear had to be included before [some of] the standard linux
stuff such as sys/types, sys/socket.h, and netinet/in.h. Fortunately,
the standard linux headers do a good job of guarding for multiple
definitions (when they follow C++ headers). The C++ headers, on the
other hand, do not always do a good job (when they follow standard
headers).

Jeff


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux