4

I have issues compiling Integrating Vision Toolkit which comes with a Microsoft Visual C++ 6.0 workspace. Visual Studio Express 2010 fails to convert the workspace.

I tried VCUpgrade as described here without success.

Unable to convert project.
Please make sure this is a valid Visual C++ 6.0 project.

I tried to start over with a fresh project and add the files manually, the vcxproj contains the files like:

 <ItemGroup>
    <ClInclude Include="..\..\..\src\Helpers\BasicFileIO.h" />
    <ClInclude Include="..\..\..\src\Helpers\Configuration.h" />
    <ClInclude Include="..\..\..\src\Helpers\helpers.h" />
    ...
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\..\..\src\Helpers\BasicFileIO.cpp" />
    <ClCompile Include="..\..\..\src\Helpers\Configuration.cpp" />
    <ClCompile Include="..\..\..\src\Helpers\helpers.cpp" />
    ...

These files do not compile since the (already contained) header files cannot be resolved.

How should I setup the project to include cpp and h files from different directories?

I hope that there is a better way than copying the files into a flat directory. (I didn't use C++ for many years, so please explain it for a beginner)

stacker
  • 68,052
  • 28
  • 140
  • 210
  • 1
    "These files do not compile since the (already contained) header files cannot be resolved." I'm not really sure what you mean by this. What is the error you're getting? – spencercw Feb 25 '12 at 14:05
  • @spencercw the error message is ` ..\..\..\src\Math\DoubleMatrix.cpp(50): fatal error C1083: file(Include) cannot be opened: "Helpers/helpers.h":` helpers.h is included in the list, and another file (which is also included) depends on helpers.h which isn't found. Hope this makes more sense now. – stacker Feb 25 '12 at 14:09

2 Answers2

5

You need VC++ 2008 Express (or retail version of VC++ 2010, like Professional edition) to convert from VC++ 6.0. Take a look at this thread: Visual C++ 2010 Express cannot open Visual C++ 6.0 projects

SChepurin
  • 1,814
  • 25
  • 17
  • thanks I alread found this post, do you know whether and where I could get a copy of VC++ 2008? – stacker Feb 25 '12 at 14:14
  • @stacker You can get a copy of VS 2008 Express [here](http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express), although it would probably take significantly less time to just convert it manually. – spencercw Feb 25 '12 at 14:23
  • VISUAL STUDIO 2008 EXPRESS EDITIONS - http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express – SChepurin Feb 25 '12 at 14:24
3

You need to set the include directory in the IDE. Right click your project and select Properties. Navigate to C/C++ -> General -> Additional Include Directories and add the path to your include folder (the folder that contains the Helpers folder with your helpers.h file in it). Something like this:

$(SolutionDir)your_project\include
spencercw
  • 3,320
  • 15
  • 20
  • Thanks, do I need to add all 20 directories by hand? – stacker Feb 25 '12 at 14:13
  • @stacker Probably not. If you've got a hierarchy with one include directory that contains a bunch of other directories then you shouldn't need to, unless the code references the .h files without the directory. For example, if you've got something like include\a\a.h and include\b\b.h, and your .cpp file includes "a.h" and "b.h" instead of "a\a.h" and "b\b.h" you will need to add include\a and include\b to your project configuration separately. – spencercw Feb 25 '12 at 14:16