Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 09-21-2017, 06:39 PM   #16
kuddel
Donator
Default

Quote:
Originally Posted by martins View Post
 With your permission, I'd like to adopt that method for my own orbiterroot property sheet. Not having to set up the path manually would be a huge advantage and avoid a common cause of problems, as this thread shows.
I would be an honor

I also took me quite long before I came across that macro.
Sometimes the hardest thing is: What exactly do I have to ask google to get a satisfying answer.
kuddel is offline   Reply With Quote
Thanked by:
Old 10-08-2017, 10:13 PM   #17
martins
Orbiter Founder
Default

Quick update: the MSBuildThisFileDirectory macro doesn't seem to be supported in VS2008 (and probably before). So I'll have to stick to the current method of manually specifying the OrbiterDir location in the default property sheets, at least until I'm upgrading my compiler tool chain.
martins is online now   Reply With Quote
Old 10-09-2017, 07:50 AM   #18
kuddel
Donator
Default

Quote:
Originally Posted by martins View Post
 Quick update: the MSBuildThisFileDirectory macro doesn't seem to be supported in VS2008 (and probably before).
That's a pity.

But it's always that case. The urgently needed feature is in version N+1

For whom it might interest:
Visual StudioMSBuildThisFileDirectory
Link
2008
No
https://msdn.microsoft.com/en-us/lib...=vs.90%29.aspx
2010
No
https://msdn.microsoft.com/en-us/lib...vs.100%29.aspx
2012
Yes
https://msdn.microsoft.com/en-us/lib...vs.110%29.aspx
2013
Yes
https://msdn.microsoft.com/en-us/lib...vs.120%29.aspx
2015
Yes
https://msdn.microsoft.com/en-us/lib...vs.140%29.aspx
2017
Yes
https://docs.microsoft.com/en-us/vis...own-properties
kuddel is offline   Reply With Quote
Thanked by:
Old 07-02-2019, 02:16 AM   #19
msligo
Orbinaut
Default

Hello,

I think I'm having a similar problem, but the above solutions didn't work. I am trying to compile the DeltaGlider source code in Visual Studio 2017, but I keep getting the following two errors:

Error MSB6006 "cmd.exe" exited with code 255. DeltaGlider C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Mic rosoft.CppCommon.targets 209

and

Error MSB3073 The command "if not exist D:\Files\Applications\Orbiter 2016\Project Apollo Debug\Modules\Startup mkdir D:\Files\Applications\Orbiter 2016\Project Apollo Debug\Modules\Startup
:VCEnd" exited with code 3. DGConfigurator C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Mic rosoft.CppCommon.targets 128



(Ignore the "Project Apollo Debug" part, that's just the name I gave to this particular Orbiter installation.)

I've been searching the internet for hours to try and solve this, but no luck so far.

I modified the orbiterroot property sheet as advised, and I'm using the Windows 10 SDK version 10.0.17763.0 but the problem still persisted.

Can someone please help me get this running?

Many thanks,
msligo

Last edited by msligo; 07-02-2019 at 02:18 AM.
msligo is offline   Reply With Quote
Old 07-02-2019, 08:23 AM   #20
kuddel
Donator
Default

I would suspect "a path containing spaces" is the issue here.
Easiest work-around is to move your Orbiter development path to some path without spaces (like "C:\Orbiter").

If you don't like to move your work, you might have to edit the project file(s) and add some double-quotes here and there...
kuddel is offline   Reply With Quote
Thanked by:
Old 07-02-2019, 08:50 AM   #21
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

I would recommend taking a look at CMake there BTW with Visual Studio, it works pretty well.

I have a setup right now that uses CMake, a custom CMake module for locating the Orbiter installation (aided by an environment variable) and vcpkg for handling non-orbiter dependencies. All is self-contained that way and easily portable to other computers.

Which is important since my Orbiter notebook failed fatally last weekend and is barely operational now.
Urwumpe is online now   Reply With Quote
Thanked by:
Old 07-02-2019, 01:29 PM   #22
msligo
Orbinaut
Default

Thank you kuddel, I think that was the problem. I changed the OrbiterDir macro to a relative file path (..\..\..) and it fixed that error. Unfortunately a new error arose, in that it couldn't find several "meshres_XX.h" files. After a bit of searching, it looks like the "meshc.exe" program also doesn't like spaces in file names, so I bit the bullet and just removed all the spaces in my folders. I don't suppose you know a way to make "meshc.exe" work using relative file paths instead?

Aside from that, it all seems to be compiling now. Lots of Warnings, but most of them are of the form '=': conversion from 'double' to 'float', possible loss of data, so I can probably leave them for now.

One Warning that worries me a bit is the following:

MSB8012 TargetPath(D:\Files\Applications\Orbiter2016\Proje ctApolloDebug\Orbitersdk\samples\DeltaGlider\DGCon figurator\Release\DGConfigurator.dll) does not match the Linker's OutputFile property value (D:\Files\Applications\Orbiter2016\ProjectApolloDe bug\Modules\Startup\DGConfigurator.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). DGConfigurator C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Mic rosoft.CppBuild.targets 1216


Do you know what causes that, and is it a major problem?


Urwampe. Thank you for the suggestion, I'll look into it, although it might be a bit beyond my level. I have a fairly strong understanding of C++ syntax and object oriented programming, but a poor grasp on everything outside of that (compiling, linking, etc.) Every time I see the word "make" (as in "makefiles") I start to get nervous!

Last edited by msligo; 07-02-2019 at 01:35 PM.
msligo is offline   Reply With Quote
Old 07-02-2019, 06:15 PM   #23
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by msligo View Post
 Every time I see the word "make" (as in "makefiles") I start to get nervous!

I know that feeling, I had to manually fix the automatically generated makefiles of a project for years, because the old autobuild input files had been made for a version that was deprecated 10 years before I joined the project...


Luckily, CMake is a lot cleaner than that now... right now it is just that for producing the core DLL of the project:


Code:
cmake_minimum_required (VERSION 3.10)

find_package(OrbiterSDK 16.0 REQUIRED)
find_package(nlohmann_json 3.2.0 REQUIRED)

include_directories("./include")
include_directories("${ORBITERSDK_INCLUDE_DIR}")
link_directories(${ORBITERSDK_LIBRARY})
add_library(SFMVessel MODULE SFMVessel.cpp Interface.cpp)

message("Orbiter libraries are: ${ORBITERSDK_LIBRARIES}")

target_link_libraries(SFMVessel PRIVATE nlohmann_json::nlohmann_json ${ORBITERSDK_LIBRARIES})



install(TARGETS SFMVessel 
    LIBRARY DESTINATION Modules
    ARCHIVE DESTINATION OrbiterSDK/lib
)
Ingredients beyond Visual Studio 2017 Community and Orbiter:
- vcpkg
- And CMake 3.14 (for running vcpkg)

Last edited by Urwumpe; 07-02-2019 at 06:22 PM.
Urwumpe is online now   Reply With Quote
Old 07-02-2019, 06:45 PM   #24
kuddel
Donator
Default

Quote:
Originally Posted by msligo View Post
 [...]I don't suppose you know a way to make "meshc.exe" work using relative file paths instead?[...]
I know that problem. Unfortunately meshc.exe even fails when you give it "quoted" paths.
Last time I was confronted with this was here.
So replacing the command with the ugly for-construct might be a solution for you, but I think the "current" meshc.exe should work with quoted paths ("meshc /H" for help)[1]


[1] see martins post for commit #78 there, shortly after my request.

Last edited by kuddel; 07-02-2019 at 06:49 PM.
kuddel is offline   Reply With Quote
Old 07-02-2019, 06:52 PM   #25
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by kuddel View Post
 I know that problem. Unfortunately meshc.exe even fails when you give it "quoted" paths.
Last time I was confronted with this was here.
So replacing the command with the ugly for-construct might be a solution for you, but I think the "current" meshc.exe should work with quoted paths ("meshc /H" for help)[1]


[1] see martins post for commit #78 there, shortly after my request.

I wrote ssumeshc for that....
Urwumpe is online now   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 10:56 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.