[Pythonmac-SIG] python.h and veclib.h incompatible?

Jack Jansen Jack.Jansen at cwi.nl
Fri Jan 28 15:08:29 CET 2005


Google found one possibly interesting reference,  
<http://mail.python.org/pipermail/pythonmac-sig/2003-September/ 
008759.html> and the rest of that thread.

The trick seems to be to include <math.h> before "python.h".

On 25 Jan 2005, at 03:31, Brian Clarkson wrote:

> Hello.
>
> I was swig'ing an extension that made use of veclib in its internals  
> and discovered that if python.h is included before veclib.h that  
> compilation will not succeed. It seems they are interacting so that  
> parts of fp.h are being left out when they shouldn't be.
>
> I have distilled the problem down to the following simple test case:
>
> ****begin test.cpp****
>
> #include <python.h>
> #include<veclib/veclib.h>
> #include<iostream>
>
> using namespace std;
>
> int main(){
> 	cerr << scalb(3,4) << endl;
> 	return 0;
> }
>
> ****end test.cpp****
>
> Which when compiled as follows:
>
> gcc -I/sw/include/python2.3 -c test.cpp
>
> gives the following errors:
>
> In file included from /sw/include/python2.3/python.h:70,
>                  from test.cpp:1:
> /sw/include/python2.3/objimpl.h:255: warning: use of `long double'  
> type; its
>    size may change in a future release
> /sw/include/python2.3/objimpl.h:255: warning: (Long double usage is  
> reported
>    only once for each file.
> /sw/include/python2.3/objimpl.h:255: warning: To disable this warning,  
> use
>    -Wno-long-double.)
> In file included from  
> /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
> CarbonCore.framework/Headers/CarbonCore.h:165,
>                  from  
> /System/Library/Frameworks/CoreServices.framework/Headers/ 
> CoreServices.h:21,
>                  from  
> /System/Library/Frameworks/veclib.framework/Headers/veclib.h:20,
>                  from test.cpp:2:
> /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
> CarbonCore.framework/Headers/fp.h: In
>    function `long double scalbl(long double, long int)':
> /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
> CarbonCore.framework/Headers/fp.h:1896: error: `
>    scalb' undeclared (first use this function)
> /System/Library/Frameworks/CoreServices.framework/Frameworks/ 
> CarbonCore.framework/Headers/fp.h:1896: error: (Each
>    undeclared identifier is reported only once for each function it  
> appears
>    in.)
>
> Other than refactoring in order to hide veclib.h from python.h, does  
> anyone have any fixes for this?
>
> Thanks in advance!
>
> Brian
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Goldman



More information about the Pythonmac-SIG mailing list