KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.95k stars 819 forks source link

Cannot link to the released binaries. #3408

Closed xzores closed 9 months ago

xzores commented 9 months ago

On windows I get the following errors when I try to link to the release binaries.

I link to the C interface by including "glslang_c_interface.h", "glslang_c_shader_types.h", "ResourceLimits.h"(inside include) and "resource_limits_c.h" in my build. I also add the binaries "glslang.lib", "GenericCodeGen.lib", "glslang-default-resource-limits.lib" and "MachineIndependent.lib" to my project. These errors seem to be internal functions to glslang, and they seem to be in C++. How in the world is this supposed to work? I don't see anything mentioning any dependencies that would resolve this.

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4217: symbol '_invalid_parameter_noinfo_noreturn' defined in 'libucrt.lib(invalid_parameter.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"void * __cdecl std::_Allocate_manually_vector_aligned<struct std::_Default_allocate_traits>(unsigned __int64)" (??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z)'
LINK : warning LNK4217: symbol '_invoke_watson' defined in 'libucrt.lib(invalid_parameter.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"protected: virtual void __cdecl stdext::bad_alloc::_Doraise(void)const " (?_Doraise@bad_alloc@stdext@@MEBAXXZ)'
LINK : warning LNK4217: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"class std::codecvt<char,char,struct _Mbstatet> const & __cdecl std::use_facet<class std::codecvt<char,char,struct _Mbstatet> >(class std::locale const &)" (??$use_facet@V?$codecvt@DDU_Mbstatet@@@std@@@std@@YAAEBV?$codecvt@DDU_Mbstatet@@@0@AEBVlocale@0@@Z)'
LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function 'printf'
LINK : warning LNK4217: symbol '_get_stream_buffer_pointers' defined in 'libucrt.lib(_file.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"protected: virtual struct glslang::TShader::Includer::IncludeResult * __cdecl DirStackFileIncluder::readLocalPath(char const *,char const *,int)" (?readLocalPath@DirStackFileIncluder@@MEAAPEAUIncludeResult@Includer@TShader@glslang@@PEBD0H@Z)'
LINK : warning LNK4217: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"public: virtual __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::~basic_filebuf<char,struct std::char_traits<char> >(void)" (??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ)'
LINK : warning LNK4217: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"protected: virtual int __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::sync(void)" (?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ)'
LINK : warning LNK4217: symbol 'fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"protected: virtual int __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::overflow(int)" (?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z)'
LINK : warning LNK4217: symbol '_lock_file' defined in 'libucrt.lib(_file.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"public: virtual void __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAAXXZ)'
LINK : warning LNK4217: symbol '_unlock_file' defined in 'libucrt.lib(_file.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function '"public: virtual void __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAAXXZ)'
LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'glslang.lib(glslang_c_interface.obj)' in function 'printf'
Tests.obj : error LNK2019: unresolved external symbol glslang_default_resource referenced in function fmt.fmt_bool
Tests.obj : error LNK2019: unresolved external symbol glslang_program_SPIRV_generate referenced in function fmt.fmt_bool
Tests.obj : error LNK2019: unresolved external symbol glslang_program_SPIRV_get_size referenced in function fmt.fmt_bool
Tests.obj : error LNK2019: unresolved external symbol glslang_program_SPIRV_get referenced in function fmt.fmt_bool
Tests.obj : error LNK2019: unresolved external symbol glslang_program_SPIRV_get_messages referenced in function fmt.fmt_bool
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_fgetc referenced in function "protected: virtual int __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::uflow(void)" (?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_fgetpos referenced in function "protected: virtual class std::fpos<struct _Mbstatet> __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(__int64,int,int)" (?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@U_Mbstatet@@@2@_JHH@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_fread referenced in function "protected: virtual __int64 __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::xsgetn(char *,__int64)" (?xsgetn@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_fsetpos referenced in function "protected: virtual class std::fpos<struct _Mbstatet> __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::seekpos(class std::fpos<struct _Mbstatet>,int)" (?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@U_Mbstatet@@@2@V32@H@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp__fseeki64 referenced in function "protected: virtual class std::fpos<struct _Mbstatet> __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::seekoff(__int64,int,int)" (?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@U_Mbstatet@@@2@_JHH@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_fwrite referenced in function "protected: bool __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::_Endwrite(void)" (?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_setvbuf referenced in function "protected: virtual class std::basic_streambuf<char,struct std::char_traits<char> > * __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::setbuf(char *,__int64)" (?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol __imp_ungetc referenced in function "protected: virtual int __cdecl std::basic_filebuf<char,struct std::char_traits<char> >::pbackfail(int)" (?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z)
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "bool __cdecl glslang::InitializeProcess(void)" (?InitializeProcess@glslang@@YA_NXZ) referenced in function glslang_initialize_process
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "void __cdecl glslang::FinalizeProcess(void)" (?FinalizeProcess@glslang@@YAXXZ) referenced in function glslang_finalize_process
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: __cdecl glslang::TShader::TShader(enum EShLanguage)" (??0TShader@glslang@@QEAA@W4EShLanguage@@@Z) referenced in function glslang_shader_create
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setStrings(char const * const *,int)" (?setStrings@TShader@glslang@@QEAAXPEBQEBDH@Z) referenced in function glslang_shader_create
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setOverrideVersion(int)" (?setOverrideVersion@TShader@glslang@@QEAAXH@Z) referenced in function glslang_shader_set_glsl_version
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setShiftBinding(enum glslang::TResourceType,unsigned int)" (?setShiftBinding@TShader@glslang@@QEAAXW4TResourceType@2@I@Z) referenced in function glslang_shader_shift_binding
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setShiftBindingForSet(enum glslang::TResourceType,unsigned int,unsigned int)" (?setShiftBindingForSet@TShader@glslang@@QEAAXW4TResourceType@2@II@Z) referenced in function glslang_shader_shift_binding_for_set
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setAutoMapBindings(bool)" (?setAutoMapBindings@TShader@glslang@@QEAAX_N@Z) referenced in function glslang_shader_set_options
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: void __cdecl glslang::TShader::setAutoMapLocations(bool)" (?setAutoMapLocations@TShader@glslang@@QEAAX_N@Z) referenced in function glslang_shader_set_options
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl glslang::TShader::parse(struct TBuiltInResource const *,int,enum EProfile,bool,bool,enum EShMessages,class glslang::TShader::Includer &)" (?parse@TShader@glslang@@QEAA_NPEBUTBuiltInResource@@HW4EProfile@@_N2W4EShMessages@@AEAVIncluder@12@@Z) referenced in function glslang_shader_parse
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl glslang::TShader::preprocess(struct TBuiltInResource const *,int,enum EProfile,bool,bool,enum EShMessages,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,class glslang::TShader::Includer &)" (?preprocess@TShader@glslang@@QEAA_NPEBUTBuiltInResource@@HW4EProfile@@_N2W4EShMessages@@PEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAVIncluder@12@@Z) referenced in function glslang_shader_preprocess
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: char const * __cdecl glslang::TShader::getInfoLog(void)" (?getInfoLog@TShader@glslang@@QEAAPEBDXZ) referenced in function glslang_shader_get_info_log
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: char const * __cdecl glslang::TShader::getInfoDebugLog(void)" (?getInfoDebugLog@TShader@glslang@@QEAAPEBDXZ) referenced in function glslang_shader_get_info_debug_log
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: __cdecl glslang::TProgram::TProgram(void)" (??0TProgram@glslang@@QEAA@XZ) referenced in function glslang_program_create
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl glslang::TProgram::link(enum EShMessages)" (?link@TProgram@glslang@@QEAA_NW4EShMessages@@@Z) referenced in function glslang_program_link
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: char const * __cdecl glslang::TProgram::getInfoLog(void)" (?getInfoLog@TProgram@glslang@@QEAAPEBDXZ) referenced in function glslang_program_get_info_log
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: char const * __cdecl glslang::TProgram::getInfoDebugLog(void)" (?getInfoDebugLog@TProgram@glslang@@QEAAPEBDXZ) referenced in function glslang_program_get_info_debug_log
glslang.lib(glslang_c_interface.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl glslang::TProgram::mapIO(class glslang::TIoMapResolver *,class glslang::TIoMapper *)" (?mapIO@TProgram@glslang@@QEAA_NPEAVTIoMapResolver@2@PEAVTIoMapper@2@@Z) referenced in function glslang_program_map_io
D:\github\Odin-glsl-lang\Tests\Tests.exe : fatal error LNK1120: 31 unresolved externals
xzores commented 9 months ago

They should be linked with /NODEFAULTLIB:libcmt