0

私の学士論文では、大きな整数を因数分解する(素因数分解を見つける)ためのアルゴリズムの分散バージョンを実装しています。これには、RSA暗号システムのセキュリティなどのアプリケーションがあります。

私のビジョンは、クライアント(LinuxまたはWindows)がアプリケーションをダウンロードし、いくつかの数値を計算することです(これらは独立しているため、並列化に適しています)。番号(あまり頻繁には見つかりません)は、これらの番号を収集するためにマスターサーバーに送信されます。マスターサーバーによって十分な数が収集されると、残りの計算が実行されますが、これは簡単に並列化することはできません。

とにかく、技術に。クライアントがマスターサーバーと通信するために、Boost::Asioを使用してソケットクライアント/サーバーの実装を行うことを考えていました。LinuxとWindowsの両方でコンパイルしたいので、Windowsはどこからでも始めるのに適した場所だと思いました。そこで、 BoostのGetting Startedページに記載されているように、Boostライブラリをダウンロードしてコンパイルしました。

ブートストラップ

。\bjam

それはすべてうまくコンパイルされました。次に、チュートリアルの例の1つであるAsioのclient.cppをコンパイルしてみます(ここで..編集:制限のためにリンクを投稿できません)。私は次のように、Microsoft VisualStudio2008のVisualC++コンパイラを使用しています。

cl / EHsc / ID:\ Downloads \ boost_1_42_0 client.cpp

しかし、私はこのエラーを受け取ります:

/out:client.exe

client.obj

リンク:致命的なエラーLNK1104:ファイルを開くことができません'libboost_system-vc90-mt-s-1_42.lib'

誰かが何が間違っている可能性があるのか​​、または私がどのように前進できるのかについて何か考えがありますか?私は、c ++用の単純なクライアント/サーバーソケットプログラムを動作させるために、ほぼ1週間努力してきましたが、運がありませんでした。深刻な欲求不満が始まります。

前もって感謝します。

4

1 に答える 1

2

The reason the build is failing is because it cannot find the library file containing boost system. Boost includes a "handy" autolinking feature, such that when you include a header file for a binary libaray (as opposed to a header only library), boost automatically tells the compiler that it should link in the library. The downside to this is that boost doesn't tell the compiler where to find the library.

The short answer is to read a little further in the boost getting started guide. This page shows you how to add the necessary flags to the compiler command line: Getting started on windows: linking from the command line.

The first thing you have to do is find the .lib file. Boost hides them in a deep directory structure, so search for it starting in the directory you ran bjam from. Make note of the directory where the file is. You may also wish to use bootstrap --prefix=/some/install/location and bjam install to install boost somewhere other than the source directory in which you built it.

Are you building your project using a Visual Studio solution, or on the command line?

If you are using a solution file, find the link page in the solution properties. There should be a box where you can enter additional library paths. Add the directory in which you boost .lib files reside to this box.

If you are using cl on the command link, familiarize yourself with the command line options for cl and link. You can pass commands to the linker using the cl option /link, and the linker command you are looking for is /libpath.

于 2010-04-10T14:53:57.633 に答える