generation-rw Posted March 9, 2008 Share Posted March 9, 2008 Bonjour Voici un petit exos: #include <iostream> #include <stdio.h> using namespace std; int main() { cout << "Hello world!" << endl; getchar (); return 0; } Ce programme marche avec Dev C++, masi ne se compile pas avec Visual ! Visual me demande de céclarer "cout", "endl", "using namespace std"... . J'ai bien rajouter stdio.h et iostream dans stdafx.cpp de visual ce qui donne: // stdafx.cpp : source file that includes just the standard includes // Exercice 1 hello world.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file #include <iostream> #include <stdio.h> et j'ai donc supprimer stdio et iostream du programme principale afficher plus haut... . Comment on fait ? Merci Link to comment Share on other sites More sharing options...
pc73 Posted March 10, 2008 Share Posted March 10, 2008 BonjourVoici un petit exos: #include <iostream> #include <stdio.h> using namespace std; int main() { cout << "Hello world!" << endl; getchar (); return 0; } Ce programme marche avec Dev C++, masi ne se compile pas avec Visual ! Visual me demande de céclarer "cout", "endl", "using namespace std"... . J'ai bien rajouter stdio.h et iostream dans stdafx.cpp de visual ce qui donne: // stdafx.cpp : source file that includes just the standard includes // Exercice 1 hello world.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file #include <iostream> #include <stdio.h> et j'ai donc supprimer stdio et iostream du programme principale afficher plus haut... . Comment on fait ? Merci Salut. Il faut placer tes "include" dans Stdafx.h et pas stdafx.cpp ( c'est écrit : // TODO: reference any additional headers you need in STDAFX.H and NOT in this file ) Si tu veux t'entrainer pour du multi-plateforme ( ou multi ide ) dans visual studio, tu aurais du choisir un projet win32 console avec l'option projet vide coché, ça évite de se poser trop de question sur les entêtes précompilées ,le stdafx.h et autres... Link to comment Share on other sites More sharing options...
PiFou86 Posted March 10, 2008 Share Posted March 10, 2008 maintenant, que tu as écrit ton premier programme, tu n'as plus qu'a le comprendre et essayer de retenir les 10, 20 trucs a voir sur ton exemple... (à quoi sert un .h, diff entre cpp et h, syntaxe, etc.) => bonne chance....... Link to comment Share on other sites More sharing options...
generation-rw Posted March 10, 2008 Author Share Posted March 10, 2008 BonjourVoici un petit exos: #include <iostream> #include <stdio.h> using namespace std; int main() { cout << "Hello world!" << endl; getchar (); return 0; } Ce programme marche avec Dev C++, masi ne se compile pas avec Visual ! Visual me demande de céclarer "cout", "endl", "using namespace std"... . J'ai bien rajouter stdio.h et iostream dans stdafx.cpp de visual ce qui donne: // stdafx.cpp : source file that includes just the standard includes // Exercice 1 hello world.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file #include <iostream> #include <stdio.h> et j'ai donc supprimer stdio et iostream du programme principale afficher plus haut... . Comment on fait ? Merci Salut. Il faut placer tes "include" dans Stdafx.h et pas stdafx.cpp ( c'est écrit : // TODO: reference any additional headers you need in STDAFX.H and NOT in this file ) Si tu veux t'entrainer pour du multi-plateforme ( ou multi ide ) dans visual studio, tu aurais du choisir un projet win32 console avec l'option projet vide coché, ça évite de se poser trop de question sur les entêtes précompilées ,le stdafx.h et autres... Effectivement ! Merci maintenant, que tu as écrit ton premier programme, tu n'as plus qu'a le comprendre et essayer de retenir les 10, 20 trucs a voir sur ton exemple... (à quoi sert un .h, diff entre cpp et h, syntaxe, etc.) => bonne chance....... C'est compliquer ? Merci Link to comment Share on other sites More sharing options...
PiFou86 Posted March 10, 2008 Share Posted March 10, 2008 C'est compliquer ?Merci Tout depend de tes connaissances actuelles, de ta rapidité de compréhension, des chemins que tu vas prendre.... Bref ca dépend de beaucoup de paramètre Link to comment Share on other sites More sharing options...
lorinc Posted March 10, 2008 Share Posted March 10, 2008 C'est compliqué ?Merci Pas plus que d'apprendre un français correct Plus sérieusement, ça dépend avant tout de ta motivation Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.