Code::Blocks Forums

User forums => Help => Topic started by: ming on September 04, 2016, 07:51:14 pm

Title: Help!
Post by: ming on September 04, 2016, 07:51:14 pm
So I just started programming with C, but I received this error message, and I'm not sure how to fix it? Thanks for helping out!

"-------------- Build: Debug in HelloWorld (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o   
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) "
 
The code is just the basic Hello World,
"#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}
"
Title: Re: Help!
Post by: stahta01 on September 04, 2016, 08:15:28 pm
Remove pthread from the other linker options or from the link library list.

Linked to directions on how to add library.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)

Tim S.