试图在崇高中奔跑. 错误 已发生: 收集2.exe: 错误: ld 返回 1 退出状态

Trying to run in sublime. error ocured : collect2.exe: error: ld returned 1 exit status

本文关键字:错误 exe 收集 返回 状态 退出 ld 高中 奔跑      更新时间:2023-10-16
>gcc my.cpp
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:UsersVENKAT~1AppDataLocalTempcccMqWsr.o:my.cpp:(.text+0x19): undefined reference to `std::cout'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:UsersVENKAT~1AppDataLocalTempcccMqWsr.o:my.cpp:(.text+0x1e): 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*)'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:UsersVENKAT~1AppDataLocalTempcccMqWsr.o:my.cpp:(.text+0x35): undefined reference to `std::ios_base::Init::~Init()'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:UsersVENKAT~1AppDataLocalTempcccMqWsr.o:my.cpp:(.text+0x56): undefined reference to `std::ios_base::Init::Init()'
collect2.exe: error: ld returned 1 exit status

只是我,还是您尝试使用C编译器来编译C++程序 尝试改用 G++