Web lists-archives.com

Re: [Mingw-users] GCC doesn't work "ld.exe: cannot find -lpthread"




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

> gcc -v: Using built-in specs. ... Thread model: posix gcc version
> 5.3.0 (GCC)

This configuration causes GCC to add the "-lpthread" dependency, even
if your application doesn't (ultimately) need it.

> I am using Windows 7 64-bit and the latest MinGW. I would
> appreciate any help.

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.

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJXzBHpAAoJEMCtNsY0flo/voIQAIMj3rsvgyiTWBclo4v9YlFy
2Qy2QDYVuzWbp4nihMJf1CV4nQD89gzQrRtCgJoi6VBxrpJZriTFn9Iai8xnAyDe
mRZ3D2Zo6xj4BO2+eoapVAsAYAqBIq5XGAnxqZTHnnvv61tGXhgiyV+67LORoh37
KJqOSCJxfVs8SueqQjKbQ/bwuD04xbj8RHe6sZbSDkWMEbaY3UBW1xSeJVSEffSd
1/DeAjMKNchYOieX1H0i5J0tVjNy8oMo6o7dHMXgapZrduCxQUd52fRHS/3Snj2V
EwySHzZ2v7A4DdKozN1l1aV3HrciCogM983WrCXC7thgDsvdkQ+Um4MZ7whMIDd1
JMd0QTAX9fkQEU0thjBSRdvH2N9xBH8zL1dZVIQkcz2ZZz8hBttYcVLLA+ao+lPU
y4T5MhCAXKgXksz0RZrUw0+p0PxReYg8yrluNj4h74t4o+XS2o687/FVT8b7Zd87
osLlguQLP7DSYoElsfBvPnwhoufMmjKEuzT/nQ2N29TA48ALtKI000yEwNNtfRCV
8+Ci3G9GFz8kM0nf2hhCal5E8LjyultGluVd1/6tUfGaC111z93Pkvdn4bhFGkpg
X19talOOqQpkOO5vIk4rzv9j+R0rp9Nqm5XNo36RwwpXR0br6ci6L1VcGSX2WAsi
4+RyMR8ruWC4pwRgEYLr
=kh+G
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
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:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe