Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst] gcc error nach --update system
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
oliver2104
Apprentice
Apprentice


Joined: 27 Jul 2004
Posts: 214
Location: Wien

PostPosted: Tue Jan 07, 2014 12:48 pm    Post subject: [gelöst] gcc error nach --update system Reply with quote

Hallo,
spiel gerade mit SDL herum und hab ein Programm geschrieben -> grav2_sdl.c
habs bis jetzt problemlos mit dem folgenden Kommando kompiliert:
Code:

gcc grav2_sdl.c -Wall -Wno-switch -o grav2_sdl `sdl-config --cflags --libs`

wollte dann nach längerer Zeit mein System mal updaten und hab ein
emerge --update system ausgeführt.
Nach dem Update kann ich mein Programm nicht mehr kompilieren.
Code:

gcc grav2_sdl.c -Wall -Wno-switch -o grav2_sdl `sdl-config --cflags --libs`

gibt mir folgende Fehlermeldung (gekürzt)
Code:

/i686-pc-linux-gnu/bin/ld: /tmp/ccxDaxxc.o: undefined reference to symbol 'cos@@GLIBC_2.0'
/i686-pc-linux-gnu/bin/ld: note: 'cos@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation

Vermute das Problem liegt an einem Python-Update verursacht durch das System-update
eselect python list, ergibt folgendes
Code:

Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.2
  [3]   python3.3

aber egal welche Python-Version ich wähle, das gcc-Problem bleibt
bitte um Hilfe


Last edited by oliver2104 on Thu Jan 09, 2014 9:50 am; edited 1 time in total
Back to top
View user's profile Send private message
Christian99
Veteran
Veteran


Joined: 28 May 2009
Posts: 1668

PostPosted: Tue Jan 07, 2014 3:00 pm    Post subject: Reply with quote

das hat nix mit python zu tun. du musst einfach nur zur libm linken wie dir dein linker schon sagt.
vermutlich hat das dein alter gcc automatisch gemacht, aber der neue nicht mehr. kannst ja mal in den changelogs suchen, da steht glaub ich oft auch wieso das gemacht wurde.
Back to top
View user's profile Send private message
frank9999
n00b
n00b


Joined: 20 Feb 2013
Posts: 61
Location: Germany

PostPosted: Tue Jan 07, 2014 5:25 pm    Post subject: Reply with quote

sieht nach einem underlinking Problem aus, sieh mal hier:

https://blog.flameeyes.eu/tag/underlinking/
Back to top
View user's profile Send private message
oliver2104
Apprentice
Apprentice


Joined: 27 Jul 2004
Posts: 214
Location: Wien

PostPosted: Thu Jan 09, 2014 9:48 am    Post subject: Reply with quote

Danke für die Antworten,

python ist nicht schuld, war auch nur eine Vermutung.
musste nur für die Verwendung der Sourcecodezeile
Code:
 
#include <math.h>

die libm beim kompilieren explizit angeben.
die Kommandozeile sieht jetzt so aus:
Code:

gcc grav2_sdl.c -lm -Wall -Wno-switch -o grav2_sdl `sdl-config --cflags --libs`

damit funktionierts.
Warum es vor dem --update system ohne
Code:

-lm

ging und nachher nicht mehr, würd mich auch ein wenig interessieren.
das -- update system hat folgendes gemacht:
Code:

>>> emerge (1 of 9) sys-devel/gnuconfig-20130516
>>> emerge (2 of 9) sys-apps/coreutils-8.21
>>> emerge (3 of 9) sys-process/procps-3.3.8-r1
>>> emerge (4 of 9) virtual/man-0-r1
>>> emerge (5 of 9) dev-lang/python-2.7.5-r3
>>> emerge (6 of 9) dev-lang/python-3.3.2-r2
>>> emerge (7 of 9) sys-apps/file-5.15
>>> emerge (8 of 9) sys-devel/binutils-2.23.2
>>> emerge (9 of 9) sys-apps/gawk-4.0.2

vielleicht gibts da eine einfache Erklärung.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum