Jump to content

adding new files to project


cassius
 Share

Recommended Posts

I have app.cpp and app.h in my project. I need another file (with header file) to hold my functions.I had no problem creating files called game.cpp and game.h but got error messages when putting an include for them in main.cpp.Anyone know what I am missing.

 

Where should I put I#header files so they are all visible to each other?

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Because I noticed that when you create a file in the Windows project, it saves it in the folder "/Projects/Windows" while all the other default files are in "/Source" (and at least on my VC++2010 it seems I cannot set the directory where to write the new class). So if you are not going to build a cross-platform Windows+Mac I suggest to move the default files (main.cpp, App.h, App.cpp) in "/Projects/Windows" and you will not have any issue with the weird behavior of the Windows project. I use Xcode on Mac so I'm not having this issue because I can set the physic path of a filter, if someone knows a workaround for this on the Windows side too please let me know.

 

PS: To create both .h and .cpp at once, you can right click on the project name in the solution explorer of VS and choose Add->Class->C++ Class, then set the name of the class.

 

PS2: You must not #include .cpp but only the .h to access your class.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...