<div dir="ltr">Hey guys:<br><br>Based on Damien's suggestion I tried different permutations of nodefaultlib to no avail. I am taking one last crack at linking to this in a debug build before getting into the building world (release is working sufficiently for now I believe)<br>
* I changed the /Code Generation/Runtime Library to Multi-threaded Debug (/MTd)
from the default dll version<br> * I link to just libipopt.lib (adding in others didn't seem to help).<br> * without setting any /nodefaultlib I get a bunch of duplicates like the following, all mentioned are from libcmt.lib such as:<br>
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)<br>1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)<br><br>
* With setting <font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">/NODEFAULTLIB:libcmt I get a bunch of unresolved symbols:<br>1>cpp_example.cpp<br>1>Linking... (Intel C++ Environment)<br>
1>xilink: executing 'link'<br>1>libipopt.lib(IpSumMatrix.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo<br>....<br><br> * With setting /NODEFAULTLIB:libcmtd I get 4 unresolved symbols:<br>
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library<br>1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)<br>
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)<br>
1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)<br>
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype<br>1>C:\working\libraries\etk\examples\test_etk_coin\Debug/test_etk_coin.exe : fatal error LNK1120: 4 unresolved externals<br>
<br>* With Setting </span></font><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> /NODEFAULTLIB:libcmt and then </span></font><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> /NODEFAULTLIB:libcmtd (or a superset of those) I get an enormous number of unresolved symbols<br>
<br>If anyone has any last minute suggestions on a permuation, I would love to give it a shot. Otherwise, do you suggest I try to make the windows binaries with Visual Studio or MingGW instructions? Which do you think is easier to get working for building the 4 permutations of builds (debug/release and multithreaded/multithreaded-dll)? Also, do you expect that I will have trouble with the multi-threaded dll build? I am using /MDd for my other libraries and am worried I may run into the opposite problem changing those over.<br>
</span></font><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"><br><br></span></font><div class="gmail_quote">On Thu, Aug 21, 2008 at 5:40 PM, Damien Hocking <span dir="ltr"><<a href="mailto:damien@khubla.com">damien@khubla.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Ye olde duplicate symbols. MS has 2
sets of libraries that supply C/C++ runtimes. You might need to specify
exactly which libs you don't want as part of the project extra
command-line options.</span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">/NODEFAULTLIB:libcmt /NODEFAULTLIB:libcmtd
/NODEFAULTLIB:libcpmt /NODEFAULTLIB:libcpmtd will remove the libc threaded and
unthreaded debug and release libs deom your build, and it should then just use
the msvcrt runtimes.</span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Libifcorert.lib is an Intel Fortran
runtime that comes with the compiler.</span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Damien</span></font></p>
<div>
<div style="text-align: center;" align="center"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">
<hr size="2" width="100%" align="center">
</span></font></div>
<p><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:ipopt-bounces@list.coin-or.org" target="_blank">ipopt-bounces@list.coin-or.org</a>
[mailto:<a href="mailto:ipopt-bounces@list.coin-or.org" target="_blank">ipopt-bounces@list.coin-or.org</a>] <b><span style="font-weight: bold;">On
Behalf Of </span></b>Jesse Perla<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, August 21, 2008
3:28 PM<br>
<b><span style="font-weight: bold;">To:</span></b> COIN-IPOPT Mailing List<br>
<b><span style="font-weight: bold;">Subject:</span></b> [Ipopt] Help with IPOPT
linking problems on Windows MSVC/Intel C++</span></font></p>
</div><div><div></div><div class="Wj3C7c">
<p><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<div>
<p style="margin-bottom: 12pt;"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">I am trying to get the
IPOPT samples running in MSVC or Intel C++ and am running into linking
errors. Here are my steps:<br>
<br>
1. Downloading the binaries available on:<a href="http://www.coin-or.org/download/binary/OS/" target="_blank"><span>http://www.coin-or.org/download/binary/OS/</span></a>
Note that the only binaries in: <a href="http://www.coin-or.org/download/binary/Ipopt/" target="_blank">http://www.coin-or.org/download/binary/Ipopt/</a>
are for linux64.<br>
a. (BTW, as a general consideration I would say that people may be overestimating
the applicability of cygwin vs. the native Intel or microsoft compilers when on
windows. Getting a development environment working with an optimizing
compiler on cygwin is very difficult).<br>
2. The sample program I am getting is from the source in Ipopt-3.4.2. I
am trying out the cpp_example.cpp mentioned in: <a href="http://www.coin-or.org/Ipopt/documentation/node32.html" target="_blank">http://www.coin-or.org/Ipopt/documentation/node32.html</a><br>
3. Since the makefile for this is for cygwin, I need to create my own. .<br>
a. I first added the 3 source files into a new project<br>
b. I ensured that the include path to the headers in the binary
distribution and the libraries directory were set properly.<br>
c. I added libipopt.lib to the linker inputs.<br>
4. I hit compile. All of the source compiled fine, but when linking, it
stated that a whole bunch of functions were already defined in core libraries
such as: MSVCRTD.lib. See notes below for some examples of these.<br>
5. To see if it would help, I added the names of the libraries to the
"ignore specific library" list in the linker input options. No
luck.<br>
6. I tried with Intel C++ vs. MSVC. No difference.<br>
7. I tried the "no default libs" selection in the project. A
million unresolved errors<br>
8. I tried opening the example that came in the binary distribution: called
osTestCode.<br>
a. Had a different link error for a library that wasn't in the binary
libs directory: 1>LINK : fatal error LNK1181: cannot open input file
'libifcorert.lib' <br>
b. That probably is an unrelated error, but why isn't this in the
distribution, and does it have anything to do with the empty IFORT directory in
the libs?<br>
<br>
Can anyone help? Below is a subset of the linker output to get the point:<br>
<br>
1>------ Rebuild All started: Project: test_etk_coin, Configuration: Debug
Win32 ------<br>
1>Deleting intermediate files and output files for project 'test_etk_coin',
configuration 'Debug|Win32'.<br>
1>Compiling with Intel(R) C++ 10.1.020 [IA-32]... (Intel C++ Environment)<br>
1>cpp_example.cpp<br>
1>MyNLP.cpp<br>
1>Compiling manifest to resources... (Microsoft VC++ Environment)<br>
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1<br>
1><br>
1>Copyright (C) Microsoft Corporation. All rights reserved.<br>
1><br>
1><br>
1>Linking... (Intel C++ Environment)<br>
1>xilink: executing 'link'<br>
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const
*)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)
already defined in libipopt.lib(IpIpoptApplication.obj)<br>
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class
std::locale::facet * __thiscall std::locale::facet::_Decref(void)"
(?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in
libipopt.lib(IpIpoptApplication.obj)<br>
1>libcpmt.lib(locale0.obj) : error LNK2005: "void __cdecl
_AtModuleExit(void (__cdecl*)(void))" (?_AtModuleExit@@YAXP6AXXZ@Z)
already defined in msvcprtd.lib(locale0_implib.obj)<br>
....<br>
1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in
msvcprtd.lib(MSVCP90D.dll)<br>
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in
MSVCRTD.lib(MSVCR90D.dll)<br>
1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already
defined in MSVCRTD.lib(MSVCR90D.dll)<br>
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined
in MSVCRTD.lib(MSVCR90D.dll)<br>
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined
in MSVCRTD.lib(MSVCR90D.dll)<br>
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in
MSVCRTD.lib(MSVCR90D.dll)</span></font></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>