Re: [Dev-C++] About POSIX Threads and the compiler
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Mac R. <re...@no...> - 2002-06-28 14:14:45
|
At 01:33 AM 6/28/02 -0700, nmp...@ya... wrote: >Hello people.I have downloaded the library of threads >for Win32.I read who to install eith a gcc compiler >and what to do with pthread.dll but nothing don e so >far many problems in compilation and eventhough i put >pthread.h semaphore.h in include the linker cannot se >these libraries.Please help because i am a student in >the second year of my studies and i writing an >excersise. >Nikos1 .DLL files contain the actual executable portions of the library, but are not linked directly. .h files contain declarations of functions and data types, but do not contain the actual code. So your current situation is that you know the declaration of the functions, and you have the file with the functions, but your code doesn't know how to get access to the file with the functions (the DLL). There are two ways to fix this: 1. Get the corresponding .LIB file. .LIB files can be linked into your program, and they contain just enough code (in "stub" routines) to find the DLL and attach to it. This is usually the simplest, and can usually be done by finding the right .LIB and then adding it to your project -- this is for other development environments (Visual C, Digital Mars, others), so I am not certain that this is how it is done in Dev-C++. Hopefully someone will confirm and fill in details. 2. You can link the functions out of the DLL directly with LoadLibrary and GetProcAddress. This method is *much* more painful to look at, but is also more flexible and will work with any compiler than runs Win32. Another thought : if you are trying to do UNIX-like things on Win32, you might want to look into getting Cygwin installed rather than MinGW. Cygwin is intended to compile UNIX-based source code into Win32 executables. MinGW is intended to compile Win32-based source code into Win32 executables. Yet another thought : you might look into BOOST (http://www.boost.org). It has a lot of utility classes, including a portable threading class library. - _____________________________ /"\ Mac Reiter \ / ASCII Ribbon Campaign Nomadics, Inc. X Against HTML Mail re...@no... / \ (To join the campaign, simply use this in your signature.) |