0

all.

I’m compiling Ipopt-3.9.3 in Windows 10 & Visual C++ 2010 Express.

I’ve built the projects of libCoinBlas, libConHSL, libCoinLapack as well as libIpopt, and generated libCoinBlas.lib, libCoinHSL.lib, libCoinLapack.lib as well as libIpopt.lib in the correct paths but with some warnings.

While when I tried to build the projects of IpoptAmplSolver and hs071_cpp, there exists the following fatal errors.

5>  Generating Code...
5>     Creating library Release\IpoptAmplSolver.lib and object Release\IpoptAmplSolver.exp
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>Release\IpoptAmplSolver.exe : fatal error LNK1120: 3 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========


5>------ Rebuild All started: Project: hs071_cpp, Configuration: Release Win32 ------
5>  hs071_main.cpp
5>  hs071_nlp.cpp
5>  Generating Code...
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
5>Release\hs071_cpp.exe : fatal error LNK1120: 4 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========

Is there anyone who can kindly tell me how should I deal with it?

Thank you very much for your attention, and I’m looking forward to your kind aid.

Finally, I've solved this problem which is due to the undefined functions. I think my case is about a released software package rather than some specific procedure code, hence, it's a little different and relative simple.

Mi Peichao
  • 21
  • 5
  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – sashoalm Aug 05 '16 at 11:15
  • @sashoalm hi, thank you very much for your kind aid, and the post you recommended is quite helpful for me -- an absolute beginner. My problem is due to the undefined functions, but I think my case is about a released software package rather than some specific procedure code, hence, it's a little different and relative simple. – Mi Peichao Aug 07 '16 at 07:18
  • That's why it says "possible" :) – sashoalm Aug 07 '16 at 15:19
  • I'm very glad to know you, and now I can learn many things from your posts when I need them. – Mi Peichao Aug 08 '16 at 02:55

3 Answers3

0

Without knowing the specifics of the libraries you are using, I recommend that you try the following to deal with this error:

The error tells you that the linker is missing code for some function calls. This probably means that a library file is not found. Make sure that the linker can find all needed lib files. Check the property pages. Under the Linker->General->Additional library directories, make sure that the directories where your lib-files are located are present and under Linker->Input->Additional dependencies, make sure that the the lib-files are listed. Also make sure that the parameters are present for the different Configurations.

If this still does not help, check if your libraries depend on other libraries. These should be mentioned in the documentation of the libraries you are using.

Paul R.
  • 678
  • 5
  • 19
0

I've not built this, but here's what I would try from the start. From what you've said, you've compiled the .lib files that it links against and it's failing during linking.

So here are your options...

1) You've either missed a .lib file in the input list for the linker.

2) The actual .lib file doesn't contain the symbol that the linker needs (you can check this by dumping the symbols of the .lib file)

3) Your .lib file is compiled with either the wrong platform than what you're linking with or with the wrong type ie. release/debug.

4) The symbols in your lib are decorated because you're compiling as C++ instead of C, or visa-versa.

If you go through the above steps above, I'm pretty sure you'll find your problem, but you've not really given enough information to properly answer your question. Personally, I'd have a guess that you're compiling C as C++ or you've got the wrong platform type set for one of your lib files.

The Welder
  • 916
  • 6
  • 24
0

Thank you all very much for your patient and detailed advices that inspired me, and I finally find out that I should add some C files which define the necessary functions into my project. The detailed solution is as follows.

For example, I want to eliminate

5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_

Step 1: Run

f2c iladlr.f

In the Visual Stuido Command Prompt and generate iladlr.c.

Step 2: Add iladlr.c to my project.

Step 3: Rebuild.

Finally, everything goes well.

Mi Peichao
  • 21
  • 5