View previous topic :: View next topic |
Author |
Message |
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Fri May 15, 2009 4:02 pm Post subject: [SOLVED] Mac OS X 10.5 Linker Problems! |
|
|
I'm using DSSS, Tango, and DMD (for D1)
I've checked all the paths, and messed around with this for 3 days but still can't get it to work. Here's the error I'm getting:
$ sudo dsss build
Builds everything great.... then:
Undefined symbols:
"_D8derelict6opengl3cgl14loadPlatformGLFC8derelict4util6loader9SharedLibZv", referenced from:
_D8derelict6opengl2gl7loadAllFC8derelict4util6loader9SharedLibZv in derelict.opengl.gl.o
"_D8derelict6opengl3cgl12__ModuleInfoZ", referenced from:
_D8derelict6opengl2gl12__ModuleInfoZ in derelict.opengl.gl.o
"_D8derelict3sdl7macinit7SDLMain12__ModuleInfoZ", referenced from:
_D8derelict3sdl3sdl12__ModuleInfoZ in derelict.sdl.sdl.o
"_CGLGetCurrentContext", referenced from:
_CGLGetCurrentContext$non_lazy_ptr in derelict.opengl.gl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
--- errorlevel 1
The same code and configuration works perfectly under Debian Linux and Windows Vista, but I can't get it to work on OS X 10.5!
Anyone else have this problem??? Thanks!
Last edited by licefork on Tue May 26, 2009 10:46 pm; edited 1 time in total |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Sat May 16, 2009 2:30 am Post subject: |
|
|
Do you have version darwin defined? |
|
Back to top |
|
|
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Sat May 16, 2009 4:35 pm Post subject: |
|
|
Yes. I get the same error if I use dmd without DSSS and explicitly link the derelict libraries. I'm trying to compile a simple tango/opengl application from OdeFu (the nehe tutorials). I'm using the latest tango, dmd, dsss, and derelict on a brand new MacBook with the latest Xcode. The same code links perfectly fine on my PC's. |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Sun May 17, 2009 3:09 am Post subject: |
|
|
Ok, let me see if I understand correctly. You have built and installed derelict correctly with dsss and you're trying to build an application when you get the link errors? If that correct perhaps you can give us a code example to try and compile. |
|
Back to top |
|
|
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Tue May 19, 2009 9:02 pm Post subject: |
|
|
I think I see where you are confused. I am not doing "dsss net install derelict" (because it won't compile) I am manually downloading derelict and compiling using the included dsss file (with -version=darwin defined). I include the source and libs in my project directory and try to build anything that uses derelict like so:
/test/src/dsss.conf:
Code: | name = test
buildflags = -S../lib -version=darwin
[test/test.d]
target = ../bin/test |
The compiled derelict libs are in /test/lib of course.
/test/src/test/test.d:
Code: | module test;
import tango.stdc.stringz;
import derelict.sdl.sdl;
// horizontal and vertical screen resolution
const int xResolution = 800;
const int yResolution = 600;
// number of bits per pixel used for display. 24 => true color
const int bitsPerPixel = 24;
void init() {
// initialize the SDL Derelict module
DerelictSDL.load();
// initialize SDL's VIDEO module
SDL_Init(SDL_INIT_VIDEO);
// enable double-buffering
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// create our OpenGL window
SDL_SetVideoMode(xResolution, yResolution, bitsPerPixel, SDL_OPENGL);
SDL_WM_SetCaption(toStringz("My SDL Window"), null);
}
// be nice and release all resources
void cleanup() {
// tell SDL to quit
SDL_Quit();
// release SDL's shared lib
DerelictSDL.unload();
}
void main() {
init();
scope(exit) cleanup(); // when we exit, perform cleanup
mainLoop:
while (true) {
SDL_Event event;
// handle all SDL events that we might've received in this loop iteration
while (SDL_PollEvent(&event)) {
switch (event.type) {
// user has clicked on the window's close button
case SDL_QUIT:
break mainLoop;
// by default, we do nothing => break from the switch
default:
break;
}
}
}
} |
No matter what directory structure or buildflags I use, I always get the same errors. For this exact app I get:
Code: | $ sudo dsss build
test/test.d => test
Undefined symbols:
"_D8derelict3sdl7macinit7SDLMain12__ModuleInfoZ", referenced from:
_D8derelict3sdl3sdl12__ModuleInfoZ in derelict.sdl.sdl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
--- errorlevel 1
Command /usr/local/bin/rebuild returned with code 65280, aborting.
Error: Command failed, aborting.
|
Last edited by licefork on Tue May 19, 2009 9:19 pm; edited 2 times in total |
|
Back to top |
|
|
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Tue May 19, 2009 9:14 pm Post subject: FINALLY! |
|
|
SUCCESS!
Okay, I tried downloading the latest source, compiled, still got the same error. I decided to give "dsss net install derelict" another try. The process completed without any errors this time, compiled my application, and it worked! I guess dsss just doesn't like derelict downloaded and compiled manually on Mac 10.5! |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed May 20, 2009 5:32 am Post subject: Re: FINALLY! |
|
|
licefork wrote: | I guess dsss just doesn't like derelict downloaded and compiled manually on Mac 10.5! |
Now, that's interesting. I'd love to know why. If anyone with the means to do so could figure it out... _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Wed May 20, 2009 7:52 am Post subject: Re: FINALLY! |
|
|
licefork wrote: | I guess dsss just doesn't like derelict downloaded and compiled manually on Mac 10.5! |
Did you run "dsss build" and "dsss install"? That works for me, at least when I downloaded with svn. |
|
Back to top |
|
|
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Tue May 26, 2009 10:32 pm Post subject: |
|
|
I downloaded derelict from svn, and just ran "dsss build" and placed the compiled libs in my path. I'm going to remove derelict from dsss, download from svn, do "dsss build" AND "dsss install" and see if that makes a difference. I'll let you know the results |
|
Back to top |
|
|
licefork
Joined: 15 May 2009 Posts: 6
|
Posted: Tue May 26, 2009 10:45 pm Post subject: |
|
|
Yep, worked perfectly. Can't believe I didn't think of that before! |
|
Back to top |
|
|
|