問題
私はmingwを使用してWindows上でwebsocketppを使って簡単なサーバーアプリケーションを作っています。コンパイルとリンクが正常に完了しました。しかし、私はアプリを起動したとき、それは私に次のエラー・ウィンドウを与える:Mingw、boost、およびruntime "プロシージャのエントリポイントが見つかりませんでした"
The procedure entry point _ZNSt6chrono3_V212steady_clock3nowEv could not be located in the DLL D:\work\wild_web\a.exe
マイセットアップ
は、ここで私は、コンパイルと私のコードをリンクする方法は次のとおりです。
g++ -std=c++11 -march=i686 d:/work/wild_web/main.cpp -o a.exe -ID:/work/libs/boost_1_61_0 -ID:/work/websocketpp-master/websocketpp-master -LD:/work/libs/boost_1_61_0/stage/lib -lboost_system-mgw49-mt-s-1_61 -lws2_32 -lwsock32 -lboost_chrono-mgw49-mt-s-1_61
Compilation finished at Sun Jul 24 16:48:09
そして、これは私が構築する方法ですブースト:
b2 --build-dir=build-directory toolset=gcc --build-type=complete stage
main.cppに:
#define _WIN32_WINNT 0x0501
#include <iostream>
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <boost/chrono.hpp>
#include <string>
#include <sstream>
#include <vector>
#include <map>
//bunch of structs
int main() {
//working with websocketpp
return 0;
}
私は、問題が#dllのインターフェイスの変更を引き起こす可能性がある最初のローの#defineにあると感じています。しかし、私はそれを削除した場合、コードはコンパイルされません。
error: '::VerSetConditionMask' has not been declared
const uint64_t condition_mask = ::VerSetConditionMask(
質問
- をの#define _WIN32_WINNTのて0x0501はブーストライブラリの使用を台無しですか?
- ブーストに正しくリンクしていますか?
- 1と2の答えが肯定的な場合、私はこの作業をするために何をしますか?
'0x0501'は' Windows XP'です。 'XP'で実行する必要がありますか? '_WIN32_WINNT'を' boost:asio'のために設定する必要があります。私は、 '_WIN32_WINNT _WIN32_WINNT_WIN7'(0x0601)と' NTDDI_VERSION NTDDI_WIN7'が 'Windows 10 'で' mingw'を使ってうまく動くことが分かりました。 – kenba
私はWindows 8です。 '#define _WIN32_WINNT 0x0602'と' #define NTDDI_VERSION NTDDI_WIN8'を試しましたが、残念ながら助けにはなりませんでした。 –