Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
02-15-2005, 11:06 AM
|
#1
|
Member
Registered: Oct 2004
Location: Canada
Distribution: Ubuntu
Posts: 330
Rep:
|
C++ Tutorial
Hi,
I am trying to learn C++. But I cannot seem to get the most basic program compiled.
I say #include < stdio.h >
and it says it cannot find it when compiled with gcc or cc.
if I do whereis stdio.h
it says
/usr/include/stdio.h
if I put the full path in the include statement, I get the same error. Someone please help.
David
Last edited by dlublink; 02-15-2005 at 11:19 AM.
|
|
|
02-15-2005, 12:35 PM
|
#2
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
it should be:
Code:
#include <stdio.h>
though if you're trying to do c++, it should just be <stdio>.
The full path will never work with <>, you'd want to just use "".
If it still doesn't compile, you might have to specify -I/usr/include, though you shouldn't have to.
|
|
|
02-15-2005, 12:57 PM
|
#3
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally posted by Matir
it should be:
Code:
#include <stdio.h>
though if you're trying to do c++, it should just be <stdio>.
The full path will never work with <>, you'd want to just use "".
If it still doesn't compile, you might have to specify -I/usr/include, though you shouldn't have to.
|
Are you SURE that it will like the html tags instead of
the < and > ?
Cheers,
Tink
|
|
|
02-15-2005, 01:05 PM
|
#4
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
You seem to be using C header files instead of C++. In C++ a simple hello world app would be similar to the one below.
#include <iostream>
using namespace std;
int main (void)
{
cout << "Hello, World!\n";
return 0;
}
|
|
|
02-15-2005, 01:40 PM
|
#5
|
Member
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666
Rep:
|
Use #include <cstdio> instead of #include <stdio.h>
If I'm right, stdio is deprecated.
|
|
|
All times are GMT -5. The time now is 02:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|