Image below, as you can see my "Init Direct3D" Demo project has a reference to "Direct3D Framework", and yet I cannot #include "D3DApp.h" ... what am I doing wrong? x_x
Image below, as you can see my "Init Direct3D" Demo project has a reference to "Direct3D Framework", and yet I cannot #include "D3DApp.h" ... what am I doing wrong? x_x
My portfolio: https://www.artstation.com/artist/marcusaseth
What's the error you get when you try?
Adding a "reference" to a native project like that isn't necessarily going to set up the include paths correctly; probably the only thing it's doing for you is ensuring the referenced project builds before the referring project. Depending on how you set it up, it may also be automatically linking in the static library output of the referenced project.
Chances are, you need to go into the project settings for your main project and find the include search paths option, and modify it to include a relative path from your project to the directory containing the D3DApp.h source code.
Or, frankly, not bother with a separate project for this and just lump it all into your main project.
I think you where right about the paths, after adding include,reference and source path the intellisense now highlight all my classes and give no errors, but still it won't compile, image below x_x (apologize, my VS is not in english unfortunately)
My portfolio: https://www.artstation.com/artist/marcusaseth
Finally solved x_x
I had to go into my framework project and change it into a Static Library configuration from the project setting, it was set as an application before x_x
My portfolio: https://www.artstation.com/artist/marcusaseth
The static library configuration issue will have fixed those Linker errors (LNK1120).
However the initial problem, of being unable to #include a file, is all down to setting the correct include directories (i.e. in "Directory di inclusione").
These 2 concepts are (unfortunately) quite separate in C++, and with any application using multiple projects you typically have to do both things - make sure the #includes are visible, and make sure the .lib files are linked in to your final project or library correctly.
6 minutes ago, Kylotan said:The static library configuration issue will have fixed those Linker errors (LNK1120).
However the initial problem, of being unable to #include a file, is all down to setting the correct include directories (i.e. in "Directory di inclusione").
These 2 concepts are (unfortunately) quite separate in C++, and with any application using multiple projects you typically have to do both things - make sure the #includes are visible, and make sure the .lib files are linked in to your final project or library correctly.
Yes, I ended up touching the include directories as well even though I didn't mentioned it.
Imo it's kind of ridiculous that something as simple as that requires turning all that knobs and pulling all that levers, but maybe is just me doing it wrong or being spoiled
My portfolio: https://www.artstation.com/artist/marcusaseth