You are not logged in.

#1 2007-10-10 22:34:01

bountykiller
Member
Registered: 2006-08-07
Posts: 19

[resolved]Problem compiling apps after gcc upgrade

Hi all,

I've recently upgraded gcc to the last version, but since I've got errors as soon as I try to compile apps with optimisation enabled.
Here is an exemple:
File main.cpp:

#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
    cout << "Hello World" << endl;
    return 0;
}

then

bash# g++ -O main.cpp
/tmp/ccZDcDGc.o: In function `main':
main.cpp:(.text+0x93): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
collect2: ld a retourné 1 code d'état d'exécution

Do I need to upgrade another package? (I've upgraded gcc, gcc-libs and libstdc++5)

Last edited by bountykiller (2007-10-11 21:12:12)

Offline

#2 2007-10-11 00:14:47

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: [resolved]Problem compiling apps after gcc upgrade

glibc, maybe?  Also try reinstalling gcc-libs

Last edited by Cerebral (2007-10-11 19:40:14)

Offline

#3 2007-10-11 00:30:00

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [resolved]Problem compiling apps after gcc upgrade

And binutils.

Offline

#4 2007-10-11 06:29:14

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: [resolved]Problem compiling apps after gcc upgrade

are gcc and gcc-libs versions the same on your system?

Offline

#5 2007-10-11 14:01:56

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [resolved]Problem compiling apps after gcc upgrade

hello,

i have a similar problem, though i don't know if it's related.
i also cannot compile packages i could compile some weeks ago (qonk and wbar from AUR and vlc),
i get errors like:
http://pastebin.archlinux.org/15785
as i said i don't know if it's the same problem, but weeks ago i definitely didn't had this problem.

vlad

ps: i re-installed all packages suggested here.

Last edited by DonVla (2007-10-11 14:08:44)

Offline

#6 2007-10-11 16:10:21

bboozzoo
Member
From: Poland
Registered: 2006-08-01
Posts: 125

Re: [resolved]Problem compiling apps after gcc upgrade

see guys

vlad@minerva:~/apps/compiling.dir/openbox/panels-launcher/wbar-1.3 $ make
g++ `imlib2-config --cflags` -Wall -O2 -DCOOLMACHINE_N_SHITCODE -DAVGFILTER    -c -o XWin.o XWin.cc
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/char_traits.h:46,
                 from /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/string:47,
                 from XWin.h:6,
                 from XWin.cc:4:
/usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/stl_algobase.h:72:34: error: /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/cpp_type_traits.h: Permission denied
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/string:48,
                 from XWin.h:6,
                 from XWin.cc:4:
/usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/memory:54:28: error: /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/allocator.h: Permission denied
/usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/memory:58:39: error: /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/stl_raw_storage_iter.h: Permission denied
In file included from XWin.h:6,
                 from XWin.cc:4:
/usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/string:58:35: error: /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/basic_string.tcc: Permission denied
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../include/c++/4.2.1/bits/stl_algobase.h:73,

this should give you enough clue

Offline

#7 2007-10-11 18:43:29

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [resolved]Problem compiling apps after gcc upgrade

actually, strange stuff happens. seems to work now. my root partition was corrupted. and some files in the include/c++ directory were unusable. after running reiserfsck --rebuild-tree and reinstalling gcc i could build vlc and the other apps.
thanks,

vlad

Offline

#8 2007-10-11 18:55:37

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: [resolved]Problem compiling apps after gcc upgrade

see guys ...

run the command `pacman -Q gcc gcc-libs` i'm sure gcc-libs is version 4.2.1* when gcc is 4.2.2*

Offline

#9 2007-10-11 21:11:13

bountykiller
Member
Registered: 2006-08-07
Posts: 19

Re: [resolved]Problem compiling apps after gcc upgrade

I've just reinstalled all the package mentionned above, seems it fixe the problem.
Thanks all wink

Offline

#10 2007-10-29 21:14:49

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: [resolved]Problem compiling apps after gcc upgrade

lucke wrote:

And binutils.

Thank you, reinstalling this solved my problems wink

Offline

Board footer

Powered by FluxBB