JSBSim-Team / jsbsim

An open source flight dynamics & control software library
GNU Lesser General Public License v2.1
1.28k stars 436 forks source link

unresolved external symbol(s) logging/console related #1115

Open jamesford42 opened 3 weeks ago

jamesford42 commented 3 weeks ago

Getting this trying to build JSBSimForUnreal.sln (master)

Error   LNK1120 5 unresolved externals  JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\UnrealEngine\Plugins\JSBSimFlightDynamicsModel\Source\ThirdParty\JSBSim\LibDebug\JSBSim.dll  1   
Error   LNK2001 unresolved external symbol "public: virtual void __cdecl JSBSim::FGLogConsole::SetLevel(enum JSBSim::LogLevel)" (?SetLevel@FGLogConsole@JSBSim@@UEAAXW4LogLevel@2@@Z)   JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\FGFDMExec.obj    1   
Error   LNK2001 unresolved external symbol "public: virtual void __cdecl JSBSim::FGLogConsole::Format(enum JSBSim::LogFormat)" (?Format@FGLogConsole@JSBSim@@UEAAXW4LogFormat@2@@Z) JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\FGFDMExec.obj    1   
Error   LNK2019 unresolved external symbol "public: class JSBSim::FGLogging & __cdecl JSBSim::FGLogging::operator<<(enum JSBSim::LogFormat)" (??6FGLogging@JSBSim@@QEAAAEAV01@W4LogFormat@1@@Z) referenced in function "public: bool __cdecl JSBSim::FGFDMExec::RunIC(void)" (?RunIC@FGFDMExec@JSBSim@@QEAA_NXZ)    JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\FGFDMExec.obj    1   
Error   LNK2019 unresolved external symbol "public: void __cdecl JSBSim::FGLogging::Flush(void)" (?Flush@FGLogging@JSBSim@@QEAAXXZ) referenced in function "public: virtual __cdecl JSBSim::FGLogging::~FGLogging(void)" (??1FGLogging@JSBSim@@UEAA@XZ) JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\FGFDMExec.obj    1   
Error   LNK2019 unresolved external symbol "public: __cdecl JSBSim::FGXMLLogging::FGXMLLogging(class std::shared_ptr<class JSBSim::FGLogger>,class JSBSim::Element *,enum JSBSim::LogLevel)" (??0FGXMLLogging@JSBSim@@QEAA@V?$shared_ptr@VFGLogger@JSBSim@@@std@@PEAVElement@1@W4LogLevel@1@@Z) referenced in function "public: bool __cdecl JSBSim::FGFDMExec::LoadPlanet(class SGPath const &,bool)" (?LoadPlanet@FGFDMExec@JSBSim@@QEAA_NAEBVSGPath@@_N@Z)   JSBSimForUnreal D:\Projects\Unreal Projects\JSBSim\FGFDMExec.obj    1   
seanmcleod commented 3 weeks ago

Take a look at - https://github.com/JSBSim-Team/jsbsim/discussions/1109

jamesford42 commented 3 weeks ago

Yea i found the .cpp file where those methods were defined, it was not included in the solution. Please automate this so the the cmake and .sln don't keep getting out of sync. Id recommend using wildcards.

seanmcleod commented 3 weeks ago

The original commit added a reference to FGLog.cpp in JSBSim.vcxproj but not to JSBSimForUnreal.vcxproj, added it in commit - https://github.com/JSBSim-Team/jsbsim/pull/1111/commits/ca8d4a5db21edc23a67ddd62b5876d18b8e26512

seanmcleod commented 3 weeks ago

Hmm, wildcards in .vcxproj files are a bit of an issue - https://learn.microsoft.com/en-us/cpp/build/reference/vcxproj-files-and-wildcards?view=msvc-170

jamesford42 commented 3 weeks ago

Doh, guess i conflated it with .csproj(s) which i have more experience with.