SDK Question Setting Up Visual Studio - Newbie building errors with sample projects

Satamanster

New member
Joined
Jun 11, 2021
Messages
2
Reaction score
1
Points
3
Location
Lisbon
Hi everyone, so I'm new to programming but I've been using orbiter for a while and made up my mind on messing around with the sample projects from the sdk to see if I could start learning something.

For the sake of troubleshooting I'm using Orbiter2016 and Visual Studio 2022.
So I installed both software and followed the instructions detailed on this page.


However, when getting to the point of actually building the solution a bunch of errors started popping up and since I'm new to both c++ and visual studio i have no idea how to solve them.

Note: The one thing I did different from the page i mentioned is that my OrbiterDir is actually c:\Orbiter2016
Also I note that for some reason he mentions that the CustomMFD should be on the root of the sdk and doesn't mention the samples folder, but I'm gessing that's not the issue. I have no idea what I'm doing.

Houston, we have a problem:


Code:
Build started...
1>------ Build started: Project: CustomMFD, Configuration: Debug Win32 ------
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(1374,5): warning MSB8012: TargetPath(C:\Orbiter2016\Orbitersdk\samples\CustomMFD\Debug\CustomMFD.dll) does not match the Linker's OutputFile property value (c:\Orbiter2016\Modules\Plugin\CustomMFD.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>   Creating library C:\Orbiter2016\Orbitersdk\samples\CustomMFD\Debug\CustomMFD.lib and object C:\Orbiter2016\Orbitersdk\samples\CustomMFD\Debug\CustomMFD.exp
1>CustomMFD.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced in function "public: static int __cdecl AscentMFD::MsgProc(unsigned int,unsigned int,unsigned int,long)" (?MsgProc@AscentMFD@@SAHIIIJ@Z)
1>CustomMFD.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z) referenced in function __unwindfunclet$?MsgProc@AscentMFD@@SAHIIIJ@Z$0
1>CustomMFD.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) referenced in function "public: __thiscall AscentMFD::AscentMFD(unsigned long,unsigned long,class VESSEL *)" (??0AscentMFD@@QAE@KKPAVVESSEL@@@Z)
1>CustomMFD.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) referenced in function "public: virtual __thiscall AscentMFD::~AscentMFD(void)" (??1AscentMFD@@UAE@XZ)
1>CustomMFD.obj : error LNK2019: unresolved external symbol _memset referenced in function _InitModule
1>CustomMFD.obj : error LNK2019: unresolved external symbol _strcpy referenced in function "public: virtual void __thiscall AscentMFD::WriteStatus(void *)const " (?WriteStatus@AscentMFD@@UBEXPAX@Z)
1>CustomMFD.obj : error LNK2019: unresolved external symbol __strnicmp referenced in function "public: virtual void __thiscall AscentMFD::ReadStatus(void *)" (?ReadStatus@AscentMFD@@UAEXPAX@Z)
1>CustomMFD.obj : error LNK2019: unresolved external symbol ___stdio_common_vsprintf referenced in function __vsnprintf_l
1>CustomMFD.obj : error LNK2019: unresolved external symbol ___stdio_common_vsscanf referenced in function __vsscanf_l
1>CustomMFD.obj : error LNK2019: unresolved external symbol _sqrt referenced in function "private: void __thiscall AscentMFD::InitReferences(void)" (?InitReferences@AscentMFD@@AAEXXZ)
1>CustomMFD.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function "public: virtual char * __thiscall AscentMFD::ButtonLabel(int)" (?ButtonLabel@AscentMFD@@UAEPADH@Z)
1>CustomMFD.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "void __cdecl calldummy(void)" (?calldummy@@YAXXZ)
1>CustomMFD.obj : error LNK2001: unresolved external symbol __RTC_InitBase
1>CustomMFD.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>CustomMFD.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$??0AscentMFD@@QAE@KKPAVVESSEL@@@Z$0
1>CustomMFD.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
1>CustomMFD.obj : error LNK2001: unresolved external symbol __fltused
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
1>LINK : error LNK2001: unresolved external symbol __load_config_used
1>c:\Orbiter2016\Modules\Plugin\CustomMFD.dll : fatal error LNK1120: 19 unresolved externals
1>Done building project "CustomMFD.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 9:14 PM and took 01.883 seconds ==========


Any people with enough patience to tell me why am I failing even before I'm even starting? Thanks for the help in advance and comprehension to this newbie!
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,055
Reaction score
499
Points
83
On a (very short and) quick look, it might be that you forgot to set the "Library Directories" to point to \OrbiterSdk\lib.
The errors are from the LINKER (an error linke LNK2019 points to that).

From the "Setting up the Orbiter 2016 SDK in Visual Studio 2019" page:
[...]
Select “VC++ Directories”. Change the “Include Directories” and “Library Directories” settings as shown in the screenshow below. This will ensure that the compiler can find the Orbiter SDK header files and libraries.


Visual Studio VC++ Directories
 
Top