Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

vassago74

Trouble compiling in Dev C++

This topic is 5401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <iostream.h> void main () { cout << 10 % 8 << endl; } --Having trouble compiling the program above. I''m new to Dev C++ and any help would be appreciated. After I compile the program a tab for iostream.h pops up and the errors are as follows... 31 C:\Dev-Cpp\include\c++\backward\iostream.h In file included from C:/Dev-Cpp/include/c++/backward/iostream.h 1 C:\Documents and Settings\Nelson Marques\Desktop\test.cpp from C:/Documents and Settings/Nelson Marques/Desktop/test.cpp 2 C:\Dev-Cpp\include\c++\backward\backward_warning.h:32 #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. 4 C:\Documents and Settings\Nelson Marques\Desktop\test.cpp `main'' must return --NM

Share this post


Link to post
Share on other sites
Advertisement
Use of the old-style .h headers is deprecated. use #include < iostream > instead.

Also, declare main as:

int main()

or

int main(int argc, char *argv[])

rather than void.

Josh
vertexnormal AT linuxmail DOT org


Check out Golem at:
My cheapass website

[edited by - VertexNormal on September 3, 2003 7:48:02 PM]

Share this post


Link to post
Share on other sites
Also remember that the new style headers use namespaces, so you either have to put "using namespace std;" to use cout, or you can use the scope resolution operator as in "std::cout << 10 % 8 << endl;"

Share this post


Link to post
Share on other sites
actually, now i''m getting a few different errors... here they are...

C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
[Warning] In function:

5 C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
`cout''

5 C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
(Each

5 C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
`endl''

Share this post


Link to post
Share on other sites
#include <iostream>

int main ()
{
std::cout << 10 % 8 << endl;
}



Ok, the above program still getting these errors..

C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
[Warning] In function:

5 C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
`endl''

5 C:\Documents and Settings\Nelson Marques\Desktop\Untitled1.cpp
(Each

Share this post


Link to post
Share on other sites
I'm sorry, i forgot about endl. If you don't use namespaces, you have to use scope resolution for all objects you use from other libraries, and that includes endl. Try this:

#include <iostream>

int main ()
{
std::cout << 10 % 8 << std::endl;
}



[edited by - Vikato on September 3, 2003 8:05:45 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!