$cat b.cpp
#include <iostream>
using namespace std;
int main(void);
int main()
{
cout << "aaa" ;
exit(0);
}
このソースをコンパイルすると、cygwinではエラーになります。
$CC b.cpp
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0xd): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x60): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x9f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0xce): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x135): undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x13a): 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*)'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x167): undefined reference to `std::ios_base::Init::Init()'
/cygdrive/c/DOCUME~1/miyu/LOCALS~1/Temp/cc1IQOay.o:b.cpp:(.text+0x182): undefined reference to `std::ios_base::Init::~Init()'
collect2: ld returned 1 exit status
何か理由が不明で、長々とエラーが出ていますがcygwinだと何か特別な設定が
必要なのでしょうか?
誰か教えてください
|