g++的默认链接形式
g++
的默认链接形式为动态链接,加上-static
选项可改为静态链接。
/*************************************************************************
> File Name: test.cpp
> Author: Luzelin
> Mail:
> Created Time: Sat Sep 24 20:16:52 2022
************************************************************************/
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
return 0;
}
注意:
函数有声明无定义是在链接期报错
函数有定义无声明是在编译期报错(定义位置在调用位置之后)