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@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to