[Ipopt] redefinitions in config_ipopt.h

Stefan Vigerske stefan at math.hu-berlin.de
Fri Jun 5 15:45:15 EDT 2009


Hi,

the header files of Ipopt include config_ipopt.h in order to get some
information about the configuration that was used when the Ipopt library
was build, e.g., which linear solvers are available. There might be
something in the ipopt_config.h that is required also when the Ipopt lib
is used by a third party program like yours.
You could avoid the warnings by either including the ipopt header files
before your config.h file, or by adding some #undef PACKAGE and similar
before including the Ipopt header files.
In the first case, the IpoptConfig.h file will undefine the conflicting
macros after the inclusion of ipopt_config.h.

Hope this helps,
Stefan


> hello everyone,
> 
> im trying to call ipopt from another program. i compile my program using
> autotools. while doing "make", i recieve the warnings about some macros
> defined in config_ipopt.h. i dont understand why this file is actually
> included from IpoptConfig.h, especially after reading this thread:
> http://www.mail-archive.com/autoconf@gnu.org/msg15791.html
> 
> i can ignore the warnings for now as they are not serious enough, but looks
> like these could affect a more complicated setup.
> 
> the warnings:
> In file included from
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/IpoptConfig.h:27,
>                  from
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/IpDebug.hpp:12,
>                  from
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/IpUtils.hpp:14,
>                  from
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/IpTNLP.hpp:12,
>                  from ../src/base/IpoptEngine.h:10,
>                  from ../src/base/IpoptEngine.cpp:12:
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:182:1:
> warning: "PACKAGE" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:185:1:
> warning: "PACKAGE_BUGREPORT" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:188:1:
> warning: "PACKAGE_NAME" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:191:1:
> warning: "PACKAGE_STRING" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:194:1:
> warning: "PACKAGE_TARNAME" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:197:1:
> warning: "PACKAGE_VERSION" redefined
> <command-line>: warning: this is the location of the previous definition
> /home/mahajan/src/ipopt-3.6.1/build/include/coin/config_ipopt.h:209:1:
> warning: "VERSION" redefined
> <command-line>: warning: this is the location of the previous definition
> 
> --
> regards
> Ashutosh Mahajan
> http://coral.ie.lehigh.edu/~asm4
> 
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
> 



More information about the Ipopt mailing list