Oliver,
Yep, tried that. Here's the current failure after that change and
current diff against latest svn.
[exec] LINK : warning LNK4224: /COMMENT is no longer supported; ignored
[exec] lcms114.lib(cmserr.obj) : error LNK2019: unresolved
external symbol __iob referenced in function _cmsSignalError
[exec] ..\lcmm.dll : fatal error LNK1120: 1 unresolved externals
[exec] NMAKE : fatal error U1077: 'link' : return code '0x460'
[exec] Stop.
thanks,
dims
On 10/22/07, Oliver Deakin <[EMAIL PROTECTED]> wrote:
> Hi Dims,
>
> Looks like you're doing pretty well, that's quite far into the native
> build! Interestingly, when I build the natives with MSVC .NET 2003 I
> also get the warning:
> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
>
> but it is not an error and the build continues, so I wonder if it has
> been promoted to an error for MSVC 2005. I looked at your link line and
> it is exactly the same as mine (which works) so Im guessing its a
> difference between linker versions. Having a google around it appears
> that libcmt.lib is the static version of the C runtime, whereas we want
> to link against the dynamic version msvcrt.lib. It's not entirely clear
> to me why it seems to be linking against both msvcrt.lib and libcmt.lib.
>
> If you specify /NODEFAULTLIB:"libcmt.lib" in rules.mak does this help?
> Adding it to the two "link" lines should do the job I think - i.e. the
> link line for DLLNAME and the link line for EXENAME. Adding this option
> to my .NET 2003 build doesn't seem to affect the build, and I can run
> the LUNI tests successfully so it doesn't appear to hurt.
>
> I wonder if we should have this flag always set so that we definitely
> don't link against the static C runtime library?
>
> Regards,
> Oliver
>
> Davanum Srinivas wrote:
> > Folks,
> >
> > Neex your help. Platform is Windows XP. Please see enclosed diff for
> > the changes i had to make to get this far.
> >
> > Products:
> > - Microsoft Platform SDK for Windows Server 2003 R2
> > - Microsoft Visual C++ 2005 Express Edition
> > - Microsoft Macro Assembler 8.0 (MASM) Package (x86) /
> >
> > Current failure:
> >
> > [exec] link /debug /opt:icf /opt:ref /INCREMENTAL:NO /NOLOGO
> > -entry:[EMAIL PROTECTED] -dll /BASE:0x13300000 -machine:i386
> > /comment:"LCMM Wrapper native code. (c) Copyright 2005 - 2006 The
> > Apache Software Foundation or its licensors, a
> > s applicable." -subsystem:windows -out:..\lcmm.dll -map:..\lcmm.map
> > ..\shared\cmmerror.obj ..\shared\cmmio.obj ..\shared\
> > cmmxforms.obj ..\shared\NativeCMM.obj
> > ..\shared\NativeImageFormat.obj lcmm.res
> > C:\APACHE\harmony\working_classlib\deploy\li
> > b\hycommon.lib C:\APACHE\harmony\working_classlib\deploy\lib\hythr.lib
> > C:\APACHE\harmony\working_classlib\deploy\lib\hysig.li
> > b C:\APACHE\harmony\working_classlib\deploy\lib\hypool.lib
> > C:\APACHE\harmony\working_classlib\deploy\lib\vmi.lib C:\APACHE\h
> > armony\working_classlib\deploy\..\depends\libs\build\lcms\lcms114.lib
> > ws2_32.lib Iphlpapi.lib kernel32.lib ws2_32.lib advap
> > i32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib
> > C:\APACHE\harmony\working_classlib\deploy\lib\lcmm.exp
> > [exec] LINK : warning LNK4224: /COMMENT is no longer supported;
> > ignored
> > [exec] LIBCMT.lib(crtheap.obj) : error LNK2005: __malloc_crt
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already
> > defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(realloc.obj) : error LNK2005: _realloc already
> > defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already
> > defined in MSVCRT.lib(cinitexe.obj)
> > [exec] LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already
> > defined in MSVCRT.lib(cinitexe.obj)
> > [exec] LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already
> > defined in MSVCRT.lib(cinitexe.obj)
> > [exec] LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already
> > defined in MSVCRT.lib(cinitexe.obj)
> > [exec] LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer
> > already defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already
> > defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(mlock.obj) : error LNK2005: __lock already
> > defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LIBCMT.lib(stricmp.obj) : error LNK2005: __stricmp already
> > defined in MSVCRT.lib(MSVCR80.dll)
> > [exec] LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with
> > use of other libs; use /NODEFAULTLIB:library
> > [exec] LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with
> > use of other libs; use /NODEFAULTLIB:library
> > [exec] LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external
> > symbol _main referenced in function ___tmainCRTStartup
> > [exec] ..\lcmm.dll : fatal error LNK1120: 1 unresolved externals
> > [exec] NMAKE : fatal error U1077: '"C:\Program Files\Microsoft
> > Visual Studio 8\VC\BIN\link.EXE"' : return code '0x460'
> > [exec] Stop.
> >
> > Any ideas?
> >
> > thanks,
> > dims
> >
> >
>
> --
> Oliver Deakin
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
--
Davanum Srinivas :: http://davanum.wordpress.com
Index: working_classlib/depends/build/rules.mak
===================================================================
--- working_classlib/depends/build/rules.mak (revision 587081)
+++ working_classlib/depends/build/rules.mak (working copy)
@@ -49,7 +49,8 @@
$(COMMENT) \
-subsystem:windows -out:$@ -map:$*.map \
$(BUILDFILES) $(VIRTFILES) $(MDLLIBFILES) $(SYSLIBFILES) \
- kernel32.lib ws2_32.lib advapi32.lib user32.lib gdi32.lib \
+ /NODEFAULTLIB:LIBCMT \
+ msvcrt.lib kernel32.lib ws2_32.lib advapi32.lib user32.lib gdi32.lib \
comdlg32.lib winspool.lib $(LIBPATH)$(*F).exp
if exist $(DLLNAME).manifest \
mt -manifest $(DLLNAME).manifest -outputresource:$(DLLNAME);#2
Index: working_classlib/depends/build/defines.mak
===================================================================
--- working_classlib/depends/build/defines.mak (revision 587081)
+++ working_classlib/depends/build/defines.mak (working copy)
@@ -38,6 +38,8 @@
!ENDIF
HYCOMMONCFLAGS = \
+ -D_CRT_SECURE_NO_DEPRECATE \
+ -D_CRT_SECURE_NO_WARNINGS \
-$(WARNING_LEVEL) -GF -Gs -MD -Zm400 \
-D_DLL -D_MT -D_WINSOCKAPI_ $(PLATFORM_64) \
/I$(HY_HDK)\include /I$(HY_HDK)\jdk\include /I.
Index: working_classlib/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
===================================================================
--- working_classlib/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
(revision 587081)
+++ working_classlib/modules/awt/src/main/native/lcmm/shared/NativeCMM.c
(working copy)
@@ -27,7 +27,7 @@
int gl_cmsErrorHandler(int errorCode, const char *msg) {
if(errorCode == LCMS_ERRC_ABORTED) {
- errMsg = strdup(msg); // Throw exception later, after returning control
from cmm
+ errMsg = _strdup(msg); // Throw exception later, after returning control
from cmm
}
return 1;
Index: working_classlib/modules/luni/src/main/native/launcher/shared/main.c
===================================================================
--- working_classlib/modules/luni/src/main/native/launcher/shared/main.c
(revision 587081)
+++ working_classlib/modules/luni/src/main/native/launcher/shared/main.c
(working copy)
@@ -43,7 +43,7 @@
#define HARMONY_JARRUNNER_CLASSNAME "org.apache.harmony.vm.JarRunner"
#if defined(WIN32)
-#define PLATFORM_STRNICMP strnicmp
+#define PLATFORM_STRNICMP _strnicmp
#endif
#if defined(LINUX) || defined(FREEBSD) || defined(AIX) || defined(MACOSX)
Index: working_classlib/modules/portlib/src/main/native/port/windows/hyosdump.c
===================================================================
--- working_classlib/modules/portlib/src/main/native/port/windows/hyosdump.c
(revision 587081)
+++ working_classlib/modules/portlib/src/main/native/port/windows/hyosdump.c
(working copy)
@@ -315,7 +315,7 @@
{
pidStore[0] = '-';
/* this env var is set to append a unique identifier to the dump file
name */
- itoa (GetCurrentProcessId (), &pidStore[1], 10);
+ _itoa (GetCurrentProcessId (), &pidStore[1], 10);
}
else
{