.dll Question Compiling a vessel Addon in VS 2010

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
Forgive my complete newbiness but could someone please walk me through the process of creating and compiling a .dll file for a custom vessel in Visual Studio 2010?

I am familiar with VBasic and creating vessels using SC3 or multi-stage but this is my first venture into creating my own code. I've followed the tutorials on orbiter wiki along with those bundled by Microsoft but when I select "build solution" I get the following errors.

Code:
1>------ Build started: Project: CaterpillarOUV, Configuration: Debug Win32 ------
1>     Creating library c:\users\hlynkacg\documents\visual studio 2010\Projects\CaterpillarOUV\Debug\CaterpillarOUV.lib and object c:\users\hlynkacg\documents\visual studio 2010\Projects\CaterpillarOUV\Debug\CaterpillarOUV.exp
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "void __cdecl dummy(void)" (?dummy@@YAXXZ) referenced in function "void __cdecl calldummy(void)" (?calldummy@@YAXXZ)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall VESSEL3::VESSEL3(void *,int)" (__imp_??0VESSEL3@@QAE@PAXH@Z) referenced in function "public: __thiscall ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QAE@PAXH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSaveState(void *)" (?clbkSaveState@VESSEL2@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@VESSEL2@@UAEXPAX0@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkSetStateEx(void const *)" (?clbkSetStateEx@VESSEL2@@UAEXPBX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPostCreation(void)" (?clbkPostCreation@VESSEL2@@UAEXXZ)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkFocusChanged(bool,void *,void *)" (?clbkFocusChanged@VESSEL2@@UAEX_NPAX1@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPreStep(double,double,double)" (?clbkPreStep@VESSEL2@@UAEXNNN@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkPostStep(double,double,double)" (?clbkPostStep@VESSEL2@@UAEXNNN@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPlaybackEvent(double,double,char const *,char const *)" (?clbkPlaybackEvent@VESSEL2@@UAE_NNNPBD0@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkVisualCreated(void *,int)" (?clbkVisualCreated@VESSEL2@@UAEXPAXH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkVisualDestroyed(void *,int)" (?clbkVisualDestroyed@VESSEL2@@UAEXPAXH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkDrawHUD(int,struct HUDPAINTSPEC const *,struct HDC__ *)" (?clbkDrawHUD@VESSEL2@@UAEXHPBUHUDPAINTSPEC@@PAUHDC__@@@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkRCSMode(int)" (?clbkRCSMode@VESSEL2@@UAEXH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkADCtrlMode(unsigned long)" (?clbkADCtrlMode@VESSEL2@@UAEXK@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkHUDMode(int)" (?clbkHUDMode@VESSEL2@@UAEXH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkMFDMode(int,int)" (?clbkMFDMode@VESSEL2@@UAEXHH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkNavMode(int,bool)" (?clbkNavMode@VESSEL2@@UAEXH_N@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkDockEvent(int,void *)" (?clbkDockEvent@VESSEL2@@UAEXHPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL2::clbkAnimate(double)" (?clbkAnimate@VESSEL2@@UAEXN@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall VESSEL2::clbkConsumeDirectKey(char *)" (?clbkConsumeDirectKey@VESSEL2@@UAEHPAD@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall VESSEL2::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@VESSEL2@@UAEHK_NPAD@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadGenericCockpit(void)" (?clbkLoadGenericCockpit@VESSEL2@@UAE_NXZ)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadPanel(int)" (?clbkLoadPanel@VESSEL2@@UAE_NH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPanelMouseEvent(int,int,int,int)" (?clbkPanelMouseEvent@VESSEL2@@UAE_NHHHH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkPanelRedrawEvent(int,int,void *)" (?clbkPanelRedrawEvent@VESSEL2@@UAE_NHHPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkLoadVC(int)" (?clbkLoadVC@VESSEL2@@UAE_NH@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkVCMouseEvent(int,int,union VECTOR3 &)" (?clbkVCMouseEvent@VESSEL2@@UAE_NHHAATVECTOR3@@@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL2::clbkVCRedrawEvent(int,int,void *)" (?clbkVCRedrawEvent@VESSEL2@@UAE_NHHPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL3::clbkPanelMouseEvent(int,int,int,int,void *)" (?clbkPanelMouseEvent@VESSEL3@@UAE_NHHHHPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL3::clbkPanelRedrawEvent(int,int,void *,void *)" (?clbkPanelRedrawEvent@VESSEL3@@UAE_NHHPAX0@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall VESSEL3::clbkGeneric(int,int,void *)" (?clbkGeneric@VESSEL3@@UAEHHHPAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL3::clbkLoadPanel2D(int,void *,unsigned long,unsigned long)" (?clbkLoadPanel2D@VESSEL3@@UAE_NHPAXKK@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall VESSEL3::clbkDrawHUD(int,struct HUDPAINTSPEC const *,class oapi::Sketchpad *)" (?clbkDrawHUD@VESSEL3@@UAE_NHPBUHUDPAINTSPEC@@PAVSketchpad@oapi@@@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL3::clbkRenderHUD(int,struct HUDPAINTSPEC const *,void *)" (?clbkRenderHUD@VESSEL3@@UAEXHPBUHUDPAINTSPEC@@PAX@Z)
1>CaterpillarOUV.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VESSEL3::clbkGetRadiationForce(union VECTOR3 const &,union VECTOR3 &,union VECTOR3 &)" (?clbkGetRadiationForce@VESSEL3@@UAEXABTVECTOR3@@AAT2@1@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall VESSEL::AddMesh(char const *,union VECTOR3 const *)const " (__imp_?AddMesh@VESSEL@@QBEIPBDPBTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetCameraOffset(union VECTOR3 const &)const " (__imp_?SetCameraOffset@VESSEL@@QBEXABTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::AddExhaustStream(void *,union VECTOR3 const &,struct PARTICLESTREAMSPEC *)const " (__imp_?AddExhaustStream@VESSEL@@QBEPAXPAXABTVECTOR3@@PAUPARTICLESTREAMSPEC@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall VESSEL::AddExhaust(void *,double,double,union VECTOR3 const &,union VECTOR3 const &,void *)const " (__imp_?AddExhaust@VESSEL@@QBEIPAXNNABTVECTOR3@@10@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::CreateThrusterGroup(void * *,int,enum THGROUP_TYPE)const " (__imp_?CreateThrusterGroup@VESSEL@@QBEPAXPAPAXHW4THGROUP_TYPE@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::CreateThruster(union VECTOR3 const &,union VECTOR3 const &,double,void *,double,double,double)const " (__imp_?CreateThruster@VESSEL@@QBEPAXABTVECTOR3@@0NPAXNNN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::CreatePropellantResource(double,double,double)const " (__imp_?CreatePropellantResource@VESSEL@@QBEPAXNNN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::CreateControlSurface(enum AIRCTRL_TYPE,double,double,union VECTOR3 const &,int,unsigned int)const " (__imp_?CreateControlSurface@VESSEL@@QBEXW4AIRCTRL_TYPE@@NNABTVECTOR3@@HI@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::AddAnimationComponent(unsigned int,double,double,class MGROUP_TRANSFORM *,void *)const " (__imp_?AddAnimationComponent@VESSEL@@QBEPAXINNPAVMGROUP_TRANSFORM@@PAX@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall VESSEL::CreateAnimation(double)const " (__imp_?CreateAnimation@VESSEL@@QBEIN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void * __thiscall VESSEL::CreateAirfoil3(enum AIRFOIL_ORIENTATION,union VECTOR3 const &,void (__cdecl*)(class VESSEL *,double,double,double,void *,double *,double *,double *),void *,double,double,double)const " (__imp_?CreateAirfoil3@VESSEL@@QBEPAXW4AIRFOIL_ORIENTATION@@ABTVECTOR3@@P6AXPAV1@NNNPAXPAN44@Z3NNN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetDockParams(union VECTOR3 const &,union VECTOR3 const &,union VECTOR3 const &)const " (__imp_?SetDockParams@VESSEL@@QBEXABTVECTOR3@@00@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetTouchdownPoints(union VECTOR3 const &,union VECTOR3 const &,union VECTOR3 const &)const " (__imp_?SetTouchdownPoints@VESSEL@@QBEXABTVECTOR3@@00@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetRotDrag(union VECTOR3 const &)const " (__imp_?SetRotDrag@VESSEL@@QBEXABTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetCrossSections(union VECTOR3 const &)const " (__imp_?SetCrossSections@VESSEL@@QBEXABTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetPMI(union VECTOR3 const &)const " (__imp_?SetPMI@VESSEL@@QBEXABTVECTOR3@@@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetEmptyMass(double)const " (__imp_?SetEmptyMass@VESSEL@@QBEXN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall VESSEL::SetSize(double)const " (__imp_?SetSize@VESSEL@@QBEXN@Z) referenced in function "public: virtual void __thiscall ShuttlePB::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttlePB@@UAEXPAX@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) double __cdecl oapiGetWaveDrag(double,double,double,double,double)" (__imp_?oapiGetWaveDrag@@YANNNNNN@Z) referenced in function "private: static void __cdecl ShuttlePB::vlift(class VESSEL *,double,double,double,void *,double *,double *,double *)" (?vlift@ShuttlePB@@CAXPAVVESSEL@@NNNPAXPAN22@Z)
1>CaterpillarOUV.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) double __cdecl oapiGetInducedDrag(double,double,double)" (__imp_?oapiGetInducedDrag@@YANNNN@Z) referenced in function "private: static void __cdecl ShuttlePB::vlift(class VESSEL *,double,double,double,void *,double *,double *,double *)" (?vlift@ShuttlePB@@CAXPAVVESSEL@@NNNPAXPAN22@Z)
1>c:\users\hlynkacg\documents\visual studio 2010\Projects\CaterpillarOUV\Debug\CaterpillarOUV.dll : fatal error LNK1120: 56 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Obviously I'm missing a declaration of some sort but when I run a search in the code for undeclared variables the OrbiterSDK headers all show up as being properly linked.

Please help.

:hailprobe:
 

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,421
Reaction score
1
Points
0
Location
Moscow
In Linker options, add Orbitersdk.lib and orbiter.lib to Additional libraries, also add paths to Orbitersdk\lib catalogue. Orb would recommend you to use property templates shipped with Orbiter, though...

Since compilation went OK in your case, I assume your include paths were correct.
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
In Linker options, add Orbitersdk.lib and orbiter.lib to Additional libraries, also add paths to Orbitersdk\lib catalogue. Orb would recommend you to use property templates shipped with Orbiter, though...

Since compilation went OK in your case, I assume your include paths were correct.

how do I do this?
 

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,421
Reaction score
1
Points
0
Location
Moscow
Talking from memory:
Project properties: Linker - Input - Additional libraries and Linker - Advanced - Library search paths (posting from a VS-less computer now, so it is give or take a few extra words I misremembered).
 

IronRain

The One and Only (AFAIK)
Administrator
Moderator
News Reporter
Donator
Joined
Oct 11, 2009
Messages
3,484
Reaction score
403
Points
123
Location
Utrecht
Website
www.spaceflightnewsapi.net
Where do you see Visual Basic? They're talking about VS: Visual Studio (a program to write C++)
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
I know visual Basic but this is my first foray into C/C++ beyond the traditional "A+B=C and Hello World" training programs.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,290
Reaction score
3,258
Points
203
Location
Toulouse
Here's the vid that learned me the very basics (again, without a single computer science lesson in my life), this is an absolute must see :


All the computerex tutorials are excellent, clear and with only useful stuff. :thumbup:
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
Success! I've got a functional DLL!

Edit:
Thank you all for the help, and Hail Probe!
:hailprobe:
 
Last edited:
Top