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 / C++ Libraries / March 2005

Tip: Looking for answers? Try searching our database.

Duplicate Definitions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent - 10 Nov 2003 21:04 GMT
I moved a VS 6.0 COM project to .NET 2003.  It compiles
and links OK in the debug configuration.  When trying to
build a release version, I get the following error:

LIBC.lib(crt0dat.obj) : error LNK2005: __osplatform
already defined in atlmincrt.lib(atlinit.obj)

Has anybody run into this kind of a problem?

Thanks for any help,

Kent
Kent - 10 Nov 2003 22:16 GMT
I finally figured out the problem...I was using the C
library function 'strtol' and it was pulling in
crt0dat.obj.  I got rid of 'strtol' and the duplicate
definition went away.

Kent

>-----Original Message-----
>I moved a VS 6.0 COM project to .NET 2003.  It compiles
[quoted text clipped - 10 lines]
>Kent
>.
Todd Lucas - 09 Mar 2005 08:24 GMT
Thanks for the tip. I found another way to fix it (I want to be able to use
CRT string routintes, etc.).

I'm building a new ATL/WTL project. When I compiled for release, I got
these errors.

Linking...
LIBCMT.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in
atlmincrt.lib(atlinit.obj)
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup

The problem switch was under Project Properties, Configuration Properties,
General: "Minimize CRT Use in ATL" was set to Yes. In debug mode, it was
set to No. In both cases, the option "Use of ATL" was set to "Not Using
ATL".

The funny thing is that the help text at the bottom of the window for
"Minimize CRT Use in ATL" reads:

"Tells ATL to link to the C runtime libraries statically to minimize
dependencies; requires that 'Use of ATL' be set."

So it was an invalid configuration in the first place and Developer Studio
didn't warn about it. This is doubly frustrating because it's the ATL/WTL
Application Wizard that configures it that way!

This is a tool that is unsupported my Microsoft. It was nice of them to
provide it, as it is nice in many ways (the library itself is great, albeit
lacking in documentation). However, even a modicum of testing would have
revealed this. They would have only needed to reference strcpy and build
release. Oh well, at least it's easy to fix.

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.