Salut !
Je viens de me mettre à la programmation VC++ car j'avais des problèmes de manque de mémoire avec TC 3 sous dos...
Je veux juste faire du C++ et tracer quelques malheureuses lignes, mais pas particulièrement de la programmation Windows. j'ai donc repris un projet démo avec le minimum graphique.
En partant d'un projet de démo pour la librairie GDI+ que j'ai téléchargé je ne sais plus où, j'ai rajouté la fonction suivante :
Tel que c'est écrit là, le compilo ne plante pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 void Gogogo() { using namespace std; class Fourmis; class PtProp; class FourmisColony; typedef pair<int,int> Point; typedef pair<Point,int> Node; typedef pair <Point,PtProp> KeyAndVal ; class Fourmis { public : Point CurCoord; // list <Node> BackNest; }; class PtProp { public : float Phrmn; vector <Point> Next; }; class FourmisColony { public : Point Location; vector <Fourmis> Frm; string Name; }; const Point WorldMax (50,50) ; const int NbFourmis = 100; map <Point,PtProp> WorldMap; FourmisColony FrmClny; //la suite peut être mis en commentaire, ca ne change rien au problème for (int x = 0; x != WorldMax.first ; x++) { for (int y = 0; y != WorldMax.second ; y++) { Point TmpPoint (x,y); PtProp TmpPtProp; TmpPtProp.Phrmn = 0; WorldMap.insert(KeyAndVal(TmpPoint,TmpPtProp)); } } for (int i = 0 ; i != NbFourmis ; i++) ; }
Par contre, si j'enlève le // devant "list <Node> BackNest;", cela suffit à le faire crasher.
j'obtient une fenêtre de crash abituelle et le message suivant dans la fenêtre Output from Build :
------ Build started: Project: Starting GDIPlus, Configuration: Debug Win32 ------
Compiling...
Starting GDIPlusDlg.cpp
e:\program files\microsoft visual studio 8\vc\include\xmemory(160) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1.cpp', line 1392)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Build log was saved at "file://e:\Program Files\Microsoft Visual Studio\MyProjects\Starting GDIPlus\Debug\BuildLog.htm"
Starting GDIPlus - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Au début j'ai cru que le compilateur ne supportait pas le type vector<list<pair<pair<int,int>,int>>>, mais chose étrange, j'ai essayé de créer un projet Win32 Console application, de simplement rajouter ma fonction Gogogo() ainsi que les 3 includes nécéssaires pour list, map et string, et là, le projet compile sans problème.
J'ai joint le projet "Starting GDIplus" modifié afin que vous puissiez essayer de le compiler...
Je n'ai rien trouvé dans la faq à ce sujet, alors si quelqu'un pouvait m'aider, ça serait complètement bien.![]()
PS : en fait le le .rar est trop gros, je l'ai upload ici : http://www.keepmyfile.com/download/ed0e47909467
PS2 : Ah ya aussi un fichier BuildLog.Htm dans lequel on trouve :
Build started: Project: Starting GDIPlus, Configuration: Debug|Win32
Command Lines Creating temporary file "e:\Program Files\Microsoft Visual Studio\MyProjects\Starting GDIPlus\Debug\RSP00000623523680.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_AFXDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp".\Debug/Starting GDIPlus.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /c /ZI /TP ".\Starting GDIPlusDlg.cpp"
]
Creating command line "cl.exe @"e:\Program Files\Microsoft Visual Studio\MyProjects\Starting GDIPlus\Debug\RSP00000623523680.rsp" /nologo /errorReport:prompt"
Partager