Web lists-archives.com

Re: [Mingw-users] I can't compile the c program (Prapan Chulapinyo)

Base on answer of Keith yesterday I can solve my problem 

On 04/09/16 11:17, entwikelaar@xxxxxxxxx wrote:
> ... when I run "gcc test.c" it doesn't compile and I get the
> following error:
> .../ld.exe: cannot find -lpthread collect2.exe: error: ld returned
> 1 exit status

So, a missing libpthread.a or libpthread.dll.a dependency; thanks for
bringing this to our attention.

You should install the libpthreadgc-dev package; (from the CLI):

  mingw-get install libpthreadgc-dev

(or, if you are a GUI junkie, run mingw-get in GUI mode -- DO NOT run
mingw-get-setup.exe again -- scroll down until you find it, and
install it from there).

Of course, mingw-get should have known about this dependency, when you
installed GCC; I need to fix that, but a manual installation is still
going to be the quickest and easiest way to get you up and running.

Here is what i do:
I delete MinGW folder. Then setup again from new. Then when I mark for installation for mingw-developer-toolkit, mingw32-base, mingw32-gcc-ada, mingw32-gcc-fortran, mingw32-gcc-g++, mingw32-gcc-objc, msys-base. Then apply. It turn out that some packages can't download in 1st try. Still there is mark for installation for those package that not yet downloaded. All I need to do is apply changes again until they all downloaded and installed.

Noted when I mark for installation of mingw32-base, it also mark for install libpthreadgc-dev and libpthreadgc-dll. Which is the answered by Keith.

That is solved linking problem.


Sent from Samsung tablet.
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe