Jump to content

  • Log In with Google      Sign In   
  • Create Account

Visual Studio include issue


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Ripiz   Members   -  Reputation: 529

Like
0Likes
Like

Posted 02 June 2012 - 03:51 AM

Hello,

I am using Visual Studio 2012 RC (pretty much same as Visual Studio 2010) and I'm having some issues with includes. Never really understood how they work, always having problems, sadly. I have 3 projects
Project1 include paths: "." (project's directory, some files are in folders and it causes a lot include errors)
Project2 include paths: "..\Project1" (first project's directory)
Project3 include paths: ".." (solution directory)

Project2 includes some files from Project1:
#include <File1.h>

Project3 includes some files from Project2:
#include <Project2\File2.h> // we have solution folder in include list, gotta specify project folder

Everything seems fine, but when I try to compile Project3, it cannot find Project1 includes, which are included in Project2.
Adding include path for Project1 in Project3 seems wrong, as I'm not using it directly. I hoped someone could help me out to sort this.

Thank you in advance.

Edited by Ripiz, 02 June 2012 - 03:52 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7991

Like
0Likes
Like

Posted 04 June 2012 - 11:29 PM

Add "..\Project1" to Project3.

#3 Ripiz   Members   -  Reputation: 529

Like
0Likes
Like

Posted 05 June 2012 - 10:21 AM

Feels wrong, as Project3 isn't using Project1 directly, but oh well. Thanks...

#4 Erik Rufelt   Crossbones+   -  Reputation: 3632

Like
0Likes
Like

Posted 05 June 2012 - 10:35 AM

If Project3 needs Project1's include file it kinda is using it directly. Rewrite the code so that Project2\File2.h doesn't include File1.h (try to write it so you can include it from File2.cpp instead).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS