WindowsでMongooseから含まれているhello.cの例をコンパイルしようとしています。Microsoft Visual コマンド プロンプトを使用しており、mongoose.c と mongoose.h を hello.c の例と同じディレクトリにコピーしました。
「cl hello.c」と書くと、次の出力/エラーが表示されます。
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
hello.c
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:hello.exe
hello.obj
hello.obj : error LNK2019: unresolved external symbol _mg_stop referenced in function _main
hello.obj : error LNK2019: unresolved external symbol _mg_start referenced in function _main
hello.obj : error LNK2019: unresolved external symbol _mg_printf referenced in function _begin_request_handler
hello.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _begin_request_handler
hello.obj : error LNK2019: unresolved external symbol _mg_get_request_info referenced in function _begin_request_handler
hello.exe : fatal error LNK1120: 5 unresolved externals
サンプルにはMakefileが含まれており、その Makefile を使用してビルドを実行しようとしましたが、その方法がわかりません。「nmake hello.exe」を試してみると。次の出力/エラーが表示されます。
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl -W -Wall -I.. -pthread -g hello.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line error D8004 : '/W' requires an argument
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
EDITユーザーマニュアル の指示に従ってコンパイルしようとしましたが、Windowsでは「cl hello.c mongoose.c -o hello.exe」に変換されますが、次のエラーメッセージが表示されます。
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
hello.c
mongoose.c
Generating Code...
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:hello.exe
/out:hello.exe
hello.obj
mongoose.obj
hello.obj : error LNK2019: unresolved external symbol _snprintf referenced in function _begin_request_handler
hello.exe : fatal error LNK1120: 1 unresolved externals
Windows で Mongoose の hello.c の例をコンパイルするために必要な手順について、誰か提案はありますか?