(1) 当编译时用到诸如-llog4cxx -lssl -lcrypto -lpthread -liconv等链接库,需要在makefile.am中添加LIBS=-llog4cxx -lssl -lcrypto -lpthread -liconv
(2)当编译时用到诸如-fpermissive编译选项,需要在
TestExe_CPPFLAGS=-fpermissive或者TestExe_CXXFLAGS=-fpermissive
(其中TestExe为可执行文件的文件名)
至于为什么这两个都可以成功编译,我目前还搞不懂。
【如下文不规范代码,不加-fpermissive编译不通】
#include <pthread.h>
#include <iostream>
using namespace std;
void run() {
cout << "hello world" << endl;
}
int main() {
pthread_t pid;
pthread_create(&pid, NULL, run, NULL);
pthread_join(pid, NULL);
}