Build error under Mac OS X

I have tried to build wxPython twice: the first time was the stable (2.4.0.7) version, the second time was the CVS snapshot 20030527. Each time I received the following error message:

gcc -Wno-long-double -no-cpp-precomp -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -Isrc -I/usr/local/apps/Python-2.3b1/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c contrib/glcanvas/mac/glcanvas.cpp -o build/temp.darwin-6.6-Power_Macintosh-2.3/contrib/glcanvas/mac/glcanvas.o -I/usr/local/apps/wxMac-20030527/lib/wx/include/macd-2.5 -I/usr/local/apps/wxMac-20030527/include -D__WXDEBUG__ -D__WXMAC__ -DWXMAKINGDLL -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
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/Carbon.framework/Headers/Carbon.h:20,
                  from /System/Library/Frameworks/AGL.framework/Headers/agl.h:22,
                  from /usr/local/apps/wxMac-20030527/include/wx/mac/glcanvas.h:29,
                  from /usr/local/apps/wxMac-20030527/include/wx/glcanvas.h:19,
                  from contrib/glcanvas/mac/glcanvas.cpp:61:
/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: `
    scalb' undeclared (first use this function)
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h:1896: (Each
    undeclared identifier is reported only once for each function it appears
    in.)
error: command 'gcc' failed with exit status 1

My system is Mac OS X 10.2.6 with December 2002 developer tools.

Is there somebody who could please help me with this?

Thanks.

Andrew.

You know, I've had this problem compiling programs other than wxPython
too.

The solution is to temporarily change line 1896 of fp.h from
"#ifdef __cplusplus" to "#if 1". Or maybe its "#if 0". Anyway, try
both. One should work.

Jason

···

On Tue, May 27, 2003 at 08:49:43PM +1000, Andrew Nesbit wrote:

I have tried to build wxPython twice: the first time was the stable
(2.4.0.7) version, the second time was the CVS snapshot 20030527. Each
time I received the following error message:

gcc -Wno-long-double -no-cpp-precomp -fno-common -dynamic -DNDEBUG -g
-O3 -Wall -Wstrict-prototypes -DSWIG_GLOBAL -DHAVE_CONFIG_H
-DWXP_USE_THREAD=1 -UNDEBUG -Isrc
-I/usr/local/apps/Python-2.3b1/Library/Frameworks/Python.framework/
Versions/2.3/include/python2.3 -c contrib/glcanvas/mac/glcanvas.cpp -o
build/temp.darwin-6.6-Power_Macintosh-2.3/contrib/glcanvas/mac/
glcanvas.o -I/usr/local/apps/wxMac-20030527/lib/wx/include/macd-2.5
-I/usr/local/apps/wxMac-20030527/include -D__WXDEBUG__ -D__WXMAC__
-DWXMAKINGDLL -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
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/Carbon.framework/Headers/Carbon.h:20,
                 from
/System/Library/Frameworks/AGL.framework/Headers/agl.h:22,
                 from
/usr/local/apps/wxMac-20030527/include/wx/mac/glcanvas.h:29,
                 from
/usr/local/apps/wxMac-20030527/include/wx/glcanvas.h:19,
                 from contrib/glcanvas/mac/glcanvas.cpp:61:
/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: `
   scalb' undeclared (first use this function)
/System/Library/Frameworks/CoreServices.framework/Frameworks/
CarbonCore.framework/Headers/fp.h:1896: (Each
   undeclared identifier is reported only once for each function it
appears
   in.)
error: command 'gcc' failed with exit status 1

My system is Mac OS X 10.2.6 with December 2002 developer tools.

Is there somebody who could please help me with this?

You know, I've had this problem compiling programs other than wxPython
too.

The solution is to temporarily change line 1896 of fp.h from
"#ifdef __cplusplus" to "#if 1". Or maybe its "#if 0". Anyway, try
both. One should work.

Thanks for the tip, Jason. I changed it to "#if 0" temporarily and it worked.

Andrew.