views:

44

answers:

2

I have created an C++ solution in VS2008. The first project contains the model. The second projects is the view. The problem is that i don't get make references to my model classes defined in the first project. The message error is :

Error   1   fatal error C1083: Cannot open include file: 'utils/GeradorSistematicoDeAlturaDoPlanoDeCorteStrategy.h': No such file or directory  c:\Users\user\Programação em C++\Simulacao\Simulacao_Testes\src\Teste1.cpp  3   Simulacao_Testes

Is there any configuration in VS2008 that makes to be made in order to, from the my view (second project) project, i do make references to the first project, the model?

+1  A: 

You can either use relative paths in the include statement itself, or add the directory where the model .h files are to the additional include directories of the project settings (go the project properties, then Configuration properties / C++ / General, Additional include directories).

Timores
i make this, but i got linker erros ...
Lucas
errors like: Error 1 error LNK2001: unresolved external symbol "public: __thiscall Vetor::Vetor(void)" (??0Vetor@@QAE@XZ) Teste1.obj Simulacao_Testes
Lucas
Please see Simon's answer about the linker error. In order to compile, you need to set the right include path. In order to link, you need to point to the right set of lib files. If you created DLLs, in order to run, they need to be accessible to the EXE (either in same dir or in PATH, or in AppPath)
Timores
A: 

First of all I find this approach for the MVC pattern quite strange. But if you really want to do it like that you have to link the resulting DLL/LIB from your model project to your view project (go to the project properties, then Configuration Properties/Linker/Input/Additional Dependencies; you may need to set the right path too in Configuration Properties/Linker/General/Additional Library Directories)

Simon Linder
in true, this was a simplified example. I'm tring to test a project with google test framework. The suite of tests are other project in the same solution. But i don't get make references to the main project (the target project of my tests).
Lucas
Well your linker errors mentioned above occurs because your main project doesn't know a class that you want to use (Vetor I guess). So you have to link that project's output to your main project in any way.
Simon Linder