Why do I receive linking error when I try to create a C++ stand-alone external application in the Microsoft Visual C/C++ IDE?

3 views (last 30 days)
Why do I receive linking error when I try to create a C++ stand-alone external application in the Microsoft Visual C/C++ IDE 5.0 or 6.0 with the MATLAB C++ Math Library?
Here are the errors I am receiving:
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs;
use /NODEFAULTLIB:library
.\ex1.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
To resolve the problem please change the project settings to build a Multithreaded DLL in the Runtime Library. You can do this by:
1. Selecting Project from the main menu
2. Selecting Settings
3. Clicking on C/C++ Tab
4. Selecting Code Generation in the Category pulldown menu
5. In the Runtime Library field selecting Multithreaded DLL ( "Debug Multithreaded DLL" will not work)
6. Clicking OK
7. Rebuilding the .exe file

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!