Visual studio 2017 为什么pjsua构建在将Windows(/SUBSYSTEM:Windows)设置为链接器后显示错误->;Visual Studio 2017中的子系统属性

Visual studio 2017 为什么pjsua构建在将Windows(/SUBSYSTEM:Windows)设置为链接器后显示错误->;Visual Studio 2017中的子系统属性,visual-studio-2017,sdl-2,pjsua2,visual-studio-2017-build-tools,Visual Studio 2017,Sdl 2,Pjsua2,Visual Studio 2017 Build Tools,我尝试在Windows10x64上编译pjproject-2.9。我尝试了以下命令。全部运行成功 (i) /配置(ii)制作和制作安装 我正在使用Visual Studio 2017。对于建设项目,我遵循上述VS 2015文件中给出的程序: 打开pjproject-vs14.sln解决方案文件-->将pjsua设置为启动项目-->将Win32设置为平台-->选择调试或发布构建-->构建项目 在pjproject/pjlib/include/pj中创建了一个空的config_site.h文件 我在

我尝试在Windows10x64上编译pjproject-2.9。我尝试了以下命令。全部运行成功 (i) /配置(ii)制作和制作安装

我正在使用Visual Studio 2017。对于建设项目,我遵循上述VS 2015文件中给出的程序:

  • 打开pjproject-vs14.sln解决方案文件-->将pjsua设置为启动项目-->将Win32设置为平台-->选择调试或发布构建-->构建项目
  • 在pjproject/pjlib/include/pj中创建了一个空的config_site.h文件

    我在pjsua属性中做了以下更改: 1.配置属性-->常规-->Windows SDK版本10.0.18362.0 配置属性-->常规-->平台工具集Visual Studio 2017(v141) 项目默认值-->配置类型-->应用程序(.exe) 项目默认值-->使用MFC-->使用标准Windows库 项目默认值-->字符集-->使用多字节字符集 项目默认值-->公共语言运行时支持-->无公共语言运行时支持

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

  • C/C++-->常规-->(添加的SDL2包含路径)

  • 链接器-->常规-->其他库目录-->(添加了sdl2 libx86路径) 链接器-->输入-->其他依赖项-->(添加了SDL2.lib、SDL2main.lib) 链接器-->系统-->子系统-->控制台(/子系统:控制台) 链接器-->高级-->目标计算机-->未设置

  • pjsua-->生成依赖项-->项目依赖项-->选择全部

  • 当我设置链接器-->系统-->子系统-->控制台(/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?
    
    
    
    

    …@HansPassant,他们没有提到Windows(/SUBSYSTEM:Windows)错误。在该链接中,他们也没有提到Windows10支持SDL2。这就是导致这些错误的原因吗?@HansPassant我已经向SDL wiki确认sdl2支持windows 10。你对这个错误还有其他想法吗?