EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Error LNK2005 building Diamond's nullhttpd module on Windows
From: "J. Lewis Muir" <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Wed, 16 May 2018 16:20:52 -0500
Hello, all!

I'm trying to build Diamond's nullhttpd module on Windows, but I'm
getting a "LNK2005: _free already defined in libcmt.lib(free.obj)"
error, among others.  Does anyone know what's the matter?

One result of my web search suggested that it means I'm mixing code
compiled with /MD with code compiled with /MT, but I'm not sure that's
the case.  I'm using defaults and compiling for the win32-x86 EPICS
architecture.

Here's the first error line (the full output of the build is at the end
of this email):

===
link -nologo -subsystem:windows -dll -LTCG -incremental:no -opt:ref -release -implib:nullhttpd.lib -out:nullhttpd.dll cgi.obj files.obj http.obj win32.obj config.obj format.obj server.obj main.obj MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in libcmt.lib(free.obj)
===

Environment:

* 32-bit Windows 7 Pro
* Visual Studio C++ 2010 Express SP1
* 32-bit Strawberry Perl 5.26.2.1
* EPICS Base 3.14.12.7 + Known Problems patches
* EPICS_HOST_ARCH=win32-x86
* nullhttpd[1] 0-5-1dls5

Thank you!

Lewis

[1]: http://controls.diamond.ac.uk/downloads/support/nullhttpd/

===
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\>cd C:\opt\epics-module\nullhttpd

C:\opt\epics-module\nullhttpd>call C:\opt\epics-base\startup\win32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\opt\epics-module\nullhttpd>gmake
gmake: Entering directory 'C:/opt/epics-module/nullhttpd'
gmake -C ./configure install
gmake[1]: Entering directory 'C:/opt/epics-module/nullhttpd/configure'
perl C:\opt\epics-base/bin/win32-x86/makeMakefile.pl O.win32-x86 ../..
perl -MExtUtils::Command -e mkpath O.Common
gmake -C O.win32-x86 -f ../Makefile TOP=../.. \
    T_A=win32-x86 install
gmake[2]: Entering directory 'C:/opt/epics-module/nullhttpd/configure/O.win32-x86'
perl C:\opt\epics-base/bin/win32-x86/convertRelease.pl checkRelease
gmake[2]: Leaving directory 'C:/opt/epics-module/nullhttpd/configure/O.win32-x86'
gmake[1]: Leaving directory 'C:/opt/epics-module/nullhttpd/configure'
gmake -C ./src install
gmake[1]: Entering directory 'C:/opt/epics-module/nullhttpd/src'
perl C:\opt\epics-base/bin/win32-x86/makeMakefile.pl O.win32-x86 ../..
perl -MExtUtils::Command -e mkpath O.Common
gmake -C O.win32-x86 -f ../Makefile TOP=../.. \
    T_A=win32-x86 install
gmake[2]: Entering directory 'C:/opt/epics-module/nullhttpd/src/O.win32-x86'
"Installing generic include file ../../include/nullhttpd.h"
mkdir ../../include
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\cgi.c
cgi.c
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\files.c
files.c
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\http.c
http.c
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\win32.c
win32.c
..\win32.c(141) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\config.c
config.c
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\format.c
format.c
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\server.c
server.c
..\server.c(46) : warning C4133: 'function' : incompatible types - from 'long *' to 'const time_t *'
..\server.c(70) : warning C4133: 'function' : incompatible types - from 'long *' to 'const time_t *'
..\server.c(447) : warning C4244: '=' : conversion from 'time_t' to 'int', possible loss of data
cl -c                -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -Ox -GL -Oy-   -W3     -DWIN32    -MD     -I. -I..\\O.Common -I. -I.. -I..\\..\\include\\os\\WIN32 -I..\\..\\include -IC:\opt\epics-base\\include\\os\\WIN32 -IC:\opt\epics-base\\include          ..\\main.c
main.c
link -nologo -subsystem:windows -dll -LTCG -incremental:no -opt:ref -release       -implib:nullhttpd.lib -out:nullhttpd.dll         cgi.obj files.obj http.obj win32.obj config.obj format.obj server.obj main.obj
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in libcmt.lib(free.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: __errno already defined in libcmt.lib(dosmap.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _signal already defined in libcmt.lib(winsig.obj)
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _exit already defined in libcmt.lib(crt0dat.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
server.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
nullhttpd.dll : fatal error LNK1120: 1 unresolved externals
gmake[2]: *** [C:\opt\epics-base/configure/RULES_BUILD:306: nullhttpd.dll] Error 1120
gmake[2]: Leaving directory 'C:/opt/epics-module/nullhttpd/src/O.win32-x86'
gmake[1]: *** [C:\opt\epics-base/configure/RULES_ARCHS:61: install.win32-x86] Error 2
gmake[1]: Leaving directory 'C:/opt/epics-module/nullhttpd/src'
gmake: *** [C:\opt\epics-base/configure/RULES_DIRS:83: src.install] Error 2
gmake: Leaving directory 'C:/opt/epics-module/nullhttpd'
===

Replies:
Re: Error LNK2005 building Diamond's nullhttpd module on Windows J. Lewis Muir

Navigate by Date:
Prev: Re: PyEPICS timeout in jupyter Shen, Guobao
Next: Re: PyEPICS timeout in jupyter Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Reminder: June EPICS Meeting at Argonne Andrew Johnson
Next: Re: Error LNK2005 building Diamond's nullhttpd module on Windows J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024