undefined reference to `std::ios_base::Init::Init()'

后端 未结 2 2039
囚心锁ツ
囚心锁ツ 2020-11-30 01:18

I write this code to read 3 files, TM is the size of square matrix, LER the No. of rows of an array and from last value define a non-square matrix of (ler/2)*2

Then.

相关标签:
2条回答
  • 2020-11-30 01:23

    Most of these linker errors occur because of missing libraries.

    I added the libstdc++.6.dylib in my Project->Targets->Build Phases-> Link Binary With Libraries.

    That solved it for me on Xcode 6.3.2 for iOS 8.3

    Cheers!

    0 讨论(0)
  • 2020-11-30 01:32

    You can resolve this in several ways:

    • Use g++ in stead of gcc: g++ -g -o MatSim MatSim.cpp
    • Add -lstdc++: gcc -g -o MatSim MatSim.cpp -lstdc++
    • Replace <string.h> by <string>

    This is a linker problem, not a compiler issue. The same problem is covered in the question iostream linker error – it explains what is going on.

    0 讨论(0)
提交回复
热议问题