ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello.. just today I made my first program in C (with the help of the people in here) , but what I compile in C, when I try to compile in C++ (with c++ syntax and .cc suffix) returns me a hugh amount of errors ... and I don't know why.. I have searched using google, and I guess I've got all of the requied libraries..really don't know what to think..
Here I paste the error msg, if somebody can figure what's wrong, please let me know, coz I need to compile in c++ . Thanks in advance.
////// Error msg:
gcc: pr: No such file or directory // <- yes it's there!!
In file included from /usr/include/c++/3.3.4/backward/iostream.h:31,
from pr.cpp:2:
/usr/include/c++/3.3.4/backward/backward_warning.h:32:2: warning: #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 <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
In file included from /usr/include/bits/posix1_lim.h:126,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/include/limits.h:11,
from /usr/include/c++/3.3.4/climits:49,
from /usr/include/c++/3.3.4/bits/stl_algobase.h:66,
from /usr/include/c++/3.3.4/memory:54,
from /usr/include/c++/3.3.4/string:48,
from /usr/include/c++/3.3.4/bits/locale_classes.h:47,
from /usr/include/c++/3.3.4/bits/ios_base.h:47,
from /usr/include/c++/3.3.4/ios:49,
from /usr/include/c++/3.3.4/ostream:45,
from /usr/include/c++/3.3.4/iostream:45,
from /usr/include/c++/3.3.4/backward/iostream.h:32,
from pr.cpp:2:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
In file included from /usr/include/errno.h:36,
from /usr/include/c++/3.3.4/cerrno:48,
from /usr/include/c++/3.3.4/bits/locale_facets.tcc:38,
from /usr/include/c++/3.3.4/locale:47,
from /usr/include/c++/3.3.4/bits/ostream.tcc:37,
from /usr/include/c++/3.3.4/ostream:535,
from /usr/include/c++/3.3.4/iostream:45,
from /usr/include/c++/3.3.4/backward/iostream.h:32,
from pr.cpp:2:
/usr/include/bits/errno.h:25:26: linux/errno.h: No such file or directory
1. it helps to see the code, because we got no clue what your #include's look like
2. You are using deprecated header files in your includes like #include <iostream.h>
What you need to do is use #include <iostream>
3. The above is a general advice. Not all <xxx.h> headers are deprecated though so be careful.
You should remove the <cstdlib> include from the C++-version reddazz posted, it's not used in the program. And you should also consider flushing the output buffer or you might not see the output.
ok, pals..
I just fixed the problem: I've had not the kernel-headers library..
that's why I always recommend have in mind my minimal distro..
now it comes all the "deprecated" headers stuff, but they're just warnings -not fatal errors.
tons of thanks to all of you, and to gbonvehi as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.