When compiling it yourself, you may need to modify nlopt.h to add the lines

#define NLOPT_DLL
#define NLOPT_DLL_EXPORT

at the top when compiling NLopt, and then delete the second line (only define 
NLOPT_DLL) when compiling code that is linked against NLopt.  (See the comments 
at the top of nlopt.h)

On Aug 2, 2012, at 7:27 AM, Daniel Benčík wrote:
> I have downloaded the newest version of nlopt (2.2.4) and 
> followed the installation manual. I got into some linker errors. 
> Hence, I switched to compiling static libraries myself. However, 
> I got into the exact same linker errors. I use the example code 
> given on nlopt homepage. Namely, I receive the following errors:
> 
> unresolved external symbol __imp__nlopt_destroy@4 referenced in function _main
> unresolved external symbol __imp__nlopt_optimize@12 referenced in function 
> _main
> unresolved external symbol __imp__nlopt_set_xtol_rel@12 ...
> unresolved external symbol __imp__nlopt_add_inequality_constraint@20 ...
> unresolved external symbol __imp__nlopt_set_min_objective@12 ...
> unresolved external symbol __imp__nlopt_set_lower_bounds@8 ...
> unresolved external symbol __imp__nlopt_create@8 ...
> 1>D:\Desktop\nlopt static trial\Debug\nlopt static trial.exe : 
> fatal error LNK1120: 7 unresolved externals
> 
> I have tried googling, but found no remedy. 
> Any direction towards what I am doing wrong is much appreciated.
> Many thanks, 
> Daniel

_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to