Sign in to follow this  
red-dragonX

[.net] newb ? about 'Add Existing Item'

Recommended Posts

When I do that, doesn't that mean now that it's part of my project? My new project is called Trippy, and it contains Trippy.cc and Trippy.h . I already have a GameEngine.cpp and GameEngine.h, but they were created in another project. So under Trippy, I added both GameEngine.cpp and GameEngine.h as 'Add | Add Existing Item'. so now, under Trippy.h, I do have: #include "GameEngine.h" Well, when i click on Run, it says it cannot open that file and that there is no such directory or file. And then when I go to my Desktop and open up Trippy save space (not in .NET), I only see Trippy.cpp and .h, and not GameEngine.h or .cpp. So um, educate me :)

Share this post


Link to post
Share on other sites
Add existing item only means add the path, not the actual file. When you use multiple files across different directories, you will have to take into account the relative locations to the project for it to work. So you can't simply have #include "GameEngine.h", since GameEngine.h is not in your current path. You can either use relative paths to the file, such as #include "../../GameEngine/src/GameEngine.h" (where ../ moves the directory up one level) or you can simply add the path of the files to the include directories via the Tools menu.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this