FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to setup and use derelict on debian ? Solved !

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Sun Jul 31, 2011 11:20 am    Post subject: how to setup and use derelict on debian ? Solved ! Reply with quote

on debian 6 using gdc , d version 1.0
just started learning d about 2 days now.
I know c , c++ , python , and some cython

interested in derelict.SFML .

how to setup ?
already download from derelict2 , SFML
already have SFML 1.6 install.
already have csfml 1.6 install.

how to use derelict.SFML ?


Last edited by DrakeMagi on Wed Aug 03, 2011 8:19 am; edited 1 time in total
Back to top
View user's profile Send private message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Sun Jul 31, 2011 7:28 pm    Post subject: Reply with quote

I can't seem to get this to work
Code:
make -f linux.mak DC=gdmd


make: linux.mak: No such file or directory
make: *** No rule to make target `linux.mak'. Stop.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Jul 31, 2011 8:35 pm    Post subject: Reply with quote

Did you cd to the top-level Derelict directory before executing the make command?
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Sun Jul 31, 2011 9:32 pm    Post subject: Reply with quote

No !

downloaded top zip
ran make , it did something.
Code:
make -f linux.mak DerelictSDL DerelictGL DerelictSFML DerelictUTIL DC=gdmd


but still don't have it working.

what do you do with import Folder full of .di ?
was it to make new .so or .a ?
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Aug 01, 2011 12:59 am    Post subject: Reply with quote

DrakeMagi wrote:
No !

downloaded top zip
ran make , it did something.
Code:
make -f linux.mak DerelictSDL DerelictGL DerelictSFML DerelictUTIL DC=gdmd


but still don't have it working.


So what did you do and what problem are you having now?

Quote:

what do you do with import Folder full of .di ?
was it to make new .so or .a ?


When you use Derelict, you have to import the Derelict modules into your own modules. The way the source tree is organized, this can be inconvenient. The .di files are generated in a convenient hierarchy that you can add to your import path (with the compiler's -I command line option) when compiling your own app.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Mon Aug 01, 2011 6:25 am    Post subject: Reply with quote

where would i put the import folder ?

i'm using gdc. what would it look like ?
Code:
import derelict.sdl.sdl;

int main()
{
   DerelictSDL.load();
   
   SDL_Surface *screen;
   SDL_Init( SDL_INIT_EVERYTHING );
   
   screen = SDL_SetVideoMode( 800,600,32,SDL_SWSURFACE );
   
   SDL_Flip( screen );
   
   SDL_Delay( 2000 );
   
   SDL_Quit();
   
   return 0;
}

because i can't get it to work
Code:
gdc -o dtest dtest.d -I/path/sdl -I/path/sdlfuncs -I/path/sdltypes
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Aug 01, 2011 11:54 pm    Post subject: Reply with quote

DrakeMagi wrote:

Code:
gdc -o dtest dtest.d -I/path/sdl -I/path/sdlfuncs -I/path/sdltypes


Well, sdlfuncs and sdltypes are not folders, they are files. So what you are doing here makes no sense.

Lets say you've got your derelict files in /myhome/derelict. After you've compiled, you will have .di files in /myhome/derelict/import, and the library files in /myhome/derelict/lib. You need to tell the compiler three things: where it can find the imports, where it can find the libraries, and which libraries to link with. For gdc, I believe that should look something like this:

Code:

gdc -I/myhome/derelict/import -L/myhome/derelict/lib -lDerelictSDL -lDerelictUtil dtest.d

_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Tue Aug 02, 2011 8:51 am    Post subject: Reply with quote

Thanks , i been guessing

but i get error
/usr/bin/ld: cannot find -lDerelictSDL
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Tue Aug 02, 2011 7:44 pm    Post subject: Reply with quote

This means that the linker can't find the path where your libraries are. Make sure you passed the correct path with the -L switch.

From this point, I suggest you take this to the D newsgroups. Possibly D.learn. This is no longer about Derelict and is now about your toolchain. There are several Linux and GDC users who use the newsgroup and will be able to help you better than I can.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Wed Aug 03, 2011 6:21 am    Post subject: Reply with quote

what libraries are you linking with ?
in my Derelict2 folder only thing there is the x-archive lib file.

currently path /home/***/Derelict2
Back to top
View user's profile Send private message
DrakeMagi



Joined: 31 Jul 2011
Posts: 17

PostPosted: Wed Aug 03, 2011 8:16 am    Post subject: Reply with quote

I have it working now. Thanks for your help.

my second mistake was my make command
Code:
make -f linux.mak DerelictSDL DC=gdmd

this made a lib x-archive file had to remove. i think it did.
should have been
Code:
make -f linux.mak DerelictSDL_ALL DC=gdmd

made the libraries in the .../Derelict2/lib

linking (... is my user name dotted out)
Code:
gdc -o dsdl dsdl.d -I/home/.../Derelict2/import -L/home/.../Derelict2/lib -ldl -lDerelictSDL -LDerelictUtil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group