• ### Popular Now

• 13
• 18
• 19
• 27
• 10

#### Archived

This topic is now archived and is closed to further replies.

# Link errors say I'm redefining functions I don't ever use!

This topic is 5080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

pong error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
pong error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBC.lib(typinfo.obj)
pong error LNK2005: __isctype already defined in LIBC.lib(isctype.obj)
pong error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj)
pong error LNK2005: _fclose already defined in LIBC.lib(fclose.obj)
pong error LNK2005: _fgetc already defined in LIBC.lib(fgetc.obj)
pong error LNK2005: _fopen already defined in LIBC.lib(fopen.obj)
pong error LNK2005: _fprintf already defined in LIBC.lib(fprintf.obj)
pong error LNK2005: _setvbuf already defined in LIBC.lib(setvbuf.obj)
pong error LNK2005: _strncpy already defined in LIBC.lib(strncpy.obj)

As far as I''m concerned, this is telling me I''m redefining fopen and all those other functions somewhere in my code, but I have fopen *no where* in any of my code. I don''t know where any of this is coming from, the only idea I have is that it''s some header files messing eachother up.
#include <iostream>
#include <windows.h>
#include <fstream>
#include <gl\gl.h>
#include <gl\glu.h>
#include <math.h>
#include <SDL.h>

Those are all my header files. I don''t know why any of them would cause any problems, and I''m not even sure they are causing the problems. If anyone knows what''s going on here, please help! If you need more info or something, just tell me and I''ll show you whatever you need. Thanks in advance for any help.

##### Share on other sites
The problem is that you''re linking two libraries that both implement the same spec. libc.lib and (something like) msvcrt.lib don''t get along.

I like pie.

##### Share on other sites
Try including SDL.h before the other headers...

##### Share on other sites
quote:
Original post by RenderTarget
The problem is that you're linking two libraries that both implement the same spec. libc.lib and (something like) msvcrt.lib don't get along.

I like pie.

I'm using MSVC++.NET 2003, and I don't know how to remove libraries and stuff in it. It's not easy like it was with 6.0. And should I get rid of libc or msvcrt? msvcrt is always giving me warnings and stuff.

EDIT: Ok so I found a way to ignore a specific library, and I put msvcrt.lib on the ignore list and I still get 4 unresolved external errors, then, if I put just libc.lib on the list I get like 67 unresolved external errors.

[edited by - Samith on April 21, 2004 4:22:18 PM]

##### Share on other sites
Have you checked out how to set up SDL in Visual Studio .NET? http://pgdc.purdue.org/sdltutorial/sdl_setup.html

Make sure to check that out before you remove any of the libraries, since I've never had to do that and I've developed a lot of stuff with SDL.

[edited by - denJeebus on April 21, 2004 4:23:54 PM]