Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Migration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 31 Mar 2005 04:49 GMT
Hi all,

   I got a *.lib files and some header files from a thrid party which is
developed using ANSI C. I am now trying to create a managed C++ application
and import those libraries. I added the lib file in the linker option and
include those header files inside the program. Everything is ok when i
complied the project.

   However, when I call one of the function inside the lib file I imported
and compile the project, a lot of multiple defined symbol error is found.
(e.g. ___argc already defined in libcmtd.lib(crt0dat.obj)). I don't know
what's wrong with it as I am new to both C++ and VC++.NET. Can anyone help
??

Kenneth
Bernd Muent - 31 Mar 2005 08:05 GMT
Ken schrieb:

>     I got a *.lib files and some header files from a thrid party which is
> developed using ANSI C. I am now trying to create a managed C++ application
[quoted text clipped - 6 lines]
> (e.g. ___argc already defined in libcmtd.lib(crt0dat.obj)). I don't know
> what's wrong with it as I am new to both C++ and VC++.NET. Can anyone help

Maybe you included the header files more then once?
"#pragma once" might help you.

B.

Signature

BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: kontakt@bmservices.de

Carl Daniel [VC++ MVP] - 31 Mar 2005 08:20 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
> libcmtd.lib(crt0dat.obj)). I don't know what's wrong with it as I am
> new to both C++ and VC++.NET. Can anyone help ??

The problem is that the library and the code you're trying to link it in to
were compiled with different runtime library settings (e.g. the library was
compiled with /MT and you're compiling with /MD).  Your choices are two:

1. Re-compile the library with /MD to match your managed code.

2. Add the linker option /NODEFAULTLIB:LIBCMTD.LIB to your linker settings
(you'll likely have to add /NODEFAULTLIB:LIBCMT.LIB to the release build
configuration as well).

-cd

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.