public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Compilation error
@ 2000-02-21 10:27 Jose Miguel A.C.Pires
  2000-02-21 10:39 ` llewelly
  2000-04-01  0:00 ` Jose Miguel A.C.Pires
  0 siblings, 2 replies; 24+ messages in thread
From: Jose Miguel A.C.Pires @ 2000-02-21 10:27 UTC (permalink / raw)
  To: help-gcc

*This message was transferred with a trial version of CommuniGate(tm) Pro*
Hello

I'm trying to compile this simple program

#include <stdio.h>
#include <math.h>

int main(void)
{
  float r=2;

  printf("A raiz de %2.0f e' %.6f", r, sqrt(r));

  return 0;
}

but i get the following errors.

/tmp/cca110161.o: In function `main':
/tmp/cca110161.o(.text+0x17): undefined reference to `sqrt'

I belive it's easy to solve but i have no one nearby to help
me. Thanks in advance.

J. M. Correia Pires


-- 
------------------------------------------------------------------------

Jose' Miguel A. Correia Pires
Departamento de Fisica - Universidade do Minho
Largo do Paco
PT-4700-320 BRAGA (PORTUGAL)
Phone: 351-253604320  Fax: 351-253678981
e-mail: jmcp@ci.uminho.pt

-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation error
  2000-02-21 10:27 Compilation error Jose Miguel A.C.Pires
@ 2000-02-21 10:39 ` llewelly
  2000-04-01  0:00   ` llewelly
  2000-04-01  0:00 ` Jose Miguel A.C.Pires
  1 sibling, 1 reply; 24+ messages in thread
From: llewelly @ 2000-02-21 10:39 UTC (permalink / raw)
  To: Jose Miguel A.C.Pires; +Cc: help-gcc

On Mon, 21 Feb 2000, Jose Miguel A.C.Pires wrote:

> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hello
> 
> I'm trying to compile this simple program
> 
> #include <stdio.h>
> #include <math.h>
> 
> int main(void)
> {
>   float r=2;
> 
>   printf("A raiz de %2.0f e' %.6f", r, sqrt(r));
> 
>   return 0;
> }
> 
> but i get the following errors.
> 
> /tmp/cca110161.o: In function `main':
> /tmp/cca110161.o(.text+0x17): undefined reference to `sqrt'
> 

Add -lm to your link line:

$gcc foo.c -lm

(-lm means 'link libm.[so,a] . libm is the math library.')

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Compilation error
  2000-02-21 10:27 Compilation error Jose Miguel A.C.Pires
  2000-02-21 10:39 ` llewelly
@ 2000-04-01  0:00 ` Jose Miguel A.C.Pires
  1 sibling, 0 replies; 24+ messages in thread
From: Jose Miguel A.C.Pires @ 2000-04-01  0:00 UTC (permalink / raw)
  To: help-gcc

*This message was transferred with a trial version of CommuniGate(tm) Pro*
Hello

I'm trying to compile this simple program

#include <stdio.h>
#include <math.h>

int main(void)
{
  float r=2;

  printf("A raiz de %2.0f e' %.6f", r, sqrt(r));

  return 0;
}

but i get the following errors.

/tmp/cca110161.o: In function `main':
/tmp/cca110161.o(.text+0x17): undefined reference to `sqrt'

I belive it's easy to solve but i have no one nearby to help
me. Thanks in advance.

J. M. Correia Pires


-- 
------------------------------------------------------------------------

Jose' Miguel A. Correia Pires
Departamento de Fisica - Universidade do Minho
Largo do Paco
PT-4700-320 BRAGA (PORTUGAL)
Phone: 351-253604320  Fax: 351-253678981
e-mail: jmcp@ci.uminho.pt

-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation error
  2000-02-21 10:39 ` llewelly
@ 2000-04-01  0:00   ` llewelly
  0 siblings, 0 replies; 24+ messages in thread
From: llewelly @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Jose Miguel A.C.Pires; +Cc: help-gcc

On Mon, 21 Feb 2000, Jose Miguel A.C.Pires wrote:

> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hello
> 
> I'm trying to compile this simple program
> 
> #include <stdio.h>
> #include <math.h>
> 
> int main(void)
> {
>   float r=2;
> 
>   printf("A raiz de %2.0f e' %.6f", r, sqrt(r));
> 
>   return 0;
> }
> 
> but i get the following errors.
> 
> /tmp/cca110161.o: In function `main':
> /tmp/cca110161.o(.text+0x17): undefined reference to `sqrt'
> 

Add -lm to your link line:

$gcc foo.c -lm

(-lm means 'link libm.[so,a] . libm is the math library.')

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-17  7:23               ` Marc Glisse
@ 2012-08-17  8:23                 ` Jonathan Wakely
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Wakely @ 2012-08-17  8:23 UTC (permalink / raw)
  To: gcc-help; +Cc: ron.stubbs

On 16 August 2012 21:18, Marc Glisse wrote:
> On Thu, 16 Aug 2012, Ron Stubbs wrote:
>
>> I fixed my  libmpfr problem by installing mprf 3.0.
>
>
> Why not follow this instead:
> http://gcc.gnu.org/wiki/InstallingGCC
>
>
>> Neither 2.2 nor 2.4 had the missing symbol.
>
>
> And the mpfr.h that comes with the library that doesn't have the symbol
> doesn't ask for it.
>
>
>> I compiled until I got close to the end and got this message:
>>
>> checking for suffix of object files... configure: error: in
>> `/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc':
>> configure: error: cannot compute suffix of object files: cannot compile
>
>
> See the FAQ:
> http://gcc.gnu.org/wiki/FAQ#configure_suffix

You've been sent the same links previously, please read them.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-17  0:12             ` Ron Stubbs
@ 2012-08-17  7:23               ` Marc Glisse
  2012-08-17  8:23                 ` Jonathan Wakely
  0 siblings, 1 reply; 24+ messages in thread
From: Marc Glisse @ 2012-08-17  7:23 UTC (permalink / raw)
  To: ron.stubbs; +Cc: gcc-help

On Thu, 16 Aug 2012, Ron Stubbs wrote:

> I fixed my  libmpfr problem by installing mprf 3.0.

Why not follow this instead:
http://gcc.gnu.org/wiki/InstallingGCC

> Neither 2.2 nor 2.4 had the missing symbol.

And the mpfr.h that comes with the library that doesn't have the symbol 
doesn't ask for it.

> I compiled until I got close to the end and got this message:
>
> checking for suffix of object files... configure: error: in
> `/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc':
> configure: error: cannot compute suffix of object files: cannot compile

See the FAQ:
http://gcc.gnu.org/wiki/FAQ#configure_suffix

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-16 20:06           ` Marc Glisse
@ 2012-08-17  0:12             ` Ron Stubbs
  2012-08-17  7:23               ` Marc Glisse
  0 siblings, 1 reply; 24+ messages in thread
From: Ron Stubbs @ 2012-08-17  0:12 UTC (permalink / raw)
  To: gcc-help

Hi,

I fixed my  libmpfr problem by installing mprf 3.0. Neither 2.2 nor 2.4 
had the missing symbol.

I compiled until I got close to the end and got this message:

checking for suffix of object files... configure: error: in
`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile

Thanks,
Ron

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Stubbs MS CS
Senior Systems Programmer
Research Computing
Pratt School of Engineering
410 Teer Bldg. P.O. Box 90271
Duke University, Durham, N.C. 27708-0271
office: (919)660-5339   cell:(919)641-5689
fax: (919) 613-9156
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

On 08/16/2012 02:58 PM, Marc Glisse wrote:
> On Thu, 16 Aug 2012, Ron Stubbs wrote:
>
>> All I've got is /usr/lib64/libmpfr.so -> /usr/lib64/libmpfr.so.1.2.0. in
>> /usr/lib64
>
> What about the mpfr.h files?
>
> If you can't find the second one, touch the file arith.c, type make,
> see how arith.o is produced, copy that line and modify it to see the
> preprocessed source, and find out what mpfr file is included and where
> the bad name appears.
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-16 13:29         ` Ron Stubbs
  2012-08-16 15:15           ` Tim Prince
@ 2012-08-16 20:06           ` Marc Glisse
  2012-08-17  0:12             ` Ron Stubbs
  1 sibling, 1 reply; 24+ messages in thread
From: Marc Glisse @ 2012-08-16 20:06 UTC (permalink / raw)
  To: ron.stubbs; +Cc: gcc-help

On Thu, 16 Aug 2012, Ron Stubbs wrote:

> All I've got is /usr/lib64/libmpfr.so -> /usr/lib64/libmpfr.so.1.2.0. in
> /usr/lib64

What about the mpfr.h files?

If you can't find the second one, touch the file arith.c, type make, see 
how arith.o is produced, copy that line and modify it to see the 
preprocessed source, and find out what mpfr file is included and where the 
bad name appears.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-16 13:29         ` Ron Stubbs
@ 2012-08-16 15:15           ` Tim Prince
  2012-08-16 20:06           ` Marc Glisse
  1 sibling, 0 replies; 24+ messages in thread
From: Tim Prince @ 2012-08-16 15:15 UTC (permalink / raw)
  To: gcc-help

On 08/16/2012 06:57 AM, Ron Stubbs wrote:
> All I've got is /usr/lib64/libmpfr.so ->  /usr/lib64/libmpfr.so.1.2.0. in
> /usr/lib64
>
> Is this the correct libmpfr version?
>
>
That is an old one.  Evidently, it doesn't include all functions 
expected by gcc build.  The script which comes with gcc 
(contrib/download_prerequisites) adds the expected versions of gmp, mpc, 
and mpfr to the gcc build (or you can build separately and update your 
installation).

-- 
Tim Prince

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-16  3:59       ` Marc Glisse
@ 2012-08-16 13:29         ` Ron Stubbs
  2012-08-16 15:15           ` Tim Prince
  2012-08-16 20:06           ` Marc Glisse
  0 siblings, 2 replies; 24+ messages in thread
From: Ron Stubbs @ 2012-08-16 13:29 UTC (permalink / raw)
  To: gcc-help

All I've got is /usr/lib64/libmpfr.so -> /usr/lib64/libmpfr.so.1.2.0. in
/usr/lib64

Is this the correct libmpfr version?

/usr/lib64 is on the first line on ld.so.conf

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Stubbs MS CS
Senior Systems Programmer
Research Computing
Pratt School of Engineering
410 Teer Bldg. P.O. Box 90271
Duke University, Durham, N.C. 27708-0271
office: (919)660-5339   cell:(919)641-5689
fax: (919) 613-9156
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

On 08/15/2012 03:35 PM, Marc Glisse wrote:
> On Wed, 15 Aug 2012, Ron Stubbs wrote:
>
>> arith.c:(.text+0x1169): undefined reference to `mpfr_get_z_2exp'
> [...]
>> Suggestions?
>
> You have 2 versions of mpfr on that computer. Remove one.
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-15 19:36     ` Ron Stubbs
@ 2012-08-16  3:59       ` Marc Glisse
  2012-08-16 13:29         ` Ron Stubbs
  0 siblings, 1 reply; 24+ messages in thread
From: Marc Glisse @ 2012-08-16  3:59 UTC (permalink / raw)
  To: ron.stubbs; +Cc: gcc-help

On Wed, 15 Aug 2012, Ron Stubbs wrote:

> arith.c:(.text+0x1169): undefined reference to `mpfr_get_z_2exp'
[...]
> Suggestions?

You have 2 versions of mpfr on that computer. Remove one.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Compilation Error
  2012-08-15 17:57   ` Jonathan Wakely
  2012-08-15 18:03     ` Compilation Error Ron Stubbs
@ 2012-08-15 19:36     ` Ron Stubbs
  2012-08-16  3:59       ` Marc Glisse
  1 sibling, 1 reply; 24+ messages in thread
From: Ron Stubbs @ 2012-08-15 19:36 UTC (permalink / raw)
  To: gcc-help

Hi,

I get the following errors when building gcc-4.8-20120812:
======================================
fortran/arith.o: In function `gfc_mpfr_to_mpz(__mpz_struct*,
__mpfr_struct*, locus*)':
arith.c:(.text+0x1169): undefined reference to `mpfr_get_z_2exp'
collect2: error: ld returned 1 exit status
make[3]: *** [f951] Error 1

========================================

Suggestions?

Thanks,
Ron

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Stubbs MS CS
Senior Systems Programmer
Research Computing
Pratt School of Engineering
410 Teer Bldg. P.O. Box 90271
Duke University, Durham, N.C. 27708-0271
office: (919)660-5339   cell:(919)641-5689
fax: (919) 613-9156
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
       [not found]         ` <CAH6eHdRV5NLCO-+iJw1FHqw+6EV-LSCNkhF-SJ0jZUPtdbwFKQ@mail.gmail.com>
@ 2012-08-15 19:25           ` Jonathan Wakely
  0 siblings, 0 replies; 24+ messages in thread
From: Jonathan Wakely @ 2012-08-15 19:25 UTC (permalink / raw)
  To: B B; +Cc: ron.stubbs, gcc-help

Resending as plain text mail....

On 15/08/2012, Jonathan Wakely wrote:
> On Wednesday, 15 August 2012, B B <dev@thecercle.org> wrote:
>> I guess for Scientific Linux it's something like
>> yum -y install glibc-devel
>>
>> ...?
>
>
> glibc-devel.i686
>
>
>
>> B.
>>
>>
>> On 8/15/12 7:57 PM, "Ron Stubbs" <rons@duke.edu> wrote:
>>
>>>Hi,
>>>
>>>I get the following errors when building gcc-4.8-20120812:
>>>======================================
>>>In file included from /usr/include/features.h:385:0,
>>>                 from /usr/include/stdio.h:28,
>>>                 from ../../.././libgcc/../gcc/tsystem.h:88,
>>>                 from ../../.././libgcc/libgcc2.c:29:
>>>/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
>>>or directory
>>> # include <gnu/stubs-32.h>
>>>                           ^
>>>compilation terminated.
>>>make[5]: *** [_muldi3.o] Error 1
>>>make[5]: Leaving directory
>>>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/32/libgcc'
>>>make[4]: *** [multi-do] Error 1
>>>make[4]: Leaving directory
>>>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
>>>make[3]: *** [all-multi] Error 2
>>>make[3]: Leaving directory
>>>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
>>>make[2]: *** [all-stage1-target-libgcc] Error 2
>>>make[2]: Leaving directory `/opt/gcc-4.8-20120812'
>>>make[1]: *** [stage1-bubble] Error 2
>>>make[1]: Leaving directory `/opt/gcc-4.8-20120812'
>>>make: *** [all] Error 2
>>>========================================
>>>
>>>Suggestions?
>>>
>>>Thanks,
>>>Ron
>>>
>>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>Ron Stubbs MS CS
>>>Senior Systems Programmer
>>>Research Computing
>>>Pratt School of Engineering
>>>410 Teer Bldg. P.O. Box 90271
>>>Duke University, Durham, N.C. 27708-0271
>>>office: (919)660-5339   cell:(919)641-5689
>>>fax: (919) 613-9156
>>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-15 18:03     ` Compilation Error Ron Stubbs
  2012-08-15 18:14       ` Marc Glisse
@ 2012-08-15 18:46       ` B B
       [not found]         ` <CAH6eHdRV5NLCO-+iJw1FHqw+6EV-LSCNkhF-SJ0jZUPtdbwFKQ@mail.gmail.com>
  1 sibling, 1 reply; 24+ messages in thread
From: B B @ 2012-08-15 18:46 UTC (permalink / raw)
  To: ron.stubbs; +Cc: gcc-help

I guess for Scientific Linux it's something like
yum -y install glibc-devel

...?
B.


On 8/15/12 7:57 PM, "Ron Stubbs" <rons@duke.edu> wrote:

>Hi,
>
>I get the following errors when building gcc-4.8-20120812:
>======================================
>In file included from /usr/include/features.h:385:0,
>                 from /usr/include/stdio.h:28,
>                 from ../../.././libgcc/../gcc/tsystem.h:88,
>                 from ../../.././libgcc/libgcc2.c:29:
>/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
>or directory
> # include <gnu/stubs-32.h>
>                           ^
>compilation terminated.
>make[5]: *** [_muldi3.o] Error 1
>make[5]: Leaving directory
>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/32/libgcc'
>make[4]: *** [multi-do] Error 1
>make[4]: Leaving directory
>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
>make[3]: *** [all-multi] Error 2
>make[3]: Leaving directory
>`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
>make[2]: *** [all-stage1-target-libgcc] Error 2
>make[2]: Leaving directory `/opt/gcc-4.8-20120812'
>make[1]: *** [stage1-bubble] Error 2
>make[1]: Leaving directory `/opt/gcc-4.8-20120812'
>make: *** [all] Error 2
>========================================
>
>Suggestions?
>
>Thanks,
>Ron
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Ron Stubbs MS CS
>Senior Systems Programmer
>Research Computing
>Pratt School of Engineering
>410 Teer Bldg. P.O. Box 90271
>Duke University, Durham, N.C. 27708-0271
>office: (919)660-5339   cell:(919)641-5689
>fax: (919) 613-9156
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation Error
  2012-08-15 18:03     ` Compilation Error Ron Stubbs
@ 2012-08-15 18:14       ` Marc Glisse
  2012-08-15 18:46       ` B B
  1 sibling, 0 replies; 24+ messages in thread
From: Marc Glisse @ 2012-08-15 18:14 UTC (permalink / raw)
  To: ron.stubbs; +Cc: gcc-help

On Wed, 15 Aug 2012, Ron Stubbs wrote:

> /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
> or directory
[...]
> Suggestions?

Yes, install that file (through your distribution) or disable multilib.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Compilation Error
  2012-08-15 17:57   ` Jonathan Wakely
@ 2012-08-15 18:03     ` Ron Stubbs
  2012-08-15 18:14       ` Marc Glisse
  2012-08-15 18:46       ` B B
  2012-08-15 19:36     ` Ron Stubbs
  1 sibling, 2 replies; 24+ messages in thread
From: Ron Stubbs @ 2012-08-15 18:03 UTC (permalink / raw)
  To: gcc-help

Hi,

I get the following errors when building gcc-4.8-20120812:
======================================
In file included from /usr/include/features.h:385:0,
                 from /usr/include/stdio.h:28,
                 from ../../.././libgcc/../gcc/tsystem.h:88,
                 from ../../.././libgcc/libgcc2.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
 # include <gnu/stubs-32.h>
                           ^
compilation terminated.
make[5]: *** [_muldi3.o] Error 1
make[5]: Leaving directory
`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/32/libgcc'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory
`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory
`/opt/gcc-4.8-20120812/x86_64-unknown-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/opt/gcc-4.8-20120812'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/gcc-4.8-20120812'
make: *** [all] Error 2
========================================

Suggestions?

Thanks,
Ron

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Stubbs MS CS
Senior Systems Programmer
Research Computing
Pratt School of Engineering
410 Teer Bldg. P.O. Box 90271
Duke University, Durham, N.C. 27708-0271
office: (919)660-5339   cell:(919)641-5689
fax: (919) 613-9156
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: compilation error
  2011-06-08 12:25 Rony Paul
  2011-06-08 13:31 ` Jonathan Wakely
@ 2011-06-08 13:47 ` Ian Lance Taylor
  1 sibling, 0 replies; 24+ messages in thread
From: Ian Lance Taylor @ 2011-06-08 13:47 UTC (permalink / raw)
  To: Rony Paul; +Cc: gcc-help

Rony Paul <ronypaul77@gmail.com> writes:

> else if (codel == POINTER_TYPE && coder == INTEGER_TYPE)
>     {
>       /* An explicit constant 0 can convert to a pointer,
> 	 or one that results from arithmetic, even including
> 	 a cast to integer type.  */
>
>              tree ttl = TREE_TYPE (type);
> 	      tree ttr = TREE_TYPE (rhstype);

If you want to change gcc, you will need to learn to use the debugger to
solve problems like this.

However, in this case I'll tell you for free that asking for the
TREE_TYPE of an INTEGER_TYPE makes no sense.  The TREE_TYPE of a
POINTER_TYPE is the type to which it points, but there is nothing in the
TREE_TYPE of an INTEGER_TYPE.

Ian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: compilation error
  2011-06-08 12:25 Rony Paul
@ 2011-06-08 13:31 ` Jonathan Wakely
  2011-06-08 13:47 ` Ian Lance Taylor
  1 sibling, 0 replies; 24+ messages in thread
From: Jonathan Wakely @ 2011-06-08 13:31 UTC (permalink / raw)
  To: Rony Paul; +Cc: gcc-help

On 8 June 2011 12:09, Rony Paul wrote:
>
> could you please tell me what type of error is the following code returning?

It looks as though you're dereferencing a null pointer.  Find out
which line it segfaults on and add checks to ensure the relevant tree
variable is not null before using it.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* compilation error
@ 2011-06-08 12:25 Rony Paul
  2011-06-08 13:31 ` Jonathan Wakely
  2011-06-08 13:47 ` Ian Lance Taylor
  0 siblings, 2 replies; 24+ messages in thread
From: Rony Paul @ 2011-06-08 12:25 UTC (permalink / raw)
  To: gcc-help

Dear All,

could you please tell me what type of error is the following code returning?

make[5]: Entering directory `/home/kosarker/Work/build-gcc/gcc'
/home/kosarker/Work/build-gcc/./gcc/xgcc
-B/home/kosarker/Work/build-gcc/./gcc/ -B/usr/local/spu/bin/
-B/usr/local/spu/lib/ -isystem /usr/local/spu/include -isystem
/usr/local/spu/sys-include    -O2 -g -O2 -DIN_GCC
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -I.
-I/home/kosarker/Work/build-gcc/spu/mea64/libgcc -I../../gcc-4.5.0/gcc
-I../../gcc-4.5.0/gcc//home/kosarker/Work/build-gcc/spu/mea64/libgcc
-I../../gcc-4.5.0/gcc/../include
-I../../gcc-4.5.0/gcc/../libcpp/include
-I../../gcc-4.5.0/gcc/../libdecnumber
-I../../gcc-4.5.0/gcc/../libdecnumber/dpd -I../libdecnumber    -g -O2
-mea64 -g0 -finhibit-size-directive -fno-inline -fno-exceptions
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize
-Dinhibit_libc  \
	  -c ../../gcc-4.5.0/gcc/crtstuff.c -DCRT_BEGIN \
	  -o /home/kosarker/Work/build-gcc/spu/mea64/libgcc/crtbegin.o
../../gcc-4.5.0/gcc/crtstuff.c:249:1: internal compiler error:
Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[5]: *** [/home/kosarker/Work/build-gcc/spu/mea64/libgcc/crtbegin.o] Error 1
make[5]: Leaving directory `/home/kosarker/Work/build-gcc/gcc'
make[4]: *** [gcc-extra-parts] Error 2
make[4]: Leaving directory `/home/kosarker/Work/build-gcc/spu/mea64/libgcc'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/home/kosarker/Work/build-gcc/spu/libgcc'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/home/kosarker/Work/build-gcc/spu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/kosarker/Work/build-gcc'
make: *** [all] Error 2


----------------------------------------------------------------------------------------------------------------------------------------------
what I did that in the file c-typeck.c I have added some code, like following :

previously it was :

else if (codel == POINTER_TYPE && coder == INTEGER_TYPE)
    {
      /* An explicit constant 0 can convert to a pointer,
	 or one that results from arithmetic, even including
	 a cast to integer type.  */
	
		WARN_FOR_ASSIGNMENT (location, 0,
			     G_("passing argument %d of %qE makes "
				"pointer from integer without a cast"),
			     G_("assignment makes pointer from integer "
				"without a cast//// konica diff address space"),
			     G_("initialization makes pointer from "
				"integer without a cast"),
			     G_("return makes pointer from integer "
				"without a cast"));
			
		}



I have replaced it with :


else if (codel == POINTER_TYPE && coder == INTEGER_TYPE)
    {
      /* An explicit constant 0 can convert to a pointer,
	 or one that results from arithmetic, even including
	 a cast to integer type.  */

             tree ttl = TREE_TYPE (type);
	      tree ttr = TREE_TYPE (rhstype);
	      tree mvl = ttl;
	      tree mvr = ttr;
	      bool is_opaque_pointer;
	      int target_cmp = 0;   /* Cache comp_target_types () result.  */
	      addr_space_t asl;
	      addr_space_t asr;

   	      asl = TYPE_ADDR_SPACE (ttl);
	      asr = TYPE_ADDR_SPACE (ttr);

		if (asr != asl )
		{
		
		    WARN_FOR_ASSIGNMENT (location, 0,
			     G_("passing argument %d of %qE makes "
				"pointer from integer without a cast"),
			     G_("assignment makes pointer from integer "
				"without a cast"),
			     G_("initialization makes pointer from "
				"integer without a cast"),
			     G_("return makes pointer from integer "
				"without a cast"));
			
		}

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: compilation error
  2006-10-07 18:58 compilation error ranjith kumar
@ 2006-10-07 19:36 ` Tim Prince
  0 siblings, 0 replies; 24+ messages in thread
From: Tim Prince @ 2006-10-07 19:36 UTC (permalink / raw)
  To: ranjith kumar; +Cc: gcc-help

ranjith kumar wrote:
> Hi,
> -------------------------------------------------------
> #include <mmintrin.h>
> int  main()
> {
>    __m64 m1 = 0x00ff00a300bc00ae;
>    __m64 m2 = 0x0001000100010001;
>  __m64 m3;
>    unsigned char *data;
>    unsigned char ch;
>    int i;
> //asm ("pmaddwd m1,m2\n\t");
>    m3 =_mm_madd_pi16 (m1, m2);
>    printf("value is %x%x\n", m1);
>    printf("value is %x%x\n", m2);
>    printf("value is %x%x\n", m3);
> data = (char *)&m3;
>    for ( i = 0; i < 8; i++)
>         {
>         printf("Element %d value is %x\n", i,
> data[i]);
>         }
>    return;
> }
> ------------------------------------------------------
> I got the following error when I compiled the above
> program with gcc 4.0.0 compiler on pentium4 processor.
> The compilation command :
>  gcc -march=pentium4 sample.c
> ----------------------------------------------
> sample.c: In function `main':
> sample.c:7: invalid initializer
> sample.c:8: invalid initializer
> ----------------------------------------------

Does it make a difference if you add LL suffix?  Without that, your 
constant is implicitly typed int.  Not that I can buy in to whatever 
you're trying to do.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* compilation error
@ 2006-10-07 18:58 ranjith kumar
  2006-10-07 19:36 ` Tim Prince
  0 siblings, 1 reply; 24+ messages in thread
From: ranjith kumar @ 2006-10-07 18:58 UTC (permalink / raw)
  To: gcc-help

Hi,
-------------------------------------------------------
#include <mmintrin.h>
int  main()
{
   __m64 m1 = 0x00ff00a300bc00ae;
   __m64 m2 = 0x0001000100010001;
 __m64 m3;
   unsigned char *data;
   unsigned char ch;
   int i;
//asm ("pmaddwd m1,m2\n\t");
   m3 =_mm_madd_pi16 (m1, m2);
   printf("value is %x%x\n", m1);
   printf("value is %x%x\n", m2);
   printf("value is %x%x\n", m3);
data = (char *)&m3;
   for ( i = 0; i < 8; i++)
        {
        printf("Element %d value is %x\n", i,
data[i]);
        }
   return;
}
------------------------------------------------------
I got the following error when I compiled the above
program with gcc 4.0.0 compiler on pentium4 processor.
The compilation command :
 gcc -march=pentium4 sample.c
----------------------------------------------
sample.c: In function `main':
sample.c:7: invalid initializer
sample.c:8: invalid initializer
----------------------------------------------
Can anyone help me.
Thanks in advance. 



		
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation error..
  2005-07-18  5:51 ` Ian Lance Taylor
@ 2005-07-18  7:45   ` Arturas Moskvinas
  0 siblings, 0 replies; 24+ messages in thread
From: Arturas Moskvinas @ 2005-07-18  7:45 UTC (permalink / raw)
  To: gcc-help, alexspike

> > Tell, please, what am I doing wrong for correct compilation:
> > in Fedora Core 4 Linux I'm trying to compile GCC 3.2.3 version.
There is GCC 3.2.3 version for fedora Core 4...

yum install compat-gcc-32

When you'll want to compile with gcc 3.2.3 call it with "gcc32 main.c"
(not gcc) I think you'll find c++ compat and other "compilers".

Arturas Moskvinas

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Compilation error..
  2005-07-18  4:24 Oleg Kotsyurbiy
@ 2005-07-18  5:51 ` Ian Lance Taylor
  2005-07-18  7:45   ` Arturas Moskvinas
  0 siblings, 1 reply; 24+ messages in thread
From: Ian Lance Taylor @ 2005-07-18  5:51 UTC (permalink / raw)
  To: Oleg Kotsyurbiy; +Cc: gcc-help

Oleg Kotsyurbiy <alexspike@mail.ru> writes:

> Tell, please, what am I doing wrong for correct compilation:
> in Fedora Core 4 Linux I'm trying to compile GCC 3.2.3 version.

It's a problem.  Older versions of gcc use a construct which newer
versions of gcc won't compile.  This makes it hard to bootstrap older
versions of gcc with newer versions.  This is indeed an absurd
situation.

If you must use gcc 3.2.3, and you must use Fedora Core 4, then I
think your best bet is to first build and install gcc 3.3.6, and then
use that to build gcc 3.2.3.

Ian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Compilation error..
@ 2005-07-18  4:24 Oleg Kotsyurbiy
  2005-07-18  5:51 ` Ian Lance Taylor
  0 siblings, 1 reply; 24+ messages in thread
From: Oleg Kotsyurbiy @ 2005-07-18  4:24 UTC (permalink / raw)
  To: gcc-help

Good day!
Tell, please, what am I doing wrong for correct compilation:
in Fedora Core 4 Linux I'm trying to compile GCC 3.2.3 version.
At some point I'm getting this error:
=====================================================================
In file included from /distr/gcc-3.2.3/gcc/rtl.c:24:
/distr/gcc-3.2.3/gcc/rtl.h:125: warning: type of bit-field &#8216;code&#8217; is a GCC extension
/distr/gcc-3.2.3/gcc/rtl.h:128: warning: type of bit-field &#8216;mode&#8217; is a GCC extension
gcc -c -DIN_GCC    -g  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I. -I/distr/gcc-3.2.3/gcc -I/distr/gcc-3.2.3/gcc/. -I/distr/gcc-3.2.3/gcc/config -I/distr/gcc-3.2.3/gcc/../include /distr/gcc-3.2.3/gcc/read-rtl.c -o read-rtl.o
In file included from /distr/gcc-3.2.3/gcc/read-rtl.c:24:
/distr/gcc-3.2.3/gcc/rtl.h:125: warning: type of bit-field &#8216;code&#8217; is a GCC extension
/distr/gcc-3.2.3/gcc/rtl.h:128: warning: type of bit-field &#8216;mode&#8217; is a GCC extension
/distr/gcc-3.2.3/gcc/read-rtl.c: In function &#8216;fatal_with_file_and_line&#8217;:
/distr/gcc-3.2.3/gcc/read-rtl.c:62: warning: traditional C rejects ISO C style function definitions
/distr/gcc-3.2.3/gcc/read-rtl.c: In function &#8216;read_rtx&#8217;:
/distr/gcc-3.2.3/gcc/read-rtl.c:662: error: invalid lvalue in increment
make[2]: *** [read-rtl.o] Error 1
make[2]: Leaving directory `/distr/compiled/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/distr/compiled/gcc'
make: *** [bootstrap] Error 2
=============================================================================================

Thank you!

With the best regards,
Oleg Kotsyurbiy

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-08-17  0:12 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-21 10:27 Compilation error Jose Miguel A.C.Pires
2000-02-21 10:39 ` llewelly
2000-04-01  0:00   ` llewelly
2000-04-01  0:00 ` Jose Miguel A.C.Pires
2005-07-18  4:24 Oleg Kotsyurbiy
2005-07-18  5:51 ` Ian Lance Taylor
2005-07-18  7:45   ` Arturas Moskvinas
2006-10-07 18:58 compilation error ranjith kumar
2006-10-07 19:36 ` Tim Prince
2011-06-08 12:25 Rony Paul
2011-06-08 13:31 ` Jonathan Wakely
2011-06-08 13:47 ` Ian Lance Taylor
2012-08-15 15:43 Configuration Error Jonathan Wakely
2012-08-15 17:49 ` B B
2012-08-15 17:57   ` Jonathan Wakely
2012-08-15 18:03     ` Compilation Error Ron Stubbs
2012-08-15 18:14       ` Marc Glisse
2012-08-15 18:46       ` B B
     [not found]         ` <CAH6eHdRV5NLCO-+iJw1FHqw+6EV-LSCNkhF-SJ0jZUPtdbwFKQ@mail.gmail.com>
2012-08-15 19:25           ` Jonathan Wakely
2012-08-15 19:36     ` Ron Stubbs
2012-08-16  3:59       ` Marc Glisse
2012-08-16 13:29         ` Ron Stubbs
2012-08-16 15:15           ` Tim Prince
2012-08-16 20:06           ` Marc Glisse
2012-08-17  0:12             ` Ron Stubbs
2012-08-17  7:23               ` Marc Glisse
2012-08-17  8:23                 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).