Compiling for OSX

Previous topic - Next topic

matty47

I tried compiling a program using entity lib for osx ppc and got the following error
Code (glbasic) Select

*** Configuration: OS-X_UNI ***
precompiling:
GPC - GLBasic Precompiler V.2008.093 - 3D, NET
Wordcount:332 commands

compile+link:
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glAttachObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCompileShaderARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateProgramObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateShaderObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glDeleteObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetBufferParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetInfoLogARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetObjectParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetUniformLocationARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glLinkProgramARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glShaderSourceARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1fARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1iARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUseProgramObjectARB in section (__DATA,__data)
collect2: ld returned 1 exit status
*** FATAL ERROR - Please post this output in the forum

Any idea??
THanks
Matthew

Kitty Hello

post the source code please (make as short as possible)

matty47

Hi Gernot, I did some further testing. Other programs including 3d ones seem to compile OK however anything using the Entity code from the snippets forum produces the same error. The code for the Entity system is on the forum. I tried using the one straight from the forum. Made a project, added the Entity code file and main program was just [ DEBUG "Testing"]. Code failed to link with the errors above.
Thanks
Matthew

matty47

OK. Did a bit more testing and I think that the error is being generated by some Inline code included by someone to change the falloff of the light.
First bit
Code (glbasic) Select

INLINE
    };// namespace
    extern "C" void __stdcall glLightf(int, int, float);
    namespace __GLBASIC__ {
ENDINLINE

followed a bit later by
Code (glbasic) Select

IF o.constant > 0 OR o.linear > 0 OR o.quadratic > 0
INLINE
    #define GL_LIGHT0 0x4000
    #define GL_CONSTANT_ATTENUATION 0x1207
    #define GL_LINEAR_ATTENUATION             0x1208
    #define GL_QUADRATIC_ATTENUATION          0x1209
    glLightf(GL_LIGHT0+iLight, GL_CONSTANT_ATTENUATION,  o.constant);
    glLightf(GL_LIGHT0+iLight, GL_LINEAR_ATTENUATION, o.linear);
    glLightf(GL_LIGHT0+iLight, GL_QUADRATIC_ATTENUATION, o.quadratic);
ENDINLINE
ENDIF

If I comment out these sections the code compiles and links without errors although I have not tried the application on a mac yet.
Is Inline broken on the osx compiler? as the code compiled and executed ok when making a windows app.
Hope this is of some help
Thanks
Matthew

matty47

Hi,
sorry if I am hassling but has anyone got an idea if the inline does not work for osx?
Thanks greatly
Matthew

trucidare

Please wait, i will make some tests today.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

ah! Maybe the __stdcall is causing a problem!?

trucidare

yes its __stdcall. its not supportet on OSX. Some IFNDEF solutions?
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

#define __stdcall
maybe!?

Kitty Hello

Fixed in next update.

Ian Price

Is OSX compilation working yet Gernot? I've just tried compiling B'lox! and it came up with this message -

Quote
*** Configuration: OS-X_UNI ***
precompiling:
GPC - GLBasic Precompiler V.2008.179 - 3D, NET
"blox.gbas"(458) warning : probably unassigned variable : rv
Wordcount:2191 commands

compile+link:
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: for architecture i386
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8//4.0.1/ld: tablecygdrive/c/Program  of contents forFiles/GLBasic/Compiler/ archive: /cygdriveplatform/Mac/Bin//C/Program Files../libexec/gcc/GLBasic/Compiler/platform/powerpc-apple-darwin8/Mac/OSX/Lib/4.0.1/ld: /libGLBasicUni.a is outfor architecture ppc
of date; /cygdrive/c/Programrerun ranlib(1) Files/GLBasic/Compiler (can't /platform/Mac/Binload from it)/../libexec/
/cygdrive/c/gcc/powerpc-apple-Program Files/GLBasic/darwin8/4.0.1/ld:Compiler/platform/Mac/ table of contentsBin/../libexec for archive: /gcc/i686-apple/cygdrive/C/Program-darwin8/4.0.1/ld Files/GLBasic/Compiler: table of /platform/Mac/OSXcontents for archive:/Lib/libGLBasicUni.a is /cygdrive/C/ out of dateProgram Files/GLBasic/; rerun ranlib(Compiler/platform/Mac/1) (can'OSX/Lib/libpng_uni.a t load from is out of it)
/cygdrive/date; rerun ranlibc/Program Files/(1) (canGLBasic/Compiler/platform/'t load fromMac/Bin/.. it)
collect2: ld returned /libexec/gcc/powerpc1 exit status
-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libpng_uni.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
powerpc-apple-darwin8-lipo: can't open input file: /cygdrive/c/WINDOWS/TEMP/ccWdE6qW.out (No such file or directory)
*** FATAL ERROR - Please post this output in the forum



I came. I saw. I played.

Kitty Hello

Strange. It's working here. Next update, maybe?

PeeJay

Hiya Gernot

As the shoeboxing is fixed, I thought I'd give compiling GWAN to OS/X a try, but got this error:-

Code (glbasic) Select
compile+link:
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: for architecture i386
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a is out of date; rerun ranlib(1) (can't load from it)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libpng_uni.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: for architecture ppc
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a is out of date; rerun ranlib(1) (can't load from it)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: table of contents for archive: /cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libpng_uni.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
powerpc-apple-darwin8-lipo: can't open input file: /cygdrive/c/DOCUME~1/PeeJay/LOCALS~1/Temp/ccS4YgQe.out (No such file or directory)
*** FATAL ERROR - Please post this output in the forum


Ideas?
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

Kitty Hello

Strange. Works for me, so I'd better put the whole compiler back in the update.