Joe*_*Joe 2 c gcc pthreads netbeans-7
我刚刚开始使用Netbeans 7.3.1,我在编译项目时遇到了一些麻烦.在终端中,我使用以下代码成功编译:
gcc -Wall one.c two.c three.c four.c -o gateway -lpthread
Run Code Online (Sandbox Code Playgroud)
当我在Netbeans中编译时,我得到的错误就像'未定义引用'pthread_create'.所以我需要添加' -lpthread '选项,但我无法弄清楚...
任何帮助将非常感激!!
编辑:发现它:我发布了下面的解决方案!
亲切的问候,
乔
找到了!
在Netbeans中向GCC添加库依赖项:
File->Project Properties->Build->Linker->Libraries->add Library/add standard Library.
Run Code Online (Sandbox Code Playgroud)
例如,对于-lpthread或-pthread选项:
add standard Library --> Posix Threads
Run Code Online (Sandbox Code Playgroud)