.dll Question Compiling Ummu

Max Pain

Member
Joined
Sep 2, 2008
Messages
99
Reaction score
0
Points
6
Hi

I have already compiled the shuttlePB, shuttleA and deltaglider sample with VS 2008 Express under Vista Home Premium. Now I got stuck with compiling the UMmu_ShuttlePB_Example.

I set up my compiler like in this tutorial: http://www.orbiterwiki.org/wiki/Free_Compiler_Setup
I opened the ShuttlePB.dsw file and added ShuttlePB.h, UMmuSDK.h and UMmuSDK.lib (I also put UMmuSDK.lib in the OrbiterSDK/lib/ folder and UMmuSDK.h ind the OrbiterSDK/include/ folder). And I added UMmuSDK.lib to the additional dependencies in my project under Properties/Configuration Properties/Linker/Input. Nevertheless it fails:(.

The Build Log is attached.

Any help would be appreciated, but I'm very unexperied with programming (only the stuff I mentioned in the beginning and I read through the API_Guide.pdf) so please explain step by step!

Thanks in advance

Editet later:
I already found the error: I had to open the ShuttlePB.dsp file instead of the dsw file.
 

Attachments

Last edited:
Got an answer.

Had same problem. Added UMmuSDK.h and UMmuSDK.lib to list of files in the solution under ShuttlePB (using VC++ 2008) And in linker input added msvcirt.lib and libcmt.lib for ignore specific libraries. msvcrt.lib was already included. This fixed it for me. If you get an error in a scenario about u_mmu.dds and u_mmu2.dds, copy each respective mmu.dds and mmu2.dds and rename the copies to fit u_MMu.dds = mmu.ds and u_mmu2.dds = mmu2.dds
 
Last edited:
To Albinon: Thanks, actually I already managed to compile the sample. My fault was to open the wrong project file.

Now I'm trying to implement the ummu code from the shuttlepb example into the shuttleA mkII sample.
Without much understanding of coding I just copy and pasted the ummu-part in the header to the shuttle A header und the two lines from the cpp file to the corresponding shuttle A file. I also tweaked the properties tab so it is identical to the ummu shuttlepb example which i got to compile. Of course, I added and included UMmuSdk.h and UMmuSdk.lib.

Now I get these two errors:
1>ShuttleA.obj : error LNK2019: unresolved external symbol "public: void __thiscall ShuttleA::clbkSetClassCaps_UMMu(void)" (?clbkSetClassCaps_UMMu@ShuttleA@@QAEXXZ) referenced in function "public: virtual void __thiscall ShuttleA::clbkSetClassCaps(void *)" (?clbkSetClassCaps@ShuttleA@@UAEXPAX@Z)
1>.\release/ShuttleA.dll : fatal error LNK1120: 1 unresolved externals

To my mind LNK2019, means there is a library missing but which one?

Edit:
If i don't add this before the addmesh in shuttleA.cpp it compiles, but UMmu don't work:
// Ummu call of our own function to keep listing clear.
SelectedUmmuMember=0;
clbkSetClassCaps_UMMu();


-----Post Added-----


Ok, it seems that I also have to add the UMmuExample.cpp file.

So now I renamed all ShuttlePB's to ShuttleA's in the UMmuExample.cpp. Now I get errors with the UMmuExample.obj file:

Code:
1>UMmuExample.obj : error LNK2005: "public: virtual void __thiscall ShuttleA::clbkSaveState(void *)" (?clbkSaveState@ShuttleA@@UAEXPAX@Z) already defined in ShuttleA.obj
1>UMmuExample.obj : error LNK2005: "public: virtual void __thiscall ShuttleA::clbkLoadStateEx(void *,void *)" (?clbkLoadStateEx@ShuttleA@@UAEXPAX0@Z) already defined in ShuttleA.obj
1>UMmuExample.obj : error LNK2005: "public: virtual void __thiscall ShuttleA::clbkPostStep(double,double,double)" (?clbkPostStep@ShuttleA@@UAEXNNN@Z) already defined in ShuttleA.obj
1>UMmuExample.obj : error LNK2005: "public: virtual int __thiscall ShuttleA::clbkConsumeBufferedKey(unsigned long,bool,char *)" (?clbkConsumeBufferedKey@ShuttleA@@UAEHK_NPAD@Z) already defined in ShuttleA.obj
1>   Creating library .......Modules/ShuttleA.lib and object .......Modules/ShuttleA.exp
1>.release/ShuttleA.dll : fatal error LNK1169: one or more multiply defined symbols found

I also can't open the *.obj file. What for is that *.obj file and why it's causing errors?
 
Coding problems

From your error messages, I'd say look for duplicate subroutines clbkConsumeBufferedKey, etc...

an obj file is a resource file the compiler creates to store addresses of variables and sub-routines. In VC++ 2005 it is discarded after succesfully linking the DLL. I am not too sure of its purpose in VC++ 2008 because .net seems to use it. It can not be opened or manipulated by an editor. If there is an unresolved error in it, it will cause the linker to halt. By resolved, that means the compiler knows where it variable or sub-routine is located and what is referencing them. Being unresolved is sort of like mis-dialing a number on a cell phone. The phone connects, but the answer doesn't.

While not trying to sound rude, I think your code has flaws. Duplicate sub-routines and misnamed leaders. ShuttlePB::clbkConsumeBufferedKey in ShuttleA_MKII. I have done the same thing many times cutting and pasting between. I get tripped up by case sensitive names in VC... Takes me hours to debug before I slap myself with a "Doh!!"
 
Last edited:
Albinon: I followed your suggestion and copied the double functions from the UMmuExample.cpp to the ShuttleA.cpp file. Of course, I then deleted the ones in UMmuExample.cpp. Now it compiles.

However, it seems that there are still some errors in the code, see attachmend. It is the "Ummu Sdk Demo Eva" scenario which should be around the earth, not the sun.

None of the Ummu keys work and I can operate no thrusters. Despite of this, everything else like panels, animations or mfd's work.
 

Attachments

  • Ummu Sdk Demo EVA.jpg
    Ummu Sdk Demo EVA.jpg
    39.9 KB · Views: 10
Would have to see the code

None of the Ummu keys work and I can operate no thrusters.

Sounds like a parameter is off in your Airlock size or location. You just got a light-speed to the sun error. Happens when you have a conflict like this. I think the UMmu doc mentions it about having an airlock to low to the ground. Once they take this trip and you did not turn off the "Dead" code, of course you would not be able to operate them. F8 inside one and see if you get the "Dead" flag.
 
Last edited:
It was an error in the clbkloadstate function.

Now everything works, despite of rcs and ummu (just the message works but no keys and actions).

Any suggestions, where to search for errors?
 
Back
Top