How to link C++ object files with ld
If you run g++ with the -v flag, you’ll see the link line it uses. Here’s a simple example program: #include <iostream> int main(void) { std::cout << “Hello, world!” << std::endl; return 0; } And the output from running g++ -v -o example example.cpp: Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v –with-pkgversion=’Ubuntu/Linaro 4.4.4-14ubuntu5.1′ … Read more