C++ や Java などの他の言語を使用した後、約 1 か月間 D を使用しています。シンプルなゲーム プラットフォームを Java から D に移行したいと考えていましたが、そのために Derelict3 ライブラリを使用したいと考えています。ここにあるgithubリポジトリをコンパイルしましたhttps://github.com/aldacron/Derelict3
それが役立つ場合は、Linuxを実行しています。
.a ファイルを/usr/lib/..に配置し、.d ファイル (Derelict ルート ディレクトリからのインポート フォルダー) を/usr/include/i386-linux-gnu/dmd/druntime に配置しました。 /輸入
私のコードは次のとおりです。
import std.stdio;
import derelict.opengl3.gl3;
import derelict.glfw3.glfw3;
pragma(lib, "/usr/lib/libDerelictUtil.a");
pragma(lib, "/usr/lib/libDerelictGL3.a");
pragma(lib, "/usr/lib/libDerelictGLFW3.a");
void main() {
DerelictGL3.load();
writeln("This is a line");
}
これは、stackoverflow で回答された他の質問と dlang.org フォーラムのいくつかのトピックに基づいていますが、コンパイル中に端末がこれを吐き出します。
kevin@kevin-Latitude-D620:~$ dmd main.d
/usr/include/D/Derelict/libDerelictGL3.a(gl3.o): In function `_D8derelict7opengl33gl318_sharedStaticDtor2FZv':
../import/derelict/opengl3/gl3.d:(.text._D8derelict7opengl33gl318_sharedStaticDtor2FZv+0x4): undefined reference to `_D8derelict4util6loader15SharedLibLoader19isAutoUnloadEnabledOFNdZb'
/usr/include/D/Derelict/libDerelictGL3.a(gl3_d1_649.o):(.data+0x38): undefined reference to `_D8derelict4util6loader15SharedLibLoader7__ClassZ'
/usr/include/D/Derelict/libDerelictGL3.a(gl3_d1_649.o):(.rodata+0x4418): undefined reference to `_D8derelict4util6loader15SharedLibLoader4loadMFZv'
(MORE of the above)
collect2: ld returned 1 exit status
--- errorlevel 1