On Friday, 10 July 2015 at 00:53:38 UTC, codenstuff wrote:

The path is ${HOME}/d_apps/steering/steering/game_object.d

Compile command is

dmd map/map.d main_visual.d -ofmain_visual -H -gc -unittest -L-lDgame -L-lDerelictUtil -L-lDerelictGL3 -L-lDerelictSDL2 -L-ldl -I/home/real/d_apps/dgame/source -I/home/real/d_apps/derelict_util/source -I/home/real/d_apps/derelict_gl3/source -I/home/real/d_apps/derelict_sdl2/source -I/home/real/d_apps/steering

Compiler message is same

First, because you are importing sterring.game_object, then you can't pass -I/home/real/d_apps/steering to the compiler -- this will cause it to look for /home/real/d_apps/steering/sterring/game_object.d. You have to pass the parent of the steering directory, i.e. -I/home real/d_apps. Then it will be able to find the import.

Second, the above will only solve your immediate problem. The next problem is that you are going to run into linking errors. The -I switch only affects how the compiler can find which symbols are available in a module. It does not affect which modules get compiled. You will still need compile game_object.d, and all of the files from Dgame, DerelictUtil, DerelictGL3 and DerelictSDL2. The latter all have dub configurations that allow you to easily compile them into libraries. Then you can pass all of those on the command line, along with game_object.d (as Adam already recommended).

Since all of the projects you are using have dub packages, it will be much easier for you to use dub to manage your own project. Then building becomes this:

dub build

Much less hassle.

Reply via email to