View previous topic :: View next topic |
Author |
Message |
MikeS
Joined: 19 Oct 2011 Posts: 2 Location: United States
|
Posted: Wed Oct 19, 2011 12:04 pm Post subject: Built the libs, but cannot import? |
|
|
Hi folks,
I was able to download the Derelict libs and build the solution in both release and debug mode. I now have a populated lib folder with all of the libraries.
I am now trying to build a simple OpenGL triangle window with SDL, but am having problems linking. I have tried with both VisualD and D-IDE to include the library path.
Steps I've taken with D-IDE
1.) Added C:\Derelict\lib\DerelictSDL.lib and other libs in the Global Settings of dmd2 Library Paths (which contains all of my .lib files)
2.) Clicked on my projects settings and went to D Settings and added to Imported libraries C:\Derelict\import\derelict\sdl (which contains all the .di files)
3.) Downloaded SDL.dll and placed it write next to my main.d source file.
Error message I get:
C:\..\..\..\..\testConsole\testConsole\main.d(1): Error: module sdl is in file 'derelict\sdl\sdl.d' which cannot be read
I guess I've always had trouble understanding the linking process in both D and C/C++. Any walkthroughs, advice, or known issues to get things up and running? (Even if it means downloading a new IDE, or just compiling from command line)
Thanks,
Mike |
|
Back to top |
|
|
MikeS
Joined: 19 Oct 2011 Posts: 2 Location: United States
|
Posted: Wed Oct 19, 2011 12:56 pm Post subject: |
|
|
Yuck, after hours of digging and messing around here is the solution.
Step 0:
Find Derelict.sln and build all the libraries
Step 1:
In Project Settings/Linker/General add these libs
C:\Derelict\lib\DerelictSDL.lib C:\Derelict\lib\DerelictGL.lib C:\Derelict\lib\DerelictUtil.lib
Step 2:
In ProjectSettings/DMD/General add this path to your import libraries
C:\Derelict\import
Step 3:
Download SDL.dll and drop it in your project folder next to your sources
As of this date, ignore any editing of the sc.ini file.
If you want to do this from command line, do this(untested! you may have to also include your d files as well:
dmd -g -debug -X -Xf"$(IntDir)\$(TargetName).json" -IC:\Derelict\import -deps="$(OutDir)\$(ProjectName).dep" -of"$(OutDir)\$(ProjectName).exe_cv" -map "$(INTDIR)\$(SAFEPROJECTNAME).map" -L/NOMAP C:\Derelict\lib\DerelictSDL.lib C:\Derelict\lib\DerelictGL.lib C:\Derelict\lib\DerelictUtil.lib
Note that you will have to type out $(ProjectName), and that you can also get rid of some flags like building the .json documentation(this is just a straight copy and paste from visualD)
Hopefully this saves others time in the future...Some keywords below to help.
Keywords: import,linking,loading,SDL errors, import, etc. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Oct 19, 2011 8:46 pm Post subject: Re: Built the libs, but cannot import? |
|
|
MikeS wrote: |
Error message I get:
C:\..\..\..\..\testConsole\testConsole\main.d(1): Error: module sdl is in file 'derelict\sdl\sdl.d' which cannot be read |
This is not a linker error, but a compiler error. Whenever you see something like this, it means that particular module is not in your import path. I see you've already figured it out, but if your modules are in the package 'foo', and physically located in /import/foo, then your import path needs to contain /import, and not /import/foo. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
|
|
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
|