Fedora Linux Support Community & Resources Center
  #1  
Old 13th June 2004, 03:31 AM
LackeyLad's Avatar
LackeyLad Offline
Registered User
 
Join Date: Feb 2004
Location: Bg, Ohio
Age: 31
Posts: 426
g++ questions

1. Does anyone know of a site where i can research why i get the -Wno deprecated messege on my g++? Something about not needed to add the .h precompiler libraries.

2. Also, i cant seem to compile anything that uses the # include <string> library. Why does that not compile with fedora g++?
Reply With Quote
  #2  
Old 13th June 2004, 03:39 AM
ghaefb's Avatar
ghaefb Offline
Retired Community Manager
 
Join Date: Apr 2004
Location: Slovenia
Age: 30
Posts: 1,713
Maybe you forgot to write this line:

using namespace std;

And you wrote #include <string> right? (not # include <string>)
__________________
_ghaefb


blog & sysinfo
Reply With Quote
  #3  
Old 13th June 2004, 03:40 AM
micha's Avatar
micha Offline
Registered User
 
Join Date: Feb 2004
Location: France
Age: 35
Posts: 533
1. What is the error you get? Look at the gcc manual on the gcc web site, you might find some useful information. http://gcc.gnu.org

2. The C++ Standard Library (including <string>) works well for me. Make sure that everything related to gcc and C++ library is installed.

--Micha
Reply With Quote
  #4  
Old 13th June 2004, 03:45 AM
LackeyLad's Avatar
LackeyLad Offline
Registered User
 
Join Date: Feb 2004
Location: Bg, Ohio
Age: 31
Posts: 426
does the space between the # and include matter?
Reply With Quote
  #5  
Old 13th June 2004, 03:53 AM
Ug's Avatar
Ug Offline
Retired Community Manager
 
Join Date: Feb 2004
Posts: 2,999
Yes it does, your code should look like this:
Code:
#include <string.h>
__________________
gareth@fedoraforum.org
Registered Linux User # 301555
garethrussell.net


Please adhere to the FedoraForum Guidelines.
Reply With Quote
  #6  
Old 13th June 2004, 04:01 AM
micha's Avatar
micha Offline
Registered User
 
Join Date: Feb 2004
Location: France
Age: 35
Posts: 533
Or if you use C++ Standard Library:
Code:
#include <string>
std::string my_string;
You don't need the .h extension for the C++ standard library. There is a "bridge" for the inclusion of C standard library in standard C++:
Code:
#include <cstdlib>
#include <cmath>
...
--Micha

Last edited by micha; 13th June 2004 at 04:03 AM.
Reply With Quote
  #7  
Old 16th June 2004, 06:29 PM
theurge's Avatar
theurge Offline
Registered User
 
Join Date: Mar 2004
Location: Kansas City, USA
Age: 36
Posts: 46
This also works:

Code:
#include <string>
using std::string;
That way you don't have the increased overhead with "using namespace std" and you don't have to scope every single string you create.
Reply With Quote
Reply

Tags
questions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me with some questions Nitrub Using Fedora 3 28th October 2007 01:58 PM
vnc questions dan sawyer Using Fedora 3 16th October 2007 05:55 PM
some questions about Xen cjzjm100 Using Fedora 2 3rd October 2007 06:43 AM
I have some questions deepfreeze Using Fedora 1 9th March 2006 04:59 PM
A few little questions OldSlacker Using Fedora 2 7th February 2006 04:45 AM


Current GMT-time: 08:43 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat