Closed erkangunpinar closed 7 years ago
Did you link to the snopt library? Those subroutines are all in the Fortran library snopt7.lib.
Thank you very much for your reply.
Yes, I linked "snopt7.lib", which is Win64 version, 1.47 MB, and I received a link from optimizers@ccom.ucsd.edu. However, I am using Win32 console application (Visual C++). I am not sure the problem arises from this Win32-Win64 conflict.
Another issue is that I could not access precompiled SNOPT C++ windows 32/64 libraries which is in below link:
You can't mix win32 and win64. Also, we haven't had C/C++ precompiled libraries on Windows for a while now. We're working on it...
Thank you Elizabeth, the program correctly compiled now when I used win 64 for both (lib and Windows Visual Studio C++), and I installed NAG Fortran and linked its following libraries: ifconsol.lib; ifmodintr.lib; libifcoremt.lib; libifport.lib; libirc.lib; libmmt.lib; svml_dispmt.lib.
However this time, problem arises in the f_sninit function in the snoptProblem constructor when I run the code. Below shows the error message:
Here is screenshoot of the debugging mode:
Again, thank you very much for your concern and help.
The above-mentioned problem is solved when the latest release of the SNOPT interface was used.
I recommend SNOPT users the below issues to avoid installation errors: 1) Installation and linkage of Fortran libraries such as ifconsol.lib; ifmodintr.lib; libifcoremt.lib; libifport.lib; libirc.lib; libmmt.lib; svml_dispmt.lib. 2) Properly linking snopt7.lib 3) Setting SNOPT_LICENSE in the environment variables 4) As the library is Win64, use of Win64 application in your program.
Hello,
I would like to get help about the following issue in below.
When I compile SNOPT C++ library in Visual Studio 2012, I got the following errors:
1>------ Build started: Project: Solver, Configuration: Debug Win32 ------ 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_sninit referenced in function "protected: thiscall snoptProblem::snoptProblem(char const ,char const )" (??0snoptProblem@@IAE@PBD0@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snspec referenced in function "public: int thiscall snoptProblem::setSpecsFile(char const )" (?setSpecsFile@snoptProblem@@QAEHPBD@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_sngetc referenced in function "public: int __thiscall snoptProblem::getParameter(char const ,char )" (?getParameter@snoptProblem@@QAEHPBDPAD@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_sngeti referenced in function "public: int __thiscall snoptProblem::getIntParameter(char const ,int &)" (?getIntParameter@snoptProblem@@QAEHPBDAAH@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_sngetr referenced in function "public: int thiscall snoptProblem::getRealParameter(char const *,double &)" (?getRealParameter@snoptProblem@@QAEHPBDAAN@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snset referenced in function "public: int thiscall snoptProblem::setParameter(char const )" (?setParameter@snoptProblem@@QAEHPBD@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snseti referenced in function "public: int __thiscall snoptProblem::setIntParameter(char const ,int)" (?setIntParameter@snoptProblem@@QAEHPBDH@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snsetr referenced in function "public: int thiscall snoptProblem::setRealParameter(char const *,double)" (?setRealParameter@snoptProblem@@QAEHPBDN@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snsetprint referenced in function "public: void thiscall snoptProblem::setPrintFile(char const *)" (?setPrintFile@snoptProblem@@QAEXPBD@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snend referenced in function "protected: thiscall snoptProblem::~snoptProblem(void)" (??1snoptProblem@@IAE@XZ) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snkera referenced in function "public: virtual int thiscall snoptProblemA::solve(int)" (?solve@snoptProblemA@@UAEHH@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snjac referenced in function "public: int thiscall snoptProblemA::computeJac(int &,int &)" (?computeJac@snoptProblemA@@QAEHAAH0@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snmema referenced in function "public: virtual void thiscall snoptProblemA::setWorkspace(void)" (?setWorkspace@snoptProblemA@@UAEXXZ) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snkerb referenced in function "public: virtual int thiscall snoptProblemB::solve(int)" (?solve@snoptProblemB@@UAEHH@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snkerc referenced in function "public: virtual int thiscall snoptProblemC::solve(int)" (?solve@snoptProblemC@@UAEHH@Z) 1>snoptProblem.obj : error LNK2019: unresolved external symbol _f_snmem referenced in function "public: virtual void __thiscall snoptProblemC::setWorkspace(void)" (?setWorkspace@snoptProblemC@@UAEXXZ) 1>C:\Users\erkan-pc\Desktop\prg\Solver\Debug\Solver.exe : fatal error LNK1120: 16 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Probably, I do not use the appropriate library.
I obained snopt7.lib (Win64) and snopt7.lic from optimizers@ccom.ucsd.edu.
And in the link http://ccom.ucsd.edu/~optimizers/downloads/software/trial/fortran/?id=20db6144cb7a, I could not get SNOPT C++ windows 32/64 libraries as the following message occurs: