gcc mặc định không link thư viện C++ standard. Dùng gcc file.cpp -lstdc++.
Ví dụ
#include <iostream>
int main() { std::cout << "Hello\n"; }Sai: gcc test.cpp → linker error: undefined reference to std::cout...
Đúng: gcc test.cpp -lstdc++ → chạy OK.