www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - d with glfw under linux

reply Hannes <Hannes_member pathlink.com> writes:
Hi,

I'm a complete linux newbie and have trouble getting glfw to work.
Compiling simple d programs (hello world) is no problem.
Compiling the glfw examples for C/C++ is no problem.
But I cannot figure out how to compile a d program that uses glfw :(

Here is my attempt at the makefile so far:



DC      = dmd
DFLAGS  = -debug -g
IMPORTS = -I~/code/dtris/imports/
LIBS    =  ~/glfw-2.5/lib/x11/libglfw.a /usr/lib/libGLU.a /usr/lib/libGL.a
/usr/lib/libX11.a /usr/lib/libm.a

all: main.d
$(DC) $(DFLAGS) $(IMPORTS) -ofsimple $(LIBS)



But I get tons of errors:

1.a /usr/lib/libm.a -g -lphobos -lpthread -lm
/usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
: undefined reference to `XF86VidModeQueryVersion'
/usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
: undefined reference to `XF86VidModeGetModeLine'
/usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
: undefined reference to `XextFindDisplay'
/usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
: undefined reference to `XextAddDisplay'
/usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
: undefined reference to `XextCreateExtension'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmUnmap'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmUnmap'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmClose'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmOpen'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmGetMagic'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmGetVersion'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmFreeVersion'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmMap'
/usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmMap'
/usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
: undefined reference to `XextRemoveDisplay'
/usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
: undefined reference to `XextRemoveDisplay'
/usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
: undefined reference to `dlopen'
/usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
: undefined reference to `dlerror'
/usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
: undefined reference to `dlsym'
/usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
: undefined reference to `dlclose'
/usr/lib/libGL.a(dri_glx.o): In function `glXGetDriverConfig':
: undefined reference to `dlsym'
/usr/lib/libGL.a(dri_glx.o): In function `driDestroyDisplay':
: undefined reference to `dlclose'
/usr/lib/libGL.a(XF86dri.o): In function `find_display':
: undefined reference to `XextFindDisplay'
/usr/lib/libGL.a(XF86dri.o): In function `find_display':
: undefined reference to `XextAddDisplay'
/usr/lib/libGL.a(XF86dri.o): In function `find_display':
: undefined reference to `XextCreateExtension'
/usr/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryVersion':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryDirectRenderingCapable':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(XF86dri.o): In function `XF86DRIOpenConnection':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(XF86dri.o): In function `XF86DRIAuthConnection':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(XF86dri.o): In function `XF86DRICloseConnection':
: undefined reference to `XMissingExtension'
/usr/lib/libGL.a(XF86dri.o):: more undefined references to `XMissingExtension'
follow
/usr/lib/libGL.a(XF86dri.o): In function `close_display':
: undefined reference to `XextRemoveDisplay'
/usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
: undefined reference to `XauDisposeAuth'
/usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
: undefined reference to `XauGetBestAuthByAddr'
/usr/lib/libX11.a(CrGlCur.o): In function `open_library':
: undefined reference to `dlopen'
/usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
: undefined reference to `dlsym'
/usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
: undefined reference to `dlsym'
/usr/lib/libX11.a(XlcDL.o): In function `open_object':
: undefined reference to `dlopen'
/usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
: undefined reference to `dlsym'
/usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
: undefined reference to `dlsym'
/usr/lib/libX11.a(XlcDL.o): In function `close_object':
: undefined reference to `dlclose'
collect2: ld gab 1 als Ende-Status zurück
--- errorlevel 1
make: *** [all] Fehler 1



It already took me hours and hours of reading manuals and copy/paste from other
makefiles, but no luck. It's very frustrating. If anybody could help I would
really appreciate it!
Oct 26 2005
next sibling parent reply clayasaurus <clayasaurus gmail.com> writes:
Hannes wrote:
 Hi,
 
 I'm a complete linux newbie and have trouble getting glfw to work.
 Compiling simple d programs (hello world) is no problem.
 Compiling the glfw examples for C/C++ is no problem.
 But I cannot figure out how to compile a d program that uses glfw :(
 
 Here is my attempt at the makefile so far:
 
 
 
 DC      = dmd
 DFLAGS  = -debug -g
 IMPORTS = -I~/code/dtris/imports/
 LIBS    =  ~/glfw-2.5/lib/x11/libglfw.a /usr/lib/libGLU.a /usr/lib/libGL.a
 /usr/lib/libX11.a /usr/lib/libm.a
 
 all: main.d
 $(DC) $(DFLAGS) $(IMPORTS) -ofsimple $(LIBS)
 
 
 
 But I get tons of errors:
 
 1.a /usr/lib/libm.a -g -lphobos -lpthread -lm
 /usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
 : undefined reference to `XF86VidModeQueryVersion'
 /usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
 : undefined reference to `XF86VidModeGetModeLine'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextFindDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextAddDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextCreateExtension'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmUnmap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmUnmap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmClose'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmOpen'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmGetMagic'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmGetVersion'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmFreeVersion'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmMap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmMap'
 /usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlopen'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlerror'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlsym'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlclose'
 /usr/lib/libGL.a(dri_glx.o): In function `glXGetDriverConfig':
 : undefined reference to `dlsym'
 /usr/lib/libGL.a(dri_glx.o): In function `driDestroyDisplay':
 : undefined reference to `dlclose'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextFindDisplay'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextAddDisplay'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextCreateExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryVersion':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryDirectRenderingCapable':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIOpenConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIAuthConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRICloseConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o):: more undefined references to `XMissingExtension'
 follow
 /usr/lib/libGL.a(XF86dri.o): In function `close_display':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
 : undefined reference to `XauDisposeAuth'
 /usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
 : undefined reference to `XauGetBestAuthByAddr'
 /usr/lib/libX11.a(CrGlCur.o): In function `open_library':
 : undefined reference to `dlopen'
 /usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `open_object':
 : undefined reference to `dlopen'
 /usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `close_object':
 : undefined reference to `dlclose'
 collect2: ld gab 1 als Ende-Status zurück
 --- errorlevel 1
 make: *** [all] Fehler 1
 
 
 
 It already took me hours and hours of reading manuals and copy/paste from other
 makefiles, but no luck. It's very frustrating. If anybody could help I would
 really appreciate it!
 
 

Add -L-ldl and -L-lXext to your library flags, then post what you have left. Those are the only two I can tell you need by looking at it.
Oct 26 2005
parent reply clayasaurus <clayasaurus gmail.com> writes:
clayasaurus wrote:
 Hannes wrote:
 
 Hi,

 I'm a complete linux newbie and have trouble getting glfw to work.
 Compiling simple d programs (hello world) is no problem.
 Compiling the glfw examples for C/C++ is no problem.
 But I cannot figure out how to compile a d program that uses glfw :(

 Here is my attempt at the makefile so far:



 DC      = dmd
 DFLAGS  = -debug -g
 IMPORTS = -I~/code/dtris/imports/
 LIBS    =  ~/glfw-2.5/lib/x11/libglfw.a /usr/lib/libGLU.a 
 /usr/lib/libGL.a
 /usr/lib/libX11.a /usr/lib/libm.a

 all: main.d
 $(DC) $(DFLAGS) $(IMPORTS) -ofsimple $(LIBS)



 But I get tons of errors:

 1.a /usr/lib/libm.a -g -lphobos -lpthread -lm
 /usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
 : undefined reference to `XF86VidModeQueryVersion'
 /usr/lib/libGL.a(glxcmds.o): In function `glXGetMscRateOML':
 : undefined reference to `XF86VidModeGetModeLine'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextFindDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextAddDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
 : undefined reference to `XextCreateExtension'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmUnmap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmUnmap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmClose'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmOpen'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmGetMagic'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmGetVersion'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmFreeVersion'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmMap'
 /usr/lib/libGL.a(glxext.o): In function `__glXInitialize':
 : undefined reference to `drmMap'
 /usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlopen'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlerror'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlsym'
 /usr/lib/libGL.a(dri_glx.o): In function `OpenDriver':
 : undefined reference to `dlclose'
 /usr/lib/libGL.a(dri_glx.o): In function `glXGetDriverConfig':
 : undefined reference to `dlsym'
 /usr/lib/libGL.a(dri_glx.o): In function `driDestroyDisplay':
 : undefined reference to `dlclose'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextFindDisplay'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextAddDisplay'
 /usr/lib/libGL.a(XF86dri.o): In function `find_display':
 : undefined reference to `XextCreateExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryVersion':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function 
 `XF86DRIQueryDirectRenderingCapable':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIOpenConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRIAuthConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o): In function `XF86DRICloseConnection':
 : undefined reference to `XMissingExtension'
 /usr/lib/libGL.a(XF86dri.o):: more undefined references to 
 `XMissingExtension'
 follow
 /usr/lib/libGL.a(XF86dri.o): In function `close_display':
 : undefined reference to `XextRemoveDisplay'
 /usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
 : undefined reference to `XauDisposeAuth'
 /usr/lib/libX11.a(ConnDis.o): In function `_X11TransConnectDisplay':
 : undefined reference to `XauGetBestAuthByAddr'
 /usr/lib/libX11.a(CrGlCur.o): In function `open_library':
 : undefined reference to `dlopen'
 /usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(CrGlCur.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `open_object':
 : undefined reference to `dlopen'
 /usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `fetch_symbol':
 : undefined reference to `dlsym'
 /usr/lib/libX11.a(XlcDL.o): In function `close_object':
 : undefined reference to `dlclose'
 collect2: ld gab 1 als Ende-Status zurück
 --- errorlevel 1
 make: *** [all] Fehler 1



 It already took me hours and hours of reading manuals and copy/paste 
 from other
 makefiles, but no luck. It's very frustrating. If anybody could help I 
 would
 really appreciate it!

Add -L-ldl and -L-lXext to your library flags, then post what you have left. Those are the only two I can tell you need by looking at it.

Add -L-lXxf86vm as well.
Oct 26 2005
parent reply Hannes <Hannes_member pathlink.com> writes:
In article <djonir$31kn$1 digitaldaemon.com>, clayasaurus says...

 Add -L-ldl and -L-lXext to your library flags


However I do have these files: /usr/lib/libXext.so.6.4.1 /usr/lib/libXext.so.6 /usr/lib/libXxf86vm.so.1.0.0 /usr/lib/libXxf86vm.so.1 But the linker did not like any of these. They seem to be different from normal libraries... what can I do? TIA
Oct 26 2005
parent reply clayasaurus <clayasaurus gmail.com> writes:
Hannes wrote:
 In article <djonir$31kn$1 digitaldaemon.com>, clayasaurus says...
 
 
Add -L-ldl and -L-lXext to your library flags

Add -L-lXxf86vm as well.

libdl was no problem, but I neither have libXext nor libXxf86vm. However I do have these files: /usr/lib/libXext.so.6.4.1 /usr/lib/libXext.so.6 /usr/lib/libXxf86vm.so.1.0.0 /usr/lib/libXxf86vm.so.1 But the linker did not like any of these. They seem to be different from normal libraries... what can I do? TIA

run 'ldconfig' from the command line and try again?
Oct 26 2005
parent reply Hannes <Hannes_member pathlink.com> writes:
Turned out I did not need those two libraries. My makefile now looks like this:



DC      = dmd
DFLAGS  = -debug -g
IMPORTS = -I~/code/dtris/imports/
LIBS    = -L-lglfw -L-lGLU -L-lGL -L-lX11 -L-lm -L-ldl

all: list.d slice.d piece.d moving.d board.d tetris.d main.d
$(DC) $(DFLAGS) $(IMPORTS) -oftetris list.d slice.d piece.d moving.d board.d
tetris.d main.d $(LIBS)



(Yeah, theres a lot more files, I simplified the previous examples).

..AND IT WORKS! This is like multiple orgasms (although guys normally don't
have them, but with D anything's possible!)

Now my next question is, how can I simply the makefile - the list of filenames
appear twice, surely there's some way to avoid that...?

And I often see makefiles where every file is treated seperately. I guess this
is not possible with D?
Oct 26 2005
next sibling parent reply Hannes <Hannes_member pathlink.com> writes:
You can download my first successful linux/D/GLFW compile at:
http://www.geocities.com/ackehurst/index.html

I'd be glad to hear if it runs on other linux machines than mine. THX!
Oct 26 2005
next sibling parent clayasaurus <clayasaurus gmail.com> writes:
Hannes wrote:
 You can download my first successful linux/D/GLFW compile at:
 http://www.geocities.com/ackehurst/index.html
 
 I'd be glad to hear if it runs on other linux machines than mine. THX!
 
 

Runs on my Kubuntu Badger.
Oct 26 2005
prev sibling next sibling parent Carlos Santander <csantander619 gmail.com> writes:
Hannes escribió:
 You can download my first successful linux/D/GLFW compile at:
 http://www.geocities.com/ackehurst/index.html
 
 I'd be glad to hear if it runs on other linux machines than mine. THX!
 
 

Ran for me on Gentoo and Slackware 10.1 but not on Ubuntu 5.04. -- Carlos Santander Bernal
Oct 26 2005
prev sibling next sibling parent =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= <jmjmak invalid_utu.fi> writes:
Hannes wrote:
 You can download my first successful linux/D/GLFW compile at:
 http://www.geocities.com/ackehurst/index.html
 
 I'd be glad to hear if it runs on other linux machines than mine. THX!
 
 

C++ version works, D version doesn't run on my Gentoo: $ ./dtris X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 42 (X_SetInputFocus) Serial number of failed request: 34 Current serial number in output stream: 37
Oct 27 2005
prev sibling parent Lucas <lgoss007 yahoo.com> writes:
In article <djouo8$7bd$1 digitaldaemon.com>, Hannes says...
You can download my first successful linux/D/GLFW compile at:
http://www.geocities.com/ackehurst/index.html

I'd be glad to hear if it runs on other linux machines than mine. THX!

Runs on my Ubuntu Breezy with Enlightenment!
Oct 27 2005
prev sibling parent reply clayasaurus <clayasaurus gmail.com> writes:
Hannes wrote:
 Turned out I did not need those two libraries. My makefile now looks like this:
 
 
 
 DC      = dmd
 DFLAGS  = -debug -g
 IMPORTS = -I~/code/dtris/imports/
 LIBS    = -L-lglfw -L-lGLU -L-lGL -L-lX11 -L-lm -L-ldl
 
 all: list.d slice.d piece.d moving.d board.d tetris.d main.d
 $(DC) $(DFLAGS) $(IMPORTS) -oftetris list.d slice.d piece.d moving.d board.d
 tetris.d main.d $(LIBS)
 
 
 
 (Yeah, theres a lot more files, I simplified the previous examples).
 
 ..AND IT WORKS! This is like multiple orgasms (although guys normally don't
 have them, but with D anything's possible!)
 
 Now my next question is, how can I simply the makefile - the list of filenames
 appear twice, surely there's some way to avoid that...?
 
 And I often see makefiles where every file is treated seperately. I guess this
 is not possible with D?
 
 

There's something else about D that you'll come to love. It is called build. http://www.dsource.org/projects/build/ "Build is designed to simplify the process of compiling a D application. It removes the need for tools like make and Scons, in that it analyzes the source code to work out source file dependancies, and then determines which of the dependant files need recompiling and linking. It can build either executables or libraries." Download the current source from that site and run 'make -f Makefile.unix' (or whatever the linux makefile is called) to build build. To use build to compile your application, just type ./build main.d -L-lglfw -L-lGLU -L-lGL -L-lX11 -L-lm -L-ldl -debug -g -I~/code/dtris/imports/ I usually put this command in an .sh/.bat script file so I just type ./compile and it builds my project. Or you could read the docs about .brf files if that suits you better. ( http://svn.dsource.org/projects/build/trunk/Docs/RESPONSE_FI E.htm#RESPONSE_FILE ) Build will figure out all the other files you need and pass them to the dmd command line. Have fun. ~ Clay
Oct 26 2005
parent reply Hannes <Hannes_member pathlink.com> writes:
Does not seem to work:



/compile.bat
gcc main.o board.o tetris.o gl.o glfw.o moving.o piece.o list.o slice.o -o main
-g -lphobos -lpthread -lm -Xlinker -lglfw -Xlinker -lGLU -Xlinker -lGL -Xlinker
-lX11 -Xlinker -lm -Xlinker -ldl
gcc: gl.o: Datei oder Verzeichnis nicht gefunden
gcc: glfw.o: Datei oder Verzeichnis nicht gefunden
--- errorlevel 1
Oct 27 2005
parent clayasaurus <clayasaurus gmail.com> writes:
Hannes wrote:
 Does not seem to work:
 
 
 
 /compile.bat
 gcc main.o board.o tetris.o gl.o glfw.o moving.o piece.o list.o slice.o -o main
 -g -lphobos -lpthread -lm -Xlinker -lglfw -Xlinker -lGLU -Xlinker -lGL -Xlinker
 -lX11 -Xlinker -lm -Xlinker -ldl
 gcc: gl.o: Datei oder Verzeichnis nicht gefunden
 gcc: glfw.o: Datei oder Verzeichnis nicht gefunden
 --- errorlevel 1
 
 

You can fix this by making a directory called objs, then point all objects in that directory with -odobjs/ btw you should probably using .sh for linux, .bat is for windows.
Oct 27 2005
prev sibling parent John Reimer <John_member pathlink.com> writes:
In article <djob97$2lc2$1 digitaldaemon.com>, Hannes says...
Hi,

I'm a complete linux newbie and have trouble getting glfw to work.
Compiling simple d programs (hello world) is no problem.
Compiling the glfw examples for C/C++ is no problem.
But I cannot figure out how to compile a d program that uses glfw :(

Mike Parker's Derelict supports using glfw through a shared library on Linux. Unfortunately, the developer of glfw itself still does not provide a linux shared library version of glfw, despite frequent requests being made for such. There is a way to create a shared library version of glfw on linux. If done, this makes it tremendously easy to use the library with linux. You don't have to worry about including any of the X link libraries on the command line because the dynamic loader takes care of loading these libraries for you as soon as libglfw.so is loaded. I believe instructions are included with the Derelict glfw distribution, (available on dsource.org) for compiling glfw into a shared library version for linux. I've built and used this shared library version of glfw successfully using derelict. -JJR
Oct 26 2005