View mode: basic / threaded / horizontal-split · Log in · Help
March 21, 2005
Re: OS X, gdc and opengl
Anders F Björklund wrote:

> Brad Beveridge wrote:
> 
>> I don't quite understand what you are saying with the linker 
>> recognising -framework, could you please post a trivial example of how 
>> to compile & link a D file that needs OpenGL?  I tried
> 
> 
> "-framework" goes to the compiler, which will choke on the unrecognized
> option. By using "-Wl", you can pass whatever you want to the linker...
> 
>> opengltestd: opengltest.d
>> gdc $< -I../SDL -L/sw/lib -lSDLmain -lSDL -framework OpenGL -lpthread 
>> -lGL -lglut -lGLU -o $@
> 
> 
> You did not say that you wanted to use SDL, which is lots more fun since
> it is written in Objective-C and requires a patched SDLmain library...
> 
> But anyway, the libraries are:
> LDFLAGS_GL=-Wl,-framework,OpenGL -Wl,-framework,GLUT -lobjc
> LDFLAGS_SDL=-Wl,-framework,SDL -Wl,-framework,Cocoa -Lsdl -lSDLmain_d
> 
> On Linux, they would instead be:
> LDFLAGS_GL=-lGL -lGLUT
> LDFLAGS_SDL=-lSDL
> 
> I should have an updated example up sometime next week.
> The old example does not compile at the moment, but when
> it did it was running both GL "gears" and SDL "testbitmap".
> 
> --anders
Sorry for being so dense - I seem to be close, but not quite there yet
Here is my compile command

gdc opengltest.d -o opengltestd -I../SDL -L/sw/lib -Wl,-framework,OpenGL 
-Wl,-framework,GLUT -lobjc -lSDL -Wl,-framework,Cocoa -lSDLmain
/usr/bin/ld: Undefined symbols:
_SDL_main
collect2: ld returned 1 exit status

I couldn't use your command as I got this error
gdc opengltest.d -o opengltestd -I../SDL -L/sw/lib -Wl,-framework,OpenGL 
-Wl,-framework,GLUT -lobjc -Wl,-framework,SDL -Wl,-framework,Cocoa 
-lSDLmain_d
/usr/bin/ld: can't locate framework for: -framework SDL

I've tried to get the OSX SDL framework installed, but to no avail.  The 
SDL source fails in the ./configure stage (threading unsupported!), and 
the SDL OSX devel libraries specifically say the framework is not 
installed & to get it from the sources.

Any help is much appreciated.

Cheers
Brad
March 21, 2005
Re: OS X, gdc and opengl
Brad Beveridge wrote:

>> You did not say that you wanted to use SDL, which is lots more fun since
>> it is written in Objective-C and requires a patched SDLmain library...
>>
> I've tried to get the OSX SDL framework installed, but to no avail.  The 
> SDL source fails in the ./configure stage (threading unsupported!), and 
> the SDL OSX devel libraries specifically say the framework is not 
> installed & to get it from the sources.

You need a special version of the SDLmain, that initializes the D 
runtime. It also needs to be called from your "main(char[][] args)"

> Any help is much appreciated.

SDL code will come later, just use plain GLUT in the meantime ?

--anders
March 22, 2005
Re: OS X, gdc and opengl
<SNIP>
> SDL code will come later, just use plain GLUT in the meantime ?
> 
> --anders
boohoo, sob! :)
Yeah, maybe I'm jumping in just a tad deep.  I'll back off and play with 
GLUT.  I probably ought to become familiar with the Apple way of doing 
development also.  All of my linux play apps are SDL based, so hopefully 
when I get a little smarter they'll all "Just Work" on OSX.

Thanks for the help Anders
Brad
March 22, 2005
Re: OS X, gdc and opengl
> I should have an updated example up sometime next week.
> The old example does not compile at the moment, but when
> it did it was running both GL "gears" and SDL "testbitmap".
> 
> --anders
Hi again Anders - these examples that you mention, can you please tell 
me were to find them?

Thanks
Brad
March 22, 2005
Re: OS X, gdc and opengl
Brad Beveridge wrote:

> Hi again Anders - these examples that you mention, can you please tell 
> me were to find them?

They're not updated and online just yet...

They'll be on http://www.algonet.se/~afb/d/

--anders
March 22, 2005
Re: OS X, gdc and opengl
Anders F Björklund wrote:
> Brad Beveridge wrote:
> 
>> Hi again Anders - these examples that you mention, can you please tell 
>> me were to find them?
> 
> 
> They're not updated and online just yet...
> 
> They'll be on http://www.algonet.se/~afb/d/
> 
> --anders
Fantastic, thanks!
March 25, 2005
Re: OS X, gdc and opengl
Brad Beveridge wrote:

>> They're not updated and online just yet...
> 
> Fantastic, thanks!

Seems like the next GDC version will be a while,
and so will a coherent download of SDL/GL for Mac.

If you're anxious to get started, see my CVS rep.
(or email me privately, it shouldn't be that hard)

--anders
March 25, 2005
Re: OS X, gdc and opengl
Anders F Björklund wrote:
> Brad Beveridge wrote:
> 
>>> They're not updated and online just yet...
>>
>>
>> Fantastic, thanks!
> 
> 
> Seems like the next GDC version will be a while,
> and so will a coherent download of SDL/GL for Mac.
> 
> If you're anxious to get started, see my CVS rep.
> (or email me privately, it shouldn't be that hard)
> 
> --anders
Thanks Anders.  I don't mind waiting :)  I've got plenty to do to figure 
out how best to use OSX as a development environment.

Brad
March 29, 2005
Re: OS X, gdc and opengl
Anders F Björklund wrote:
> Brad Beveridge wrote:
> 
>>> They're not updated and online just yet...
>>
>>
>> Fantastic, thanks!
> 
> 
> Seems like the next GDC version will be a while,
> and so will a coherent download of SDL/GL for Mac.
> 
> If you're anxious to get started, see my CVS rep.
> (or email me privately, it shouldn't be that hard)
> 
> --anders
I played with your CVS tree last night, and managed to get the testgl 
program working fine.  So I can start playing with my own SDL/D/MacOS 
stuff now :)
Thanks for the good work.  I take it the SDL stuff you've done is open 
source, or somesuch?
Also, do you know if it is possible to profile GDC apps with Shark? 
I've heard a lot about Shark & I think I may play with that next.

Brad
March 29, 2005
Re: OS X, gdc and opengl
brad@domain.invalid wrote:

> Thanks for the good work.  I take it the SDL stuff you've done is open 
> source, or somesuch?

It's under the same license as the C headers, i.e. LGPL for SDL

> Also, do you know if it is possible to profile GDC apps with Shark? I've 
> heard a lot about Shark & I think I may play with that next.

Should be, just that the D name mangling is a little "strange"...

--anders
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home