#include<iostream>
using namespace std;
class welcome{
public:
	welcome(){
		cout<<"Constructor";
	}
};
int main(){
	welcome c;
	return 0;
}

for the above code i get the following errors wen i try to compile using GCC in PCLinux minime version.
cannot figure out if there is an error in my program or in the gcc installation. i used synaptic to install gcc.

if this is not the appropriate place to post this message, kindly redirect me.

[joe@localhost apps]$ gcc welcome.cc
/home/joe/tmp/ccbhvMO0.o: In function `__static_initialization_and_destruction_0(int, int)':
welcome.cc: (.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/home/joe/tmp/ccbhvMO0.o: In function `__tcf_0':
welcome.cc: (.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/home/joe/tmp/ccbhvMO0.o: In function `welcome::welcome()':
welcome.cc: (.text._ZN7welcomeC1Ev[welcome::welcome()]+0x11): undefined reference to `std::cout'
welcome.cc: (.text._ZN7welcomeC1Ev[welcome::welcome()]+0x16): 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*)'
/home/joe/tmp/ccbhvMO0.o: (.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
[joe@localhost apps]$

Recommended Answers

All 2 Replies

You need to compile C++ programs in GCC using g++ and not gcc.

g++ filename

You need to compile C++ programs in GCC using g++ and not gcc.

g++ filename

:) thank you,..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.