a c++ question

Get answers to all your basic programming questions. No Ogre questions, please!
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

a c++ question

Post by limbo »

Sorry to post c++ question here. But I get this question when learning Ogre. Don't laugh too much if you find the question is too easy.

How to set the relative path in c++.net? eg. I want to set "Additional Include Directories", but don't know how to calculate the relative path.

Thanks!
alphabeta
Kobold
Posts: 34
Joined: Mon Jan 03, 2005 5:07 am

Post by alphabeta »

Try using VS macros, for example "$(SolutionPath)/include/"
Why apologize? That's what this subforum was created for.
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia

Post by monster »

[moved to Back to Basics]

Rather than specifying the path explicitly you specify it relative to where the project file is.

So if your include files are in

Code: Select all

C:\Development\ogre-0.15.1\MyDemo\include
And your project file's in

Code: Select all

C:\Development\ogre-0.15.1\MyDemo\scripts\VC7.1
Then you'll want to set your additional includes relative path to

Code: Select all

..\..\include
i.e. one "dot dot" takes you up from the VC7.1 folder to scripts, the other takes you up to MyDemo and then the include takes you back down into the include folder.

So assuming you extracted the Ogre distribution under C:\Development and then renamed it to ogre-0.15.1 then, from your project, the relative path to the Ogre includes would be;

Code: Select all

..\..\..\OgreMain\include
Hope that makes sense!
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

Post by limbo »

Thanks Monster! Your explanation is so clear! I understand now!
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

Post by limbo »

alphabeta, your reply makes me feeling warm in heart! :) Thanks! Sometimes, I'm just nervous about my too easy questions :oops: