098-CentOS下codeblocks編譯RTKLIB

linux下使用codeblocks編譯RTKLIB比較容易,建立好項目並把src及rcv文件夾下的*.c全部添加進去後,添加這樣一個main函數:

#include "rtklib.h"

extern int showmsg(char *format, ...)
{
    va_list arg;
    va_start(arg,format); vfprintf(stderr,format,arg); va_end(arg);
    fprintf(stderr,"\r");
    return 0;
}
extern void settspan(gtime_t ts, gtime_t te) {}
extern void settime(gtime_t time) {}

int main(int argc, char **argv)
{
    return 0;
}

1、在菜單中選擇 Settings -> Compiler -> Global compiler settings -> Compiler settings -> Compiler Flags,勾選 Inhibit all warning messages

2、在菜單中選擇 Settings -> Compiler -> Global compiler settings -> Link settings,在Link libraries中添加/usr/lin64/libpthread.so,當然你要你先在終端定位一下你這個庫的位置,$ whereis libpthread.so

3、在菜單中選擇 Settings -> Compiler -> Global compiler settings -> Link settings,在Other linker options中添加-lpthread,確定;

第二步和第三步一個就可以,也可以全添加。接下來就可以在main函數裏面揮灑自如了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章