Undefined symbols for architecture x86_64: Which architecture should I use?

后端 未结 3 1488
难免孤独
难免孤独 2020-12-05 09:07

I\'m trying to do some really simple stuff in C++, but I can\'t find any information on how to tackle this. Even the book I have just says \"Just compile and run the program

3条回答
  •  庸人自扰
    2020-12-05 10:07

    The error is caused because you're compiling with gcc, which only default-links libc. You need to compile with g++ so that libstdc++ is auto-linked in too.

提交回复
热议问题