https://github.com/shogun-toolbox/shogun/wiki/README_developerの shogun 開発者ページにある gaussian カーネル テストをコンパイルしようとすると、このエラーが発生します。https://github.com/shogun-toolbox/shogun/wiki/INSTALLで shogun ライブラリ
を作成するために、指示に従いました。
次に、共有オブジェクト ライブラリを含むその上のディレクトリに移動し、注文を発行したところ、この投稿のトピックであるエラーが表示されました。
ネット上にリンクされているスレッド(2リンク制限)をたどったのですが、解決策が見つかりませんでした。
誰でもこれを解決する方法を知っていますか?.so
"g++ GTest.cpp shogun/libshogun.so -o a.out"
1 に答える
0
you shouldn't try to link directly the shared library with your example.
Say you created a shogun based example file, let's call it shogun_example.cpp
, in order to compile this you should run:
g++ shogun_example.cpp -o shogun_example -lshogun
this is in case the libshogun.so
is in the search path of the linker.
If the compiled libshogun.so
is not in the search path then you should provide the location of the shared library to the compiler with -L
, for example:
g++ shogun_example.cpp -o shogun_example -L<path to the shogun shard lib> -lshogun
于 2016-07-24T15:07:18.903 に答える