Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,
I'm using pthread32 library on a VS2008 on a project.
When compiling, I get this error:

D:\Pre-built.2\lib\pthreadGCE2.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x290

I linked the project to the necessary libraries in the:

project/linker/general/Additional library directories

I downloaded new pthread libraries and replaced older ones, but still the same error.

Someone could help me.

thanks in advance.
Posted

1 solution

It looks to me that you are trying to use a copy of pthreads compiled with the GNU compiler. While this is possible you are required to link.

There is a copy of the pthreads source which can be compiled with the Visual Studio compiler at http://sourceware.org/pthreads-win32/[^]. I used it recently with Visual Studio 2008.

This will also help with debugging, as the debugger will be able to show you exactly what is going wrong with your code.
 
Share this answer
 
Comments
fsidiosidi 24-Jan-11 8:47am    
Ok, i did compiled the source code you gave me and use the generated DLLs, but again the same error commes out....any idea?
fsidiosidi 24-Jan-11 8:55am    
I don't why the program is always calling the GNU library?....Do you think included header: pthread.h for is also diferent from the one for Win?...thanks in advance!
Andrew Brock 25-Jan-11 11:52am    
You will need to do 3 things:
1. Change the include directory for pthreads to reflect the new 1 that you compiled in Visual Studio
2. Change the library that it links against to reflect the .lib file generated by Visual Studio. This will make it look for the DLL that Visual Studio compiled.
3. Place the DLL that Visual Studio compiled in the same directory as the .exe file so that it can find the DLL at runtime.
fsidiosidi 25-Jan-11 12:15pm    
I fixed the problem, and the solution was as u described it...thanks for ur help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900