0

我需要将多个项目中的模块导入当前项目。

目前我从编译器收到以下消息:

map/map.d(9): Error: module game_object is in file 'steering/game_object.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import

项目设置如下:

${HOME}/d_apps/steering

${HOME}/d_apps/path_find

${HOME}/d_apps/path_find/map/map.d includes steering.game_object

编译命令:

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
4

2 回答 2

1

只需在您的 dmd 命令开头添加steering/game_object.d 即可。

于 2015-07-10T07:53:06.313 回答
1

我想game_object.d的路径是${HOME}/d_apps/steering/game_object.d。在这种情况下,找不到模块,因为没有指定包含转向/game_object.d 的目录。您需要添加 -I${HOME}/d_apps 或将文件移动到 ${HOME}/d_apps/steering/steering/game_object.d。

于 2015-07-10T19:26:08.603 回答