Beef
Beef copied to clipboard
Unresolved external symbol errors while linking project
This issue seems related to #2123, but this time I'm getting linker errors when I try to compile the project.
Here's a sample of the errors:
LuaTinker__.lib(LuaTinker_StackHelpers_StackHelper@LuaTinker_Tests.obj) : error LNK2019: unresolved external symbol "public: static int bf::LuaTinker::Tests::TestMemVar::Actor::sBfTypeData" (?sBfTypeData@Actor@TestMemVar@Tests@LuaTinker@bf@@2HA) referenced in function "private: static void __cdecl bf::LuaTinker::StackHelpers::StackHelper::GetBestLuaClassName<struct bf::LuaTinker::Tests::TestMemVar::Actor>(class bf::LuaTinker::LuaTinkerState *,class LuaTinker::System::String *)" (??$GetBestLuaClassName@UActor@TestMemVar@Tests@LuaTinker@bf@@@StackHelper@StackHelpers@LuaTinker@bf@@CAXPEAVLuaTinkerState@LuaTinker@bf@@PEAVString@System@2@@Z)
LuaTinker__.lib(LuaTinker_Wrappers_ValuePointerWrapper_LuaTinker_Tests_TestMemVar_Actor.obj) : error LNK2001: unresolved external symbol "public: static int bf::LuaTinker::Tests::TestMemVar::Actor::sBfTypeData" (?sBfTypeData@Actor@TestMemVar@Tests@LuaTinker@bf@@2HA)
LuaTinker__.lib(LuaTinker_StackHelpers_StackHelper@LuaTinker_Tests.obj) : error LNK2019: unresolved external symbol "public: static int bf::LuaTinker::Tests::TestClassInheritance::My2BaseBaseTest::sBfTypeData" (?sBfTypeData@My2BaseBaseTest@TestClassInheritance@Tests@LuaTinker@bf@@2HA) referenced in function "private: static void __cdecl bf::LuaTinker::StackHelpers::StackHelper::GetBestLuaClassName<class bf::LuaTinker::Tests::TestClassInheritance::My2BaseBaseTest *>(class bf::LuaTinker::LuaTinkerState *,class LuaTinker::System::String *)" (??$GetBestLuaClassName@PEAVMy2BaseBaseTest@TestClassInheritance@Tests@LuaTinker@bf@@@StackHelper@StackHelpers@LuaTinker@bf@@CAXPEAVLuaTinkerState@LuaTinker@bf@@PEAVString@System@2@@Z)
LuaTinker__.lib(LuaTinker_Wrappers_ClassInstanceWrapper_LuaTinker_Tests_TestClassInheritance_My2__.obj) : error LNK2001: unresolved external symbol "public: static int bf::LuaTinker::Tests::TestClassInheritance::My2BaseBaseTest::sBfTypeData" (?sBfTypeData@My2BaseBaseTest@TestClassInheritance@Tests@LuaTinker@bf@@2HA)
LuaTinker__.lib(LuaTinker_StackHelpers_StackHelper@LuaTinker_Tests.obj) : error LNK2019: unresolved external symbol "public: static int bf::LuaTinker::Tests::TestClassInheritance::My2BaseTest::sBfTypeData" (?sBfTypeData@My2BaseTest@TestClassInheritance@Tests@LuaTinker@bf@@2HA) referenced in function "private: static void __cdecl bf::LuaTinker::StackHelpers::StackHelper::GetBestLuaClassName<class bf::LuaTinker::Tests::TestClassInheritance::My2BaseTest *>(class bf::LuaTinker::LuaTinkerState *,class LuaTinker::System::String *)" (??$GetBestLuaClassName@PEAVMy2BaseTest@TestClassInheritance@Tests@LuaTinker@bf@@@StackHelper@StackHelpers@LuaTinker@bf@@CAXPEAVLuaTinkerState@LuaTinker@bf@@PEAVString@System@2@@Z)
I tried to create a minimal reproduction for this but haven't been able to isolate the issue yet. So the full project that has this problem is available here: https://github.com/disarray2077/LuaTinker-Beef/tree/linkerissue
The specific line that triggers the linker errors is here: https://github.com/disarray2077/LuaTinker-Beef/blob/b362a9fdeb21ef9e3f249264f3f33b2922cec2aa/src/StackHelpers/StackHelper.bf#L87
Commenting out that line allows the project to compile successfully.
Tested with: 9c9d29d493b06328d64b48edcb1b07d57406c2a0