一個最簡單的程式,如下:
// FileName: test.c
#include <stdio.h>
#include <pthread.h>
int main()
{
printf("This is my test program;\r\n");
return 0;
}
使用
msdk-linux-gcc test.c
編譯,生成a.out,拷貝到目標板,運行正常。
而使用msdk-linux-gcc test.c -L/opt/msdk-xxx-xxx-xxx/lib -lpthread
編譯,生產a.out,拷貝到目標板,立即就提示
Segmentation fault。
程式中沒有用到執行緒庫的任何函式,請教一下這是什么原因?
這里使用-L引數讓交叉編譯器優先查找工具鏈的庫。
感謝各位大俠!
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/121550.html
標籤:應用程序開發區
上一篇:Linux與Windows
下一篇:有大佬能解釋一下嗎
