![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: help, newbie, progrmaming, tutorial, visual studio |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| |||
| I knew that Visual C++ liked the stdafx.h header, but I didn't realize it was required! Come to think of it, I've never needed it. Maybe it was because I compiled by command line. Since you are using Visual Studio, try: Code: #include "stdafx.h"
#include <iostream>
#include <cstdlib>
int main() {
std::cout << "C++ Testing";
system("pause");
return 0;
} As for stdafx.h, have you tried using something like /EHsc or /GX in the compiler/linker options? I don't remember where they go (I'm a big fan of the command line), but one should work. __________________ "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." -- Bjarne Stroustrup, creator of what is now known as C++ For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that. |
| The Following User Says Thank You to rpgfan3233 For This Useful Post: | ||
HelloWorld (07-19-2007) | ||
| ||||
| Quote:
|
| ||||
| Quote:
More information on /GX and what it means /GX (Enable Exception Handling) (C++) |
| |||
| stdafx.h isn't required in MSVC++ - You have to disable precompiled headers in order for the compiler to not complain about it. Look for the Precompiled Headers setting inside the C/C++ Configuration Properties for your project, and make sure its set to Not Using Precompiled Headers. Alternatively, when making a new project in MSVC++, start with a blank solution, as opposed to a Win32 Console Project (Which enables precompiled headers by default). Edit: By the way, if you don't want your console window to close when the program has finished running ( under MSVC++ ), use [CTRL] + [F5] to run your program (This option is known as "Start Without Debugging" under the Debug menu) Last edited by Bench : 07-19-2007 at 05:07 AM. |
| The Following User Says Thank You to Bench For This Useful Post: | ||
HelloWorld (07-19-2007) | ||
| ||||
| Quote:
![]() |
| |||
| here... ![]() |
| The Following User Says Thank You to Bench For This Useful Post: | ||
HelloWorld (07-19-2007) | ||
| |||
| hi,need some help i'm doing some work in opengl, glut and glui exactly is the libs i'm using...but the problem is this error that i can't fix to finish compiling my project. 1>------ Build started: Project: trab1, Configuration: Debug Win32 ------ 1>Compiling... 1>RGBpixmap.cpp 1>c:\program files\microsoft visual studio 8\vc\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs 1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\glut.h(146) : see declaration of 'exit' 1>trab1.cpp 1>c:\program files\microsoft visual studio 8\vc\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs 1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\glut.h(146) : see declaration of 'exit' 1>g:\leic\laso\20072008\trab1_2809\trab1.cpp(1085 ) : error C3861: 'exit': identifier not found |
| ||||
| seems there has something to do with ur header file stdlib.h, and some other .cpp files.. but I'm not sure what's the problem... I haven't had my OpenGL set up with my visual studio.. can you please post the code for ur header file? There may be someone here that can help you out *probable I can find out the problem too!!!* |
![]() |
| Thread Tools | |
| Display Modes | |
| |