Compiling Addons for Open Orbiter

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi All,

Coming at this late in the day.......
Have tried to search answers to these but probably putting wrong key words....

Do addons for Open Orbiter have to be specifically compiled ?

If so, I've seen several mentions of VS 2019 in connection with, does it have to be this version?

And have tried to use SDK in Open Orbiter, but get multiple errors.

Please give me a help to start with this.

:cheers:
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
I think it's hard to say definitively if add-ons need to be reconpiled against the OO libraries, because it may depend on the addon, but I would say probably.

VS2019 or VS2022 should work (I'm using 22)

What sort of errors are you getting?

Also keep in mind that the OpenOrbiter preview builds don't constitute a "long term support" release. And there will likely be more builds and updates before there is an "official" Orbiter release. Keep that in mind if you're trying to release an addon, as that could become difficult for both you and potential users of your addon. It may be more worthwhile to build it against 2016, and then when the time comes for an OO release, you can just rebuild it against the OO sdk.
 
  • Like
Reactions: JMW

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
What sort of errors are you getting?
Code:
Rebuild started...
1>------ Rebuild All started: Project: Open J-F-35B, Configuration: Release x64 ------
1>After all Warning changes - Open.cpp
.......................................

1>   Creating library .\..\..\..\Modules/ShuttlePB.lib and object .\..\..\..\Modules/ShuttlePB.exp
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl ConnectToOrbiterSoundDLL(void *)" (?ConnectToOrbiterSoundDLL@@YAHPEAX@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl RequestLoad3DWaveMono(int,int,char *,enum EXTENDEDPLAY,union VECTOR3 *)" (?RequestLoad3DWaveMono@@YAHHHPEADW4EXTENDEDPLAY@@PEATVECTOR3@@@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl Set3dWaveParameters(int,int,union VECTOR3 *,union VECTOR3 *,float *,float *,struct OS3DCONE *)" (?Set3dWaveParameters@@YAHHHPEATVECTOR3@@0PEAM1PEAUOS3DCONE@@@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl RequestLoadVesselWave(int,int,char *,enum EXTENDEDPLAY)" (?RequestLoadVesselWave@@YAHHHPEADW4EXTENDEDPLAY@@@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl PlayVesselWave(int,int,int,int,int)" (?PlayVesselWave@@YAHHHHHH@Z) referenced in function "public: virtual int __cdecl ShuttlePB::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@ShuttlePB@@UEAAHK_NPEAD@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl StopVesselWave(int,int)" (?StopVesselWave@@YAHHH@Z) referenced in function "public: virtual int __cdecl ShuttlePB::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@ShuttlePB@@UEAAHK_NPEAD@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl IsPlaying(int,int)" (?IsPlaying@@YAHHH@Z) referenced in function "public: virtual int __cdecl ShuttlePB::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@ShuttlePB@@UEAAHK_NPEAD@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl ReplaceStockSound(int,char *,int)" (?ReplaceStockSound@@YAHHPEADH@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol "int __cdecl SoundOptionOnOff(int,int,int)" (?SoundOptionOnOff@@YAHHHH@Z) referenced in function "public: __cdecl ShuttlePB::ShuttlePB(void *,int)" (??0ShuttlePB@@QEAA@PEAXH@Z)
1>D:\Open Orbiter Latest\Orbitersdk\lib\OrbiterSoundSDK50.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
1>D:\Open Orbiter Latest\Modules\JMW\J-F-35B.dll : fatal error LNK1120: 9 unresolved externals
1>Done building project "Copy - RC_1 - Copy - Copy (2).vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I've left out various warnings ......
But this isn't right, so what to do...?
D:\Open Orbiter Latest\Orbitersdk\lib\OrbiterSoundSDK50.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'

If I change active platform to Win32 get exact same errors, including this one above.... WRONG !! This is what happens. (This is why I'm not a programmer !)

Code:
>D:\Open Orbiter Latest\Orbitersdk\lib\\orbiter.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
1>D:\Open Orbiter Latest\Orbitersdk\lib\\orbitersdk.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
1>D:\Open Orbiter Latest\Modules\JMW\J-F-35B.dll : fatal error LNK1120: 184 unresolved externals
1>Done building project "Copy - RC_1 - Copy - Copy (2).vcxproj" -- FAILED.

This I can understand, conflict with x64 libraries, but why originally with OrbiterSoundSDK50.lib ? Is there a x64 version somewhere out there I can use ?
 
Last edited:

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
I think it's hard to say definitively if add-ons need to be reconpiled against the OO libraries, because it may depend on the addon, but I would say probably.
If I drop the v.160828 aircraft addon into OO (v.230724) scenario starts but no plane appears = corrupt compile?)
 

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi Again,
Ok, so now I've downloaded Open Orbiter x86 to try and compile my addon.
Having set it all up again to those headers etc I now get these error messages that I understand even less....
Code:
Rebuild started...
1>------ Rebuild All started: Project: Open J-F-35B, Configuration: Release Win32 ------
1>After all Warning changes - Open.cpp
-------------------------------------------------
(left out numerous warnings)
---------------------------------------------------
1>OrbiterSoundSDK50.lib(OrbiterSoundSDK50.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in After all Warning changes - Open.obj
1>   Creating library .\..\..\..\Modules/ShuttlePB.lib and object .\..\..\..\Modules/ShuttlePB.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_settop referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pushvalue referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pushnumber referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pcall referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>D:\Open Orbiter Latest x86\Modules\JMW\J-F-35B.dll : fatal error LNK1120: 5 unresolved externals
1>Done building project "Copy - RC_1 - Copy - Copy (2).vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

OrbiterSoundSDK50 still seems to be causing a problem?
Have searched 'MT_StaticRelease'/'MD_DynamicRelease' error LNK2038: and applied "solutions" to no avail.
As far as I can tell all Lua lib./.h are in place..... Are they the same or different for OO ?
Any help appreciated :cheers:
 
Last edited:

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Hi Again,
Ok, so now I've downloaded Open Orbiter x86 to try and compile my addon.
Having set it all up again to those headers etc I now get these error messages that I understand even less....
Code:
Rebuild started...
1>------ Rebuild All started: Project: Open J-F-35B, Configuration: Release Win32 ------
1>After all Warning changes - Open.cpp
-------------------------------------------------
(left out numerous warnings)
---------------------------------------------------
1>OrbiterSoundSDK50.lib(OrbiterSoundSDK50.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in After all Warning changes - Open.obj
1>   Creating library .\..\..\..\Modules/ShuttlePB.lib and object .\..\..\..\Modules/ShuttlePB.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_settop referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pushvalue referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pushnumber referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pcall referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>D:\Open Orbiter Latest x86\Modules\JMW\J-F-35B.dll : fatal error LNK1120: 5 unresolved externals
1>Done building project "Copy - RC_1 - Copy - Copy (2).vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

OrbiterSoundSDK50 still seems to be causing a problem?
Have searched 'MT_StaticRelease'/'MD_DynamicRelease' error LNK2038: and applied "solutions" to no avail.
As far as I can tell all Lua lib./.h are in place.....
What do you think?
Any help appreciated :cheers:
The OrbiterSound5 libraries were build against Orbiter 2016. Unless Dan releases an OrbiterSound6 for OO, you will have to switch to XRSound.
 
  • Like
Reactions: JMW

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
The OrbiterSound5 libraries were build against Orbiter 2016. Unless Dan releases an OrbiterSound6 for OO, you will have to switch to XRSound.
@n72.75 Thanks for your help.
Changing to XRSound is a tedious business isn't it? (Apologies Doug)
Has no one come up with a quick-fix ?
I'm about halfway through now.....😓

And the Lua libraries ? Any info.?
As far as I can tell all Lua lib./.h are in place..... Are they the same or different for OO ?
 

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi All,
Does anyone know why this compiles in 2016 but not in Open Orbiter ?
Code:
int ShuttlePB::clbkGeneric(int msgid, int prm, void* context)
{
    switch (msgid) {
    case VMSG_LUAINTERPRETER:
    
        lua_State *L = (lua_State*)context;
luaL_dofile (L, "Script\\35B\\aap.lua");

        return VMSG_LUAINTERPRETER;
    }
    return 1;
}
Code:
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _lua_pcall referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
1>After all Warning changes - Open.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: virtual int __thiscall ShuttlePB::clbkGeneric(int,int,void *)" (?clbkGeneric@ShuttlePB@@UAEHHHPAX@Z)
It doesn't recognise the "luaL_dofile (L, "Script\\35B\\aap.lua");" line to load the script.
(I've tried "luaL_loadfile" too with same error)
If I compile without "luaL_dofile", I can use the terminal in the sim to load and operate the aap fine.
 
Top