Guillaume V

Hi all... I'm kind of new to the C++ language, and I tried out Visual C++ more or less for fun, but each time I try building a program, the following error appears :

1>.\Calculateur de Moyenne.cpp(3) : fatal error C1083: Cannot open precompiled header file: 'Debug\Claculateur de Moyenne.pch': No such file or directory

I'm not even sure what that means! I tried to build the project on an other compiler, and the whole building process and program work fine...

Thanks for any help, and try not to make to much fun of me, i'm only forteen!




Re: Visual C++ Express Edition Little Build Error... No precompiled debugger header file?

Andreas Johansson

There can be many reasons for this and you can check the link for some of them.
http://msdn2.microsoft.com/en-us/library/et4zwx34(vs.80).aspx

Have you built the whole project Use CTRL-SHIFT-B or menu Build-Build Solution.

If you still have problem and are not able to build it I can try it if you send it to me.

My email: afjohansson(at)hotmail(dot)com






Re: Visual C++ Express Edition Little Build Error... No precompiled debugger header file?

Guillaume V

Ok... So I tried building the whole project via CTRL+SHIFT+B, and then it came up with a whole load of errors I'm not even close from understanding!!
I'll send the project to your inbox, if you wan't to help; you don't have to, but I'd appreciate....
I'll also send the actual program that I built using Dev-C++ compiler, which works fine...

Note that the program is written in French, I'm French and I sort of speak French at home, so I guess all my programs tend to be in French!
The comments
(well however you call the lines that aren't used in the program and which are after //...) were intended for a (French) friend which is interested in C++ and were aimed at explaining the basics of the C++ language.
Tell me if the French bits bother you and I'll translate them...

Thanks for all the help!





Re: Visual C++ Express Edition Little Build Error... No precompiled debugger header file?

Andreas Johansson

To followup here also.

It seem the line to include the precompiled headers were missing, it should be on top of any code file in a project with precompiled headers.

Code Snippet
#include "stdafx.h"






Re: Visual C++ Express Edition Little Build Error... No precompiled debugger header file?

Guillaume V

Hi,
So, this time I tried to add an other .cpp file which contained the actual code for the program via
#include "Moyenn qui marche.cpp"
and also
#include "stdafx.h" on both .cpp files and this time...
It worked! Well more or less, because when I tried building the (new) project, it went through the compiling process fine, but when it started going through the linking process, I received a message in the error log saying...

1>------ Build started: Project: Calculateur de moyenne2, Configuration: Debug Win32 ------
1>Compiling...
1>Moyenn qui marche.cpp
1>Compiling managed resources...
1>Read in 0 resources from "d:\Documents and Settings\Guillaume\Mes documents\Visual Studio 2005\Projects\Calculateur de moyenne2\Calculateur de moyenne2\Form1.resX"
1>Writing resource file... Done.
1>Compiling resources...
1>Linking...
1>LINK : warning LNK4022: cannot find unique match for symbol 'main'
1>LINK : warning LNK4002: "int __clrcall main(cli::array<class System:Tongue Tiedtring ^ >^)" ( main@@$$HYMHP$01AP$AAVString@System@@@Z) defined in .\debug\Calculateur de moyenne2.obj
1>LINK : warning LNK4002: "int __clrcall main(void)" ( main@@$$HYMHXZ) defined in .\debug\Moyenn qui marche.obj
1>LINK : fatal error LNK1152: cannot resolve one or more undecorated symbols
1>Build log was saved at "file://d:\Documents and Settings\Guillaume\Mes documents\Visual Studio 2005\Projects\Calculateur de moyenne2\Calculateur de moyenne2\Debug\BuildLog.htm"
1>Calculateur de moyenne2 - 1 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Needless to say I don't understand anything what so ever about this error log...
Thanks for any help...





Re: Visual C++ Express Edition Little Build Error... No precompiled debugger header file?

Andreas Johansson

You seem to try to compile a CLR application but the main entry point is not defined as the linker expects. If you create a new CLR console application you will see how the main entry point is defined.

Code Snippet

int main(array<System::String ^> ^args)

{

// your code

return 0;

}

Modify your main entry point to be as above.