Advertisement

Getting Linker Errors with visual studio .net

Started by December 28, 2004 07:21 PM
3 comments, last by Drew_Benton 20 years, 2 months ago
here are the errors that I am getting with Visual Studio Nasty_Engine error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj) Nasty_Engine error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj) Nasty_Engine error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj) Nasty_Engine error LNK2005: _fprintf already defined in LIBCD.lib(fprintf.obj) Nasty_Engine error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj) Nasty_Engine warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library Nasty_Engine fatal error LNK1169: one or more multiply defined symbols found Ive followed the setup exactly according to the setup on the SDL website Im using visual studio .net 2003 thanx in advance for any help
did you switch to multithreaded dll?
Advertisement
Quote:
Original post by mike25025
did you switch to multithreaded dll?


Mike is right, but let me go in detail:

Click on Project->"Your Project Name" Properties (last item in the menu)

"C/C++" item in the side menu

"Code Generation" sub item

Change the "Runtime Library" to Multithreaded DLL for 'release mode' and Multithreaded Debug DLL for 'debug mode' (Top left corner lets you change the config)

Now compile!
That was it thanx is there a good tutorial on building my own libraries, also what does pragma stand for.

thanx for the help.
Quote:
Original post by bignester
That was it thanx is there a good tutorial on building my own libraries, also what does pragma stand for.

thanx for the help.


pragma is a preprocessor command that allows a lot of stuff! Take a look here for a full explanation and features. THe most common use for pragma is this:

#pragma comment (lib, "somelibrary.lib")

That allows you to easily add a library for linking to the project w/o having to add it via Project Settings.

As for making a .dll, take a look at this GameTutorials tutorial on making and using .dlls.

This topic is closed to new replies.

Advertisement