LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-23-2018, 04:55 PM   #1
Khadijah92706
LQ Newbie
 
Registered: Dec 2018
Location: USA
Posts: 2

Rep: Reputation: Disabled
issue with hello.cpp


I am trying to compile the hello.cpp program. I have the "std_lib_faci8lities.h" which I just downloaded today.

GNU nano 2.9.7 hello.cpp

// This program outputs "Hello, World" to screen

#include "std_lib_facilities.h"

int main() // C++ programs start by executing the function called main
{
cout <<"Hello, World!\n"; // output "Hello, World!"
return 0;
}


I get this result:

$ g++ hello.cpp
In file included from /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/ext/hash_map:60:0,
from /usr/include/std_lib_facilities.h:34,
from hello.cpp:3:
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/locale:41:0,
from /usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/iomanip:43,
from /usr/include/std_lib_facilities.h:212,
from hello.cpp:3:
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/bits/locale_facets_nonio.h:1971:5: error: template-id ‘do_get<>’ for ‘String std::messages<char>::do_get(std::messages_base::catalog, int, int, const String&) const’ does not match any template declaration
messages<char>::do_get(catalog, int, int, const string&) const;
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/include/c++/bits/locale_facets_nonio.h:1971:62: note: saw 1 ‘template<>’, need 2 for specializing a member function template
messages<char>::do_get(catalog, int, int, const string&) const;
 
Old 12-23-2018, 05:29 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I would ask this question on the cplusplus forum or a Cygwin forum or mailing list. Cygwin is not quite the same as Linux.

Also, there are plenty of internet pages that report problems with std_lib_facilities.h, e.g. https://stackoverflow.com/questions/...b-facilities-h.

You may have downloaded the wrong version or require a particular complication option.
 
Old 12-23-2018, 09:42 PM   #3
Khadijah92706
LQ Newbie
 
Registered: Dec 2018
Location: USA
Posts: 2

Original Poster
Rep: Reputation: Disabled
Ok. Thank you for pointing me in the correct direction. Much appreciated.
 
Old 12-28-2018, 08:27 AM   #4
milhan
Member
 
Registered: Sep 2005
Location: NH, USA
Distribution: Fedora 35
Posts: 49

Rep: Reputation: 1
Quote:
Originally Posted by Khadijah92706 View Post
I am trying to compile the hello.cpp program. I have the "std_lib_faci8lities.h" which I just downloaded today.

GNU nano 2.9.7 hello.cpp

// This program outputs "Hello, World" to screen

#include "std_lib_facilities.h"

int main() // C++ programs start by executing the function called main
{
cout <<"Hello, World!\n"; // output "Hello, World!"
return 0;
}
Why don't you include <iostream> instead of std_lib_facilities.h?
Code:
#include <iostream>

int main()
{
   cout << "Hello, World!\n"; // output "Hello, World!"
   return 0;
}
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ preprocessor "/lib/cpp" fails sanity check C++ preprocessor "/lib/cpp" fails san mutetikasikali Linux - Software 3 01-25-2014 06:57 AM
QTE Testing hello.cpp MKSrivastava Debian 0 01-27-2006 01:25 AM
cpp hello world not working harmster Programming 3 09-14-2004 02:21 PM
debian dpkg cpp depends on cpp error darkleaf Linux - Software 2 06-25-2004 01:47 AM
Now I have gcc/cpp/cpp, but still can't install sfingerh Linux - Software 2 07-30-2002 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration