LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Trouble Compiling a simple Hellow World on Solaris 9 with GCC 3.4.2 (http://www.linuxquestions.org/questions/solaris-opensolaris-20/trouble-compiling-a-simple-hellow-world-on-solaris-9-with-gcc-3-4-2-a-240981/)

jitendra64 10-10-2004 11:12 AM

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.

jlliagre 10-10-2004 01:03 PM

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 ...

jitendra64 10-11-2004 08:07 AM

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

jitendra64 10-11-2004 08:25 AM

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

jlliagre 10-11-2004 02:57 PM

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.


All times are GMT -5. The time now is 06:03 PM.