Jump to content
gc8

#include relatively

Recommended Posts

Hi

is it possible to include file relative to mission directory? The #include command is relative to the current file, it would be nice to be able to write the path always relative to the mission directory

 

I looked here but didn't find solution

 

anyone knows?

 

thx!

Share this post


Link to post
Share on other sites

you can #include files that are in the parent directory by prefixing them with ..\
So if you are in "mission\media" directory you can do #include "..\somefile.hpp" where somefile is at the root.
and then #include "..\functions\somefile.hpp" should allow you to include a file that's in a "function" dir when you are in the "media" dir for example.

Share this post


Link to post
Share on other sites

@Mr H. Yes I know that thx

 

But I would like to change:

 

#include "..\..\common\defs\defs.h"

 

to

 

#include "common\defs\defs.h"

 

 

 

Share this post


Link to post
Share on other sites

 

2 minutes ago, gc8 said:

Yes I know that thx 

I had a sense that you did but posted anyway just in case.


As for your request, I don't think that's possible, but if someone proves me wrong I'd be interested in their answer too 😁

Share this post


Link to post
Share on other sites

use junctions/symlinks

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×