LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 10-10-2004, 11:12 AM   #1
jitendra64
LQ Newbie
 
Registered: Oct 2004
Location: MD
Posts: 3

Rep: Reputation: 0
Trouble Compiling a simple Hellow World on Solaris 9 with GCC 3.4.2


Here is my simpel source
#include <iostream>

using namespace std;

int main(){
cout << "Hello World..."<<endl;
return 0;
}
# g++ -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.2

Now here is the output it spews when I try to compile using
g++ -o test test.cpp

In file included from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/spar
c-sun-solaris2.9/bits/c++locale.h:41,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iosf
wd:46,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ios:
44,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ostr
eam:45,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iost
ream:45,
from test.cpp:1:
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/clocale:49:20: locale.h: N
o such file or directory
In file included from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/spar
c-sun-solaris2.9/bits/c++locale.h:41,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iosf
wd:46,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ios:
44,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ostr
eam:45,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iost
ream:45,
from test.cpp:1:
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/clocale:57: error: `::lcon
v' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/clocale:58: error: `::setl
ocale' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/clocale:59: error: `::loca
leconv' has not been declared
In file included from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/spar
c-sun- from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iosf
wd:46,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ios:
44,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ostr
eam:45,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iost
ream:45,
from test.cpp:1:
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/cstring:51:20: string.h: N
o such file or directory
In file included from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/spar
c-sun-solaris2.9/bits/c++locale.h:42,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iosf
wd:46,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ios:
44,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/ostr
eam:45,
from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/iost
ream:45,
from test.cpp:1:
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/cstring:79: error: `::memc
py' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/cstring:80: error: `::memm
ove' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/cstring:81: error: `::strc
py' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/../../../../include/c++/3.4.2/cstring:82: error: `::strn
cpy' has not been declared
solaris2.9/bits/c++locale.h:42,



and it goes on...
Need help. It has been a long time since I used GNU Compilers. The last was 2.9.5.
 
Old 10-10-2004, 01:03 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
It looks like an incomplete installation or a bad build.
Where did you get that one ?
I would suggest you to install gcc 3.4.1 from blastwave.org that works fine for me.

Last advice, it's a bad idea to name a program with the same name as a shell builtin, as it can lead to surprises ...

Last edited by jlliagre; 10-10-2004 at 02:31 PM.
 
Old 10-11-2004, 08:07 AM   #3
jitendra64
LQ Newbie
 
Registered: Oct 2004
Location: MD
Posts: 3

Original Poster
Rep: Reputation: 0
The source file is named test, not source. I got the build from SunFreeware.com. Idon't know where else to turn, may be you know of some. Please let me know.
Thanks,
Jit
 
Old 10-11-2004, 08:25 AM   #4
jitendra64
LQ Newbie
 
Registered: Oct 2004
Location: MD
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the info. Looking into the site BlastWave.org. Looks great but my only concern is that the note on the suggestion to download the unstable(untested) versions of the software. Which versions do you have installed are those the stable or unstable.
Jit
 
Old 10-11-2004, 02:57 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
The source file is named test, not source.
That was precisely my point, test *is* a shell builtin, and, quite a while ago, I named one of my programs test, then was puzzled that when compiled, it produced no output without failing while running under a debugger, it worked fine...
No problem running it with a full path or ./test though.
Quote:
Which versions do you have installed are those the stable or unstable.
I installed the stable one, and had no problem so far.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 11:38 AM
Compiling a program with gcc on Solaris (I think) phekno Programming 2 09-15-2004 01:39 PM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
gcc on Solaris g_goblin Solaris / OpenSolaris 7 10-30-2003 12:09 PM
Something wrong with this simple hello world prog mandrakeroot Programming 9 08-26-2003 05:24 PM


All times are GMT -5. The time now is 01:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration