C++ Hello World Undefined symbols for architecture x86_64:

岁酱吖の 提交于 2019-12-06 01:31:48

You need to use g++ to compile and link C++ code:

g++ hello.cpp -o hello

Or to be fully Stack Overflow compliant:

g++ -W -Wall -Werror -pedantic -o hello hello.cpp

Use g++ instead of gcc. But anyways your gcc installation seems to be broken. Also are you trying to compile 64bit exec on a 32 bit machine/os?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!