0

我尝试按照Windows 10 x64 上的文档编译 pjproject-2.9 。我尝试了以下命令。全部成功运行 (i) ./configure (ii) make && make install

我正在使用 Visual Studio 2017。为了构建项目,我遵循了上述 VS 2015 文档中给出的过程:

  1. 打开 pjproject-vs14.sln 解决方案文件 ---> 将 pjsua 设置为启动项目 ---> 将 Win32 设置为平台 ---> 选择 Debug 或 Release build ---> 构建项目。

在 pjproject/pjlib/include/pj 中创建了一个空的 config_site.h 文件

我对pjsua属性做了如下改动:1.配置属性-->通用-->Windows SDK Version 10.0.18362.0配置属性-->通用-->Platform Toolset Visual Studio 2017(v141) Project Defaults-->配置类型 --> Application(.exe) 项目默认值--> 使用 MFC --> 使用标准 Windows 库项目默认值--> 字符集 --> 使用多字节字符集项目默认值--> 公共语言运行时支持--> 没有公共语言运行时支持

  1. VC++ 目录 --> 包含目录 --> (我的 sdl2 包含路径和 python 包含路径) VC++ 目录 --> 库目录 --> (python 库路径)

  2. C/C++ --> 常规 --> (添加了 SDL2 包含路径)

  3. 链接器 --> 常规 --> 附加库目录 --> (添加了 sdl2 libx86 路径) 链接器 --> 输入 --> 附加依赖项 --> (添加了 SDL2.lib, SDL2main.lib ) 链接器 --> 系统 -- > 子系统 --> 控制台(/SUBSYSTEM:CONSOLE) 链接器 --> 高级 --> 目标机 --> 未设置

  4. pjsua --> 构建依赖项 --> 项目依赖项 --> 全选

当我设置 Linker --> System --> Subsystem --> Console(/SUBSYSTEM:CONSOLE) 时,它已成功构建。但我需要将其构建为 Windows(/SUBSYSTEM:WINDOWS) 它向我显示错误。

注意:点击此链接设置 SDL2 的属性。我还浏览了其他链接,例如 wikihow..everwhere 提到仅使用 Windows(/SUBSYSTEM:WINDOWS)。我只需要使用 Windows(/SUBSYSTEM: WINDOWS) 构建它

这些是我得到的错误:

LNK2019 unresolved external symbol _SDL_main referenced in function _main_getcmdline    pjsua   ...\pjproject-2.9\pjsip-apps\build\SDL2main.lib(SDL_windows_main.obj)   1   
LNK1120 1 unresolved externals  pjsua   ...\pjproject-2.9\pjsip-apps\bin\pjsua-i386-Win32-vc14-Release.exe  1```

Please Note: I added/changed property one by one and generated a build. To see which of these is creating the error. only after changing from CONSOLE(/SUBSYSTEM: CONSOLE) to WINDOWS(/SUBSYSTEM:WINDOWS), I got those error. 

Every time before pjsua build, i do pjsua clean. Still, I get these errors

All these error are linker related. Is there any property I have to change?



4

0 回答 0