[Ipopt] libc.lib

tibor.vansa tibor.vansa at seznam.cz
Tue Oct 14 19:28:49 EDT 2008


Hi,

I use the visual studio 2005 to compile the IPOPT, and I get a link error:
fatal error LNK1104: cannot open file 'libc.lib' in project "hs071_cpp". I
tried to fix this problem by setting "properties->Linker->input->Ignore
Specific Library" as /NODEFAULTLIB:libc.lib. But it still doesn't work well.


------ Rebuild All started: Project: hs071_cpp, Configuration: Release Win32 ------
Deleting intermediate and output files for project 'hs071_cpp', configuration 'Release|Win32'
Compiling...
hs071_nlp.cpp
hs071_main.cpp
Generating Code...
Linking...
vcf2c.lib(open.obj) : error LNK2019: unresolved external symbol _errno referenced in function _f_open
vcf2c.lib(wrtfmt.obj) : error LNK2001: unresolved external symbol _errno
vcf2c.lib(endfile.obj) : error LNK2001: unresolved external symbol _errno
vcf2c.lib(sfe.obj) : error LNK2001: unresolved external symbol _errno
vcf2c.lib(fmt.obj) : error LNK2001: unresolved external symbol _errno
vcf2c.lib(wsfe.obj) : error LNK2001: unresolved external symbol _errno
vcf2c.lib(err.obj) : error LNK2001: unresolved external symbol _errno
Release/hs071_cpp.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Dokumenty\projekt\ipopt\Ipopt-3.5.4\Ipopt\MSVisualStudio\v8\hs071_cpp\Release\BuildLog.htm"
hs071_cpp - 8 error(s), 0 warning(s)
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========

I try both release, debug mode, I try to modify makefile.vc to 

CFLAGS = -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -MTd -DNO_My_ctype -DNO_ISATTY

I also google out solution

1. in Project / Settings

    - In Object/Library modules, you added smi.lib

    - ensure "Ignore all default libraries" is *un*checked.

    - in Project Options add manually  /nodefaultlib:"libc" 

    - add a new .c file in your project (any name)

    - in this .c file, put a single line:

int errno= 0;


2. Do Build => Rebuild all

3. You may have a problem with precompiled headers
=> In Project / Settings / C/C++, Category "Precompiled headers"
click the radio button "Not using precompiled headers"
And Rebuild all again.

Nothing works, pls help

Thx

Tibor



More information about the Ipopt mailing list