I tried to compile the mex file that comes with the binary version of
NLopt-2.2 both using Octave and Matlab on Windows XP, but I haven't
succeeded yet.

I guess I should have a .lib file, but I don't know how to create that.

Octave 3.2.4 for Windows gives the following result:

%%%%%
> mkoctfile nlopt_optimize.c -l libnlopt-0.dll
mkoctfile: unrecognized argument libnlopt-0.dll>

> mkoctfile nlopt_optimize.c -D libnlopt-0.def
mkoctfile: unrecognized argument libnlopt-0.def>

> mkoctfile nlopt_optimize.c -l libnlopt-0.lib
nlopt_optimize.c: In function 'struct_funcval':
nlopt_optimize.c:64: warning: implicit declaration of function
'mxIsFunctionHandle'
nlopt_optimize.c: In function 'make_opt':
nlopt_optimize.c:127: warning: unused variable 'i'
mingw32-g++-4.4.0-dw2: libnlopt-0.lib: No such file or directory
%%%%%

Matlab R13 for Windows with Lcc compiler gives the following result, which
is the same as Kaushik Sinha reported on 28 Jul 2010.

%%%%%
mex nlopt_optimize.c libnlopt-0.dll

  C:\PROGRA~1\MATLABR13\BIN\WIN32\MEX.PL: Error: mex cannot link to
'libnlopt-0.dll' directly.
  Instead, you must link to the file 'libnlopt-0.lib' which corresponds to
'libnlopt-0.dll'.

??? Error using ==> mex
Unable to complete successfully

>> mex nlopt_optimize.c libnlopt-0.def
Error nlopt_optimize.c: .\nlopt.h: 165  missing identifier
Error nlopt_optimize.c: .\nlopt.h: 165  syntax error; found `void'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 166  missing identifier
Error nlopt_optimize.c: .\nlopt.h: 166  syntax error; found `void'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 168  missing identifier
Error nlopt_optimize.c: .\nlopt.h: 168  syntax error; found `void'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 184  redeclaration of `nlopt_opt'
previously declared at .\nlopt.h 179
Error nlopt_optimize.c: .\nlopt.h: 184  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 185  missing identifier
Error nlopt_optimize.c: .\nlopt.h: 185  syntax error; found `void'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 186  redeclaration of `nlopt_opt'
previously declared at .\nlopt.h 184
Error nlopt_optimize.c: .\nlopt.h: 186  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 188  redeclaration of `nlopt_result'
previously declared at .\nlopt.h 161
Error nlopt_optimize.c: .\nlopt.h: 188  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 191  redeclaration of `nlopt_result'
previously declared at .\nlopt.h 188
Error nlopt_optimize.c: .\nlopt.h: 191  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 193  redeclaration of `nlopt_result'
previously declared at .\nlopt.h 191
Error nlopt_optimize.c: .\nlopt.h: 193  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 196  redeclaration of `nlopt_algorithm'
previously declared at .\nlopt.h 145
Error nlopt_optimize.c: .\nlopt.h: 196  syntax error; found `_stdcall'
expecting `;'
Error nlopt_optimize.c: .\nlopt.h: 197  too many errors

C:\PROGRA~1\MATLABR13\BIN\WIN32\MEX.PL: Error: Compile of
'nlopt_optimize.c' failed.

??? Error using ==> mex
Unable to complete successfully
%%%%%


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

Reply via email to