Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:44+00:00 2026-05-27T17:52:44+00:00

I got the c++/cli dll to link to a vc++ dll, but when trying

  • 0

I got the c++/cli dll to link to a vc++ dll, but when trying it with the static version of the vc++ lib there are a bunch of linker errors. I want to use static so I dont have to copy all of the other vc++ dll files into my main c# project, which uses the c++/cli dll.

The vc++ library has the following properties:
*built in vs2008
*Static library
*uses MFC in a static library
*No common language runtime support

the c++/cli library has these properties:
*built in vs2010
*Dynamic Library
*Use of MFC in a shared DLL
*Common Language Runtime Support
*linker->input contains the vc++ lib file

I tried linking the vc++ lib it after building it in vs2010 but that didn’t help.

So I get like 90 LNK2005 errors like these from nafxcwd.lib:

1>nafxcwd.lib(dlgprop.obj) : error LNK2005: “public: struct _PROPSHEETPAGEA & __thiscall CPropertyPage::GetPSP(void)” (?GetPSP@CPropertyPage@@QAEAAU_PROPSHEETPAGEA@@XZ) already defined in mfc100d.lib(mfc100d.dll)

then like 30 or so of these:
1>libcmtd.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR100D.dll)

then three LNK4098 warnings:

LINK : warning LNK4098: defaultlib ‘msvcrtd.lib’ conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib ‘nafxcwd.lib’ conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib ‘libcmtd.lib’ conflicts with use of other libs; use /NODEFAULTLIB:library

then I get this last error:
libcmtd.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup

I looked up the LNK4098 warning on msdn and the solution was to add the conflicting libraries to the IgnoreSpecific Default libraries entry in the linker input settings, but this did not help.

Thanks,
alex

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:52:45+00:00Added an answer on May 27, 2026 at 5:52 pm

    You can’t link (C++) libraries build with different version of the VS compiler (sometimes it may accidentally seem to work but you’ll usually get hard to diagnose crashes later on). Additionally, your errors seem to be typical of selecting different CRT configurations (single/multi-threaded, debug/release etc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a .net solution (written in C++/CLI) which references some .dll projects as
I've got a WPF RenderTargetBitmap in C++/CLI and I want to be able to
I've got a peculiar error writing some C++/CLI code. I'm trying to make a
I've got a c# program which is using a c++/cli managed dll. The dll
I've got the following function in a C++/CLI class library DLL: public delegate void
I've got some C++/CLI software which is all nice and documented in a C#'ish
I've got a Visual C++/CLI app which uses beeps to signify good and bad
I've got following method in c#: public static T[] GetResult<T>(ulong taskId) { return GetResult(taskId).Cast<T>().ToArray();
I'm trying to write a little CLI Hangman game, just to create something in
I've been trying to statically link against a C++ library called Poco on Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.