2

このチュートリアルに従ってsfml 2.0 をインストールしましたが、コンパイルで問題が発生しました。以下のスクリプトのさまざまなバリエーションを試しました。このチュートリアルのコードを使用しています。

これは私がやってみたものです

g++ main.o -o -I/home/hassan/Development/sfml -- これはコンパイルします

でも

g++ main.o -o -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system

ではない

「/usr/bin/ld: 出力ファイルを開けません -L/home/hassan/Development/sfml/: そのようなファイルまたはディレクトリはありません」

ありがとうございました

4

1 に答える 1

1

「man g ++」から:

   -o file
      Place output in file file.  This applies regardless to whatever
      sort of output is being produced, whether it be an executable file,
      an object file, an assembler file or preprocessed C code. (...)

g++ の -o オプションは、パラメーターとして出力ファイルを想定しています。だからラインで

g++ main.o -o -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system

実行可能ファイルを「-L/home/hassan/Development/sfml/lib」というファイルに入れるように指示していますが、これはあまり意味がありません。試す

g++ main.o -o sfml-app -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system
于 2012-10-15T09:14:12.670 に答える