A
A
appplemac2012-01-17 19:16:30
GCC
appplemac, 2012-01-17 19:16:30

Problem with gcc on Solaris 11?

Good day.
Today I installed Oracle Solaris 11 on the server, installed gcc with grief in half. After installing system/headers I tried to compile "Hello, World!" in C++ - and got the following message:

[email protected]:~$ gcc hw.cpp -o hw.cpp <br/>
Assembler: hw.cpp<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 121 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_onceP5_oncePFvvE,pthread_once&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 121 : Syntax error<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_onceP5_oncePFvvE,pthread_once&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 121 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_onceP5_oncePFvvE,pthread_once&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 121 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_onceP5_oncePFvvE,pthread_once&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 122 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 122 : Syntax error<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 122 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 122 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_getspecificj,pthread_getspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 123 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 123 : Syntax error<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 123 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 123 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 124 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_createPjPK13_pthread_attrPFPvS3_ES3_,pthread_create&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 124 : Syntax error<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_createPjPK13_pthread_attrPFPvS3_ES3_,pthread_create&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 124 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_createPjPK13_pthread_attrPFPvS3_ES3_,pthread_create&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 124 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_createPjPK13_pthread_attrPFPvS3_ES3_,pthread_create&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 125 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_joinjPPv,pthread_join&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 125 : Syntax error<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_joinjPPv,pthread_join&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 125 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_joinjPPv,pthread_join&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 125 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_joinjPPv,pthread_join&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 126 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL21__gthrw_pthread_equaljj,pthread_equal&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 126 : Syntax error<br/>
 Near line: &quot; .weakref _ZL21__gthrw_pthread_equaljj,pthread_equal&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 126 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL21__gthrw_pthread_equaljj,pthread_equal&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 126 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL21__gthrw_pthread_equaljj,pthread_equal&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 127 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_selfv,pthread_self&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 127 : Syntax error<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_selfv,pthread_self&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 127 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_selfv,pthread_self&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 127 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL20__gthrw_pthread_selfv,pthread_self&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 128 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_detachj,pthread_detach&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 128 : Syntax error<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_detachj,pthread_detach&quot;<br/>
 &quot;/var/tmp//ccN27OcI.s&quot;, line 128 : Illegal mnemonic<br/>
 Near line: &quot; .weakref _ZL22__gthrw_pthread_detachj,pthread_detach&quot;<br/>
Too many errors - Goodbye

Tell me, what can I do to make the programs compile without errors?
Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
Gribozavr, 2012-01-18
@appplemac

This assembler swears. Do you have as from binutils?

E
EaS, 2012-01-17
@EaS

It is unlikely to help, but why do you write to the same place where you get the sources from? Can
$ gcc hw.cpp -o hw

E
EaS, 2012-01-18
@EaS

try g++. gcc does not seem to link the standard library plus.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question