LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-16-2005, 06:22 PM   #1
GlassEyeSlim
LQ Newbie
 
Registered: Feb 2005
Location: East Coast
Distribution: FC 3
Posts: 9

Rep: Reputation: 0
g++ Compiler Woes


I attempt to compile the following simple program:

Code:
#include <iostream>

using namespace std;

int main()
{

cout << "Hello, world!\n";

return 0;

}
using a variety of command-line variations for gcc and g++. The result is a rather lengthy list of errors that indicate failiure to declare a myriad of variables and a specific set of missing header files.

assert.h
ctype.h
features.h
iconv.h
langinfo.h
libintl.h
limits.h
locale.h
pthread.h
stdint.h
stdio.h
stdlib.h
string.h
time.h
unistd.h
wchar.h
wctype.h

I fail to find any of these h-files using a fresh locate db. Furthermore, I have been unable to ascertain where these files might be located...tar or rpm file?

Thoughts,

GES
 
Old 02-16-2005, 06:29 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
What command are you trying to type?. Try:

g++ -o test test.cc

that will create an executable called "test" (run it with ./test) and assumes that your source file is called "test.cc". If it fails, report the errors.

Good luck!
 
Old 02-18-2005, 12:15 AM   #3
GlassEyeSlim
LQ Newbie
 
Registered: Feb 2005
Location: East Coast
Distribution: FC 3
Posts: 9

Original Poster
Rep: Reputation: 0
Complete Output

Many thx for the help thus far...

The following is the output generated by a # of g++ command-line variations such as g++ test.cc, g++ -o test test.cc, ect.

If you trace through the long list of undefined variables you'll note a specific set of missing header files

assert.h
ctype.h
features.h
iconv.h
langinfo.h
libintl.h
limits.h
locale.h
pthread.h
stdint.h
stdio.h
stdlib.h
string.h
time.h
unistd.h
wchar.h
wctype.h

I'm currently searching for the lib file or set of lib files that will provide the missing header files.

Perhaps I'm way off the mark?

GES

[root@localhost codefiles]# g++ test.cc
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/c++config.h:35,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iostream:44,
from test.cc:4:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/os_defines.h:39:22: features.h: No such file or directory
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/c++locale.h:41,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ios:44,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from test.cc:4:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51:20: string.h: No such file or directory
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/c++locale.h:41,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ios:44,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from test.cc:4:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:79: error: `::memcpy' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:80: error: `::memmove' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:81: error: `::strcpy' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:82: error: `::strncpy' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:83: error: `::strcat' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:84: error: `::strncat' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:85: error: `::memcmp' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:86: error: `::strcmp' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:87: error: `::strcoll' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:88: error: `::strncmp' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:89: error: `::strxfrm' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:90: error: `::strcspn' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:91: error: `::strspn' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:92: error: `::strtok' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:93: error: `::memset' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:94: error: `::strerror' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:95: error: `::strlen' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:97: error: `::memchr' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring: In function `void* std::memchr(void*, int, size_t)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:101: error: invalid conversion from `const void*' to `void*'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:101: error: initializing argument 1 of `void* std::memchr(void*, int, size_t)'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring: At global scope:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:103: error: `::strchr' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:109: error: `::strpbrk' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:115: error: `::strrchr' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:121: error: `::strstr' has not been declared
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/c++locale.h:42,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ios:44,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from test.cc:4:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstdio:52:19: stdio.h: No such file or directory
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/c++locale.h:42,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iosfwd:46,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ios:44,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ostream:45,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iostream:45,
from test.cc:4:

BLOCK EXCLUDED TO ACCOMODATE SIZE LIMITS

/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: At global scope:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:52: error: `iconv_t' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:64: error: `__desc_type' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:66: error: `__desc_type' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:170: error: expected `;' before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:174: error: expected `;' before "const"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:174: error: expected `;' before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:178: error: expected `;' before "int"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In constructor `std::__enc_traits::__enc_traits()':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:76: error: class `std::__enc_traits' does not have any field named `_M_in_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:76: error: class `std::__enc_traits' does not have any field named `_M_out_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:78: error: `memset' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In constructor `std::__enc_traits::__enc_traits(const char*, const char*, int, int)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:84: error: class `std::__enc_traits' does not have any field named `_M_in_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:84: error: class `std::__enc_traits' does not have any field named `_M_out_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:86: error: `strncpy' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In copy constructor `std::__enc_traits::__enc_traits(const std::__enc_traits&)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:99: error: class `std::__enc_traits' does not have any field named `_M_in_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:99: error: class `std::__enc_traits' does not have any field named `_M_out_desc'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:101: error: `strncpy' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In member function `std::__enc_traits& std::__enc_traits:perator=(const std::__enc_traits&)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:113: error: `strncpy' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In member function `void std::__enc_traits::_M_init()':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:128: error: `__desc_type' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:129: error: `_M_in_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:131: error: `iconv_open' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:132: error: `__err' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:136: error: `_M_out_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In member function `void std::__enc_traits::_M_destroy()':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:148: error: `__desc_type' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:149: error: `_M_in_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:149: error: `__err' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:151: error: `iconv_close' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:154: error: `_M_out_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: In member function `bool std::__enc_traits::_M_good()':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:164: error: `__desc_type' does not name a type
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:165: error: `_M_in_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:165: error: `__err' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:166: error: `_M_out_desc' undeclared (first use this function)
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h: At global scope:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:208: error: type `std::__enc_traits' is not derived from type `std::codecvt<_InternT, _ExternT, std::__enc_traits>'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:208: error: expected `;' before "__desc_type"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: `std::__iconv_adaptor' declared as an `inline' variable
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: template declaration of `size_t std::__iconv_adaptor'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: `__func' was not declared in this scope
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: `iconv_t' was not declared in this scope
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before ',' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before ',' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before "char"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: expected primary-expression before ')' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:268: error: `(size_t)(<expression error>)' cannot be used as a function
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:269: error: `iconv_t' was not declared in this scope
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:269: error: expected primary-expression before "char"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:269: error: expected primary-expression before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:269: error: `__inbytes' was not declared in this scope
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:270: error: expected primary-expression before "char"
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:270: error: expected primary-expression before '*' token
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:270: error: `__outbytes' was not declared in this scope
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/i386-redhat-linux/bits/codecvt_specializations.h:271: confused by earlier errors, bailing out
[root@localhost codefiles]#
 
  


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
checking for C compiler default output... configure: error: C compiler cannot create fiorejm Linux - Software 6 11-12-2009 12:35 PM
Compiler woes KaMakani Linux - General 1 11-18-2005 12:54 PM
Compiler conundrum: Which came first, a compiler, or it's source code? fr0zen Programming 21 01-29-2004 04:31 AM
No compiler to compiler the compliler NewtonIX Linux - Newbie 13 11-03-2003 05:32 AM
compile a compiler without a compiler? lackluster Linux - General 18 01-02-2003 07:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:09 PM.

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