Error message when I compile (using "gcc Hello.cpp -o Hello") in Terminal: Undefined symbols: "___gxx_personality_v0", referenced from: ___gxx_personality_v0$non_lazy_ptr in ccJmKSqC.o "std::ios_base::Init::~Init()", referenced from: ___tcf_0 in ccJmKSqC.o "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from: _main in ccJmKSqC.o "std::ios_base::Init::Init()", referenced from: __static_initialization_and_destruction_0(int, int)in ccJmKSqC.o "std::cout", referenced from: __ZSt4cout$non_lazy_ptr in ccJmKSqC.o ld: symbol(s) not found collect2: ld returned 1 exit status
10 replies to this topic
#1
Posted 12 January 2012 - 06:40 AM
I'm running on a Mac OS Leopard (10.5.8). I was able to download a dev kit from the Apple site which is the only one compatible with my system. The problem is the compiler doesn't work properly (so I assume). I tried compiling a simple C++ Hello World program and it gives me error messages. I believe I have GCC 4.0 if I'm not mistaken. I tried Google for answers but I haven't found any solution. Any form of help would be greatly appreciated. :)
|
|
|
#2
Posted 12 January 2012 - 09:24 AM
Would you please post your code also?
I think i'm able to write a code for printing "Hello, World!". Proud of that!
#3
Posted 12 January 2012 - 09:39 AM
Here it is. I followed a book so I doubt the problem lies in the code though.
#include <iostream>
/*Hello::Hello() {
// TODO Auto-generated constructor stub
}
Hello::~Hello() {
// TODO Auto-generated destructor stub
}*/
int main(){
std::cout << "Hello World!\n";
return 0;
}
#4
Posted 12 January 2012 - 09:57 AM
Well! As you have commented the code:
So, there doesn't seems any problem with it.
I guess, the problem is in,.
You must use:
Hope this Helps!
/*Hello::Hello() {
// TODO Auto-generated constructor stub
}
Hello::~Hello() {
// TODO Auto-generated destructor stub
}*/
So, there doesn't seems any problem with it.
I guess, the problem is in,
Quote
gcc Hello.cpp -o Hello
You must use:
g++ Hello.cpp -o Hello
Hope this Helps!
Edited by AKMafia001, 12 January 2012 - 09:59 AM.
Typo!
I think i'm able to write a code for printing "Hello, World!". Proud of that!
#5
Posted 12 January 2012 - 10:36 AM
Thank you very much! I tried it but unfortunately the command doesn't exist. :(
#6
Posted 12 January 2012 - 10:54 AM
Maybe because it would not be installed. The installation would be quite simple. Try it.
I think i'm able to write a code for printing "Hello, World!". Proud of that!
#7
Posted 12 January 2012 - 04:20 PM
Is there a tutorial on how to do that?
#9
Posted 13 January 2012 - 03:52 AM
I already tried IDEs. Xcode and Eclipse won't run it either.
#10
Posted 16 January 2012 - 12:35 AM
I agree that you need to use g++ instead of gcc. I have the same OS and I installed the free version of Xcode (I believe it is the previous year's release) and g++ works for me. I would try to reinstall xcode since gcc and g++ should be included with xcode. Also, once you install Xcode, you would still compile and run the program in the terminal
#11
Posted 16 January 2012 - 08:31 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









