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 / August 2003

Tip: Looking for answers? Try searching our database.

unresolved externals with mixed mode DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen Ahn - 30 Jul 2003 05:41 GMT
Using : VS.NET 2003,

I'm attempting to create a mixed-mode C++ DLL (i.e. has both managed and
unmanaged code). When attempting to reference globals _timezone and
_daylight,
I get the following error at link time :

LINK : error LNK2020: unresolved token (0A000023) _timezone
LINK : error LNK2020: unresolved token (0A000024) _daylight
LINK : fatal error LNK1120: 2 unresolved externals

My link options look like this (remember, this is mixed mode) :

/INCREMENTAL /NOLOGO /LIBPATH:".\lib" /DLL
/NODEFAULTLIB:"LIBCMT.LIB" /NODEFAULTLIB:"LIBCMTD.lib"
/NODEFAULTLIB:"nochkclr.obj" /INCLUDE:__DllMainCRTStartup@12
/SUBSYSTEM:WINDOWS /NOENTRY msvcrt.lib kernel32.lib user32.lib
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
[... my objs]

Any ideas why the linker can't find these variables ?

TIA,
Stephen
Gautam Bhakar [MSFT] - 04 Aug 2003 18:56 GMT
The problem here that you are not really linking to libcmt.lib or
libcmtd.lib which have the definition for _timezone. Note that you are
using /nodefault:libcmt.lib which doesn't pick these libs by default and
thus you will need to explicitly specify them on linker commandline.

Signature

Gautam Bhakar, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------

| From: "Stephen Ahn" <stevea@edi.com.au>
| Subject: unresolved externals with mixed mode DLL
[quoted text clipped - 9 lines]
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.vc.libraries:2279
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc.libraries
|
[quoted text clipped - 23 lines]
| TIA,
| Stephen
Stephen Ahn - 05 Aug 2003 03:28 GMT
If I link one of these libraries, then I get a linker warning such as :

LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other
libs;
use /NODEFAULTLIB:library

I guess this is conflicting with msvcrt.dll, which I have to use in mixed
mode, as per :
http://support.microsoft.com/?id=814472

Ideas ?

Thanks,
Stephen

> The problem here that you are not really linking to libcmt.lib or
> libcmtd.lib which have the definition for _timezone. Note that you are
[quoted text clipped - 42 lines]
> | TIA,
> | Stephen

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.