c++ - ld: entry point (start) undefined. Usually in crt1.o for architecture x86_64 -


i've written simple hello world function terminal compile , keep getting

    587216304:eecs280 jacobmyers$ g++ hello.cpp -o hell     ld: entry point (start) undefined.  in crt1.o architecture x86_64     collect2: error: ld returned 1 exit status 

i using gcc version 4.9.2, , can't find online fix me. pretty sure has i/o of compilation.

also, here's code prove can write simple hello world function, should haha

    #include <iostream>     #include <string>      using namespace std;       int main()     {         cout<<"hello world";      return  0;     } 

thanks in advance!

hmmm, says for architecture x86_64.
try compiling -m32: g++ hello.cpp -o hello -m32.

also, noted use gcc 4.9.2. compiled same exact code (just copy-paste) using gcc 4.9.1 , compiled , executed perfectly.

update: stumbled on this: osx-gcc-installer
uninstall current gcc , download the installer , install it! try one, i've used myself , it's good.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -