Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: problems with gcc1.dsl, won't compile< Next Oldest | Next Newest >
howlingmadhowie Offline





Group: Members
Posts: 15
Joined: Jan. 2006
Posted: Jan. 26 2006,10:42 QUOTE

well, the topic description pretty much said it all.
i downloaded, checked the md5sum and installed gcc1.dsl (which went really well). i wrote a short hello_world and tried to compile it. the computer thought for about 10 seconds and then complained. here is the program and the complaint, incase anybody's interested:

Quote

#include <iostream>
using namespace std;

int main()
{
cout << "hello world" << endl;
return 0;
}

Quote

/tmp/ccBMGhHB.o(.text+0x1b): In function `main':
: undefined reference to `std::cout'
/tmp/ccBMGhHB.o(.text+0x20): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccBMGhHB.o(.text+0x28): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
/tmp/ccBMGhHB.o(.text+0x30): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccBMGhHB.o(.text+0x59): In function `tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccBMGhHB.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


i suppose these undefined reference things could mean, that the standard library isn't correctly installed. but it doesn't complain about my #include instruction.

does anyone know what's up?

yours

howie
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Jan. 26 2006,13:12 QUOTE

howlingmadhowie, take a look at this previous g++ post.  I believe you need to compile c++ programs with g++ rathr than gcc.  You didn't mention what comand line you were using to compile your program, but try:

g++ -o hello hello.cpp
Back to top
Profile PM 
howlingmadhowie Offline





Group: Members
Posts: 15
Joined: Jan. 2006
Posted: Jan. 26 2006,13:59 QUOTE

that was it, many thanks :)

now why didn't i find that page while searching the forum?...
Back to top
Profile PM 
2 replies since Jan. 26 2006,10:42 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: problems with gcc1.dsl

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code