Link to home
Start Free TrialLog in
Avatar of Caminman
Caminman

asked on

Adding Libraries in Visual C++

Hello there!
I'm new to C++ (Mostly C/ASM before), and have joined the wonderful world of classes! :P

Anyway, when I try to implement a Win32 static library to my project, I get the following error:

LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

I've tried to create both tiny and bigger libraries, but I always get the exact same warning.

What is this, and why does it happen?
Avatar of Kashra
Kashra

Well, I'm no expert on Visual C++, but it seems like this error happens a lot when trying to incorporate static libraries with an MFC application.

You might try the compiler's suggestion and add the /nodefaultlib option to your project. Hopefully that'll solve your problem.

In Visual C++ 6.0, you can do this by going to:
Project -> Settings -> Link (tab)

Then go to the edit box at the bottom of the dialog box called "Project Options" and add "/nodefaultlib:libc.lib" (without quotations of course) to the options.

Good luck!
ASKER CERTIFIED SOLUTION
Avatar of jadams117
jadams117

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial