Original Post
The Main Question: I was wondering if someone could explain to me the differences between the .lib and .DLL library files, im a little confused over their function and how i use them. I understand that they basically hold a library of functions/structures that can be reused easily (*cough*). But thats about it. Background My current dilema: Im just writing a simple program to get my feet wet with SDL, but my lack of understaning with VC++ 2003.Net and Libraries isnt helping. So im trying to pick up a bit more about what they are and stuff. I understand that the Linker error is warning me that there are duplicate function definitions, presumably because SDL re-defines some standard functions from the msvcrt.lib, which i beleive is a default .lib specified within the Dev Env? I tried to add the /NODEFAULTLIB:msvcrt.lib switch to the linker command line (presumably this would remove the duplicate definition, but it introduced more errrors), i think i did this correctly, but it didnt fix the errors. What ive done: As you can tell, im still pretty confused by the whole Dev Env and program construction process, even though im happy with my progress with C++ as language, the syntax and logic in general. Any help apreciated.
SDLTest error LNK2005: __isctype already defined in LIBCMTD.lib(isctype.obj)
SDLTest error LNK2005: _exit already defined in LIBCMTD.lib(crt0dat.obj)
SDLTest error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
SDLTest error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
SDLTest fatal error LNK1169: one or more multiply defined symbols found
SDLTest warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
- Dowloaded the SDL Dev Libraries ( included the source, SDL.DLL, SDL.lib and SDLmain.lib )
- Extracted SDL.lib & SDLmain.lib to Drive:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib (not sure if this is the correct location, but this is where i found the openGl.lib's and they worked fine :P)
- Extracted SDL.DLL to both the application root dir and my system32 folder
- Added both .lib's to MSVC Project>Properties>Config>Linker>Input>Additional Dependancies
- Changed the Code Generation to Multi-Threaded Debug ( as recommended elsewhere for SDL )
// SDLTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "sdl.h"
using namespace std;
int main( int argc, char* argv[] )
{
//bleh bleh
return 0;
}