On Jul 28, 2010, at 12:55 PM, Kaushik Sinha wrote:
I used “mex –v nlopt_optimize.c” and in-built C compiler in MATLAB cites error in nlopt_optimize.c file:
Error nlopt_optimize.c: .\nlopt.h: 165  missing identifier
Error nlopt_optimize.c: .\nlopt.h: 165 syntax error; found `void' expecting `;'

What C/C++ compiler are you using?

Someone previously emailed me that there is a problem with lcc, which doesn't like the "__declspec(dllimport)" keyword that Microsoft uses to indicate functions that must be imported from a DLL. If you are using lcc, you might consider switching to gcc (www.mingw.org) or Microsoft Visual C++.

If you are using lcc, you can also try deleting the "__declspec(dllimport)" keyword from the nlopt.h header file (just delete the "#define NLOPT_DLL" line) to see if that works. (I have no idea whether lcc is able to link to DLLs, but it will be obvious if it fails.)

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

Reply via email to