View previous topic :: View next topic |
Author |
Message |
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Fri Nov 06, 2009 12:48 pm Post subject: Compiling Problem : identifier 'DerelictGLContext' |
|
|
When compiling DerelictGL, this repeats many times:
derelict/opengl/gl.d:216: Error: identifier 'DerelictGLContext' is not defined
derelict/opengl/gl.d:216: Error: DerelictGLContext is used as a type
I am now wondering if it is a problem with my toolchain, since I have a similar error compiling GtkD http://www.dsource.org/forums/viewtopic.php?t=4827
Any suggestions on where to look?
DSSS version 0.75
gcc version 4.1.3 20080428 (prerelease (gdc 0.24, using dmd 1.020))
FreeBSD 8.0-RC2[/url] |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sat Nov 07, 2009 10:37 am Post subject: |
|
|
Yeah, GLXContext should work.
I can't find that symbol directly in libGL.so, but it might dlopen another library.
Another note for FreeBSD that we ran into in gtkd was linking against -ldl, which isn't required for freebsd since dlopen() and family is in libc. |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sun Nov 08, 2009 11:43 am Post subject: |
|
|
hmm, its still bitching about GLXContext
It is in the headers, but isn't a symbol in the library, so I don't understand how D is suppose to find it (it works on my linux box which has (nearly) the same headers and libGL.so).
The only thing that I can figure that differs between the linux box and freebsd box is the location of the libraries. The linux box has them in /usr/lib, the freebsd box has them in /usr/local/lib |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Sun Nov 08, 2009 2:11 pm Post subject: |
|
|
But it compiles now? |
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sun Nov 08, 2009 2:12 pm Post subject: |
|
|
No, it doesn't.
That is why I was trying to figure out where D gets the symbols at compile time. |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Sun Nov 08, 2009 2:35 pm Post subject: |
|
|
How about now? |
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sun Nov 08, 2009 6:00 pm Post subject: |
|
|
Sweet, that compiles now |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Nov 08, 2009 7:25 pm Post subject: |
|
|
Good work, guys I've always been curious if Derelict would work out of the box on FreeBSD. I suppose this answers that question!
@doob: I'm wondering about this line:
Code: |
pragma(link, "c"); // the dl* functions are in libc on freebsd
|
Not that it hurts anything, but doesn't the compiler link libc in automatically? I assume you don't have a FreeBSD box to find out for sure. I suppose I should see about FreeBSD support in VirtualBox so I can get up to speed on this stuff. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sun Nov 08, 2009 7:28 pm Post subject: |
|
|
Yeah, FreeBSD does link in libc automaticly, so the pragma isn't needed.
I haven't had a chance to test Derelict yet, I can only confirm it'll compile, which is half the problem of porting most of the time. When I get a chance to test it, I'll post here. |
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
Posted: Sun Nov 08, 2009 9:47 pm Post subject: |
|
|
A quick patch to make stuff compile & link properly:
Code: |
Index: DerelictUtil/derelict/util/loader.d
===================================================================
--- DerelictUtil/derelict/util/loader.d (revision 393)
+++ DerelictUtil/derelict/util/loader.d (working copy)
@@ -64,13 +64,7 @@
// for people using DSSS, tell it to link the executable with libdl
version(build)
{
- version (freebsd)
- {
- pragma(link, "c"); // the dl* functions are in libc on freebsd
- }
-
- else
- pragma(link, "dl");
+ version(linux) pragma(link, "dl")
}
}
@@ -290,6 +284,9 @@
}
else version (linux) {
libNameString = linLibs;
+ }
+ else version(freebsd) {
+ libNameString = linLibs;
}
else version(darwin) {
libNameString = macLibs;
|
Although I think I'd change linLibs to nixLibs (following your other naming convention).
The problem I am having now is segfaults inside of the SDL library:
Code: |
#0 0x080e3934 in SDL_ClearError ()
#1 0x2835b96f in SDL_Init () from /usr/local/lib/libSDL.so
#2 0x08093a13 in _D4main4initFZv ()
#3 0x08093aca in _Dmain ()
#4 0x080c0844 in _D9dgccmain211_d_run_mainUiPPaPUAAaZiZi2goMFZv ()
at ../.././../gcc-4.1-20080428/libphobos/internal/dgccmain2.d:83
#5 0x080c0902 in _d_run_main (argc=1, argv=0xbfbfec5c, main_func=0x8093ab2 <_Dmain>)
at ../.././../gcc-4.1-20080428/libphobos/internal/dgccmain2.d:93
#6 0x080bd348 in main (argc=205504, argv=0x0)
at ../.././../gcc-4.1-20080428/libphobos/internal/cmain.d:5
|
|
|
Back to top |
|
|
tbone
Joined: 05 Nov 2009 Posts: 19
|
|
Back to top |
|
|
|