我是 C++ 的新手。我想在我的 C++ 项目中使用 lacewing-project.org。我阅读了有关如何构建它的文档,并使用DLL - Release
和Static Library - Release
配置成功地完成了它。
现在我不知道如何在我的项目中使用它以及如何设置和配置我的项目?我正在关注本教程,但由于最新 Visual Studio 中缺少选项而被卡在中间。我在 Windows 8 上使用 Visual C++ Expression Ed., 2012
我用谷歌搜索并做了以下事情:
- 在我的项目中添加了 lib 文件和 lacewing.h 文件。
- 在 Visual C++ 项目属性下,在链接器文件夹 -> 输入中,我将 lib 文件添加为附加依赖项。
我将 dll 放在 Windows\System32 文件夹中。除了将它放在 win32 文件夹中之外,我还需要对 dll 做任何事情吗?
我的代码来自文档中给出的hello world 示例。
当我尝试编译时,我得到:
1>------ Build started: Project: test, Configuration: Debug Win32 ------
1> Source.cpp
1>Source.obj : error LNK2019: unresolved external symbol __imp__lw_version referenced in function "void __cdecl on_get(struct lacewing::_webserver *,struct lacewing::_webserver_request *)" (?on_get@@YAXPAU_webserver@lacewing@@PAU_webserver_request@2@@Z)
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl lacewing::pump_delete(struct lacewing::_pump *)" (__imp_?pump_delete@lacewing@@YAXPAU_pump@1@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct lacewing::_error * __thiscall lacewing::_eventpump::start_eventloop(void)" (__imp_?start_eventloop@_eventpump@lacewing@@QAEPAU_error@2@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct lacewing::_eventpump * __cdecl lacewing::eventpump_new(void)" (__imp_?eventpump_new@lacewing@@YAPAU_eventpump@1@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl lacewing::_stream::writef(char const *,...)" (__imp_?writef@_stream@lacewing@@QAAXPBDZZ) referenced in function "void __cdecl on_get(struct lacewing::_webserver *,struct lacewing::_webserver_request *)" (?on_get@@YAXPAU_webserver@lacewing@@PAU_webserver_request@2@@Z)
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall lacewing::_webserver::host(long)" (__imp_?host@_webserver@lacewing@@QAEXJ@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall lacewing::_webserver::on_get(void (__cdecl*)(struct lacewing::_webserver *,struct lacewing::_webserver_request *))" (__imp_?on_get@_webserver@lacewing@@QAEXP6AXPAU12@PAU_webserver_request@2@@Z@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct lacewing::_webserver * __cdecl lacewing::webserver_new(struct lacewing::_pump *)" (__imp_?webserver_new@lacewing@@YAPAU_webserver@1@PAU_pump@1@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl lacewing::webserver_delete(struct lacewing::_webserver *)" (__imp_?webserver_delete@lacewing@@YAXPAU_webserver@1@@Z) referenced in function _main
1>C:\Users\Jayarathina\Desktop\New folder (3)\test\Debug\test.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
请帮忙...