7/04/2021

main.cpp:(.text+0x3f): undefined reference to `std::ios_base::Init::Init()'

 errors like that:

> gcc -o test main.cpp 

/usr/bin/ld: /tmp/ccoMmwaL.o: in function `__static_initialization_and_destruction_0(int, int)':

main.cpp:(.text+0x3f): undefined reference to `std::ios_base::Init::Init()'

/usr/bin/ld: main.cpp:(.text+0x54): undefined reference to `std::ios_base::Init::~Init()'

collect2: error: ld returned 1 exit status


just replace g++ instead of gcc

> g++ -o test main.cpp 


Then it would be fine!.



Thank you!


No comments:

Post a Comment