Hi. THe title isn't clear so iäll explain.
I've downloaded pthread. And it come with headers, dlls, and libs.
So. I link the libs in the compiler, include the headers and run it. It's fine til I get an popup that tell me that a dll is missing? a dll? why do I need a dll when I have the lib?
I've been using it for like a year ago and then I didn't need any dll :(
There should be some .dll's in the \lib\ folder. Copy and paste them to your program location. I don't know why though.
[QUOTE=Woodcutter11;25004564]There should be some .dll's in the \lib\ folder. Copy and paste them to your program location. [b]I don't know why though.[/b][/QUOTE]
What the fuck?
The lib files aren't compiled into your .exe, they are dynamically linked at runtime, ie dll (dynamic link library).
yeah ok, But how can I use the libs instead of the dlls?
[QUOTE=thf;25004588]What the fuck?[/QUOTE]
Yeah.. I know how to program but not how stuff works.
[QUOTE=likesoursugar;25004681]yeah ok, But how can I use the libs instead of the dlls?[/QUOTE]
You use both.
[QUOTE=Woodcutter11;25004883]Yeah.. I know how to program but not how stuff works.[/QUOTE]
how does that work out?
Pretty good actually.
[QUOTE=likesoursugar;25004681]yeah ok, But how can I use the libs instead of the dlls?[/QUOTE]
The libs contain the interface to the DLLs.
You can use just the libs by acquiring the source code and compiling and linking as static libraries.
As far as I know, which isn't much, .lib files tell your source code what functions are available from exports, if you have the source code to what is in those .libs, you can compile all the code into your binaries without having to use .dlls. If you choose to compile and organize your project in a modular fashion, you can compile against .libs, and have your binaries rely on .dlls at runtime.
I don't know much about programming yet, I'm just fiddling with the Source SDK, after having scripted for a few years. This is just what I think may be right, but you'd have to verify it through someone who actually knew what they were talking about regarding this.
[editline]01:23PM[/editline]
[QUOTE=esalaka;25005459]The libs contain the interface to the DLLs.
You can use just the libs by acquiring the source code and compiling and linking as static libraries.[/QUOTE]
:ninja:'d
How does one get the [b]POSIX[/b] threads library on Windows? :raise:
[QUOTE=PvtCupcakes;25021597]How does one get the [B]POSIX[/B] threads library on Windows? :raise:[/QUOTE]
It's called porting.
[QUOTE=PvtCupcakes;25021597]How does one get the [b]POSIX[/b] threads library on Windows? :raise:[/QUOTE]
[url=http://www.google.com/search?q=windows+pthreads]Apparently in a shitload of ways[/url].
[QUOTE=likesoursugar;25004247]Hi. THe title isn't clear so iäll explain.
I've downloaded pthread. And it come with headers, dlls, and libs.
So. I link the libs in the compiler, include the headers and run it. It's fine til I get an popup that tell me that a dll is missing? a dll? why do I need a dll when I have the lib?
I've been using it for like a year ago and then I didn't need any dll :([/QUOTE]
There are two kinds of static libraries: import libraries and regular static libraries. A static library contains not only the relevant symbols, but also the object code for those symbols. This means that if you link with a static library, you don't need a shared library (DLL) at runtime, because all the required code sits in your executable.
The other kind, import libraries, only contains the relevant symbols, so the executable's import table will be filled with those symbols, but no actual code is linked. The name of the shared library in which to look up these symbols is also linked in. When you run the executable, the shared library is searched for, then the symbols in that shared library. Only if all symbols are resolved will your program start.
The easiest way (and also a portable way) to tell if a library is an import library or a static library is to simply check its file-size. Also, if only one static library is included with a package, check if it comes with a shared library - if it does, it's probably an import library. If it comes with two static libraries, check the file-name for clues (a common convention is to suffix static libraries with "-s").
Hope that clears things up.
[QUOTE=likesoursugar;25004681]yeah ok, But how can I use the libs instead of the dlls?[/QUOTE]
Compile the code yourself. It looks like that the lib you used only tells the Linker to link to symbols in the dll.
How I got it so far, there are two types of libs. One contains executable code you can link to and one only contains the symbol names it can link to, so you still need the dll.
Sorry, you need to Log In to post a reply to this thread.