Thanks for looking into this, Benoit! Does this build a static library (.lib) or a shared library (.dll), or both?

On Jul 29, 2010, at 8:27 PM, Be-noix wrote:
- rename #include "config.h" to #include "config_nlopt.h"
because my project already had a config.h (bad idea)

This doesn't make sense to me. Surely you are compiling NLopt as a library? In which case the config.h file is internal to NLopt and is irrelevant to programs using NLopt. Programs using NLopt need only include the nlopt.h header and link the NLopt library.

because VC was in 'C' mode, and not 'C++', and you can define a
variable only at the beginning of a block in C

Actually, mixed declarations and code have been been a standard part of C for 11 years now. But I generally try to stick with 1989 C anyway, and I will fix the two instances you spotted in the next NLopt release.

(With these two fixes, it now compiles with gcc -std=c89 -pedantic.)

(I tried for one hour to force VC to use C++ but without any success)

If NLopt is not compiling as C++, I'd be interested to hear what the problems are. I can compile with "g++ -pedantic -ansi" without problems.

And success!
Maybe Steven you could include these modifs in the original source code?
(and if you want to CMakeList.txt ?)

I'd be happy to post the CMakeList.txt on the web site, although I'd prefer not to change the name of the config.h header file as explained above.

Steven

PS. I notice that the C99/IEEE function copysign is missing on Windows so you defined a macro, although apparently Microsoft defined a _copysign function because they love to be different. I'll include a check for this in the next release.

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

Reply via email to