I am integrating the function lmder() from the cminpack package available from
http://devernay.free.fr/hacks/cminpack/into my C++ wxWidgets based program.
The claim is made there that these files are both C and C++ compatible files, but in this package all I find are .c extensions, so I am integrating them all as C files. When I include the headers from this package I enclose them in the appropriate code indicating these are C headers, and do the same for a function that is to be passed to lmder():
extern "C" {
#include "cminpack.h"
#include "cminpackP.h"
int
//__cminpack_decl_fcnder_mn__
fcn( void *p, int m, int n, const double *x, double *fvec, double *fjac, int ldfjac, int iflag );
}
I get these errors I do not know what to do about:
obj\Debug\Libraries\cminpack-1.3.6\lmder.o||In function `lmder':|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|216|undefined reference to `_imp__dpmpar'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|245|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|300|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|381|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|396|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|418|undefined reference to `_imp__enorm'|
obj\Debug\Libraries\cminpack-1.3.6\lmder.o:C:\Engineering Software\Libraries\cminpack-1.3.6\lmder.c|466|more undefined references to `_imp__enorm' follow|
obj\Debug\Libraries\cminpack-1.3.6\lmpar.o||In function `lmpar':|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|131|undefined reference to `_imp__dpmpar'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|177|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|207|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|227|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|258|undefined reference to `qrsolv'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|262|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\lmpar.c|306|undefined reference to `_imp__enorm'|
obj\Debug\Libraries\cminpack-1.3.6\qrfac.o||In function `qrfac':|
C:\Engineering Software\Libraries\cminpack-1.3.6\qrfac.c|196|undefined reference to `_imp__dpmpar'|
C:\Engineering Software\Libraries\cminpack-1.3.6\qrfac.c|201|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\qrfac.c|240|undefined reference to `_imp__enorm'|
C:\Engineering Software\Libraries\cminpack-1.3.6\qrfac.c|272|undefined reference to `_imp__enorm'|
obj\Debug\TIA Designer\src\JunctionCap.o||In function `ZN11JunctionCap19CalculateParametersEv':|
C:\Engineering Software\TIA Designer\src\JunctionCap.cpp|249|undefined reference to `_imp__lmder'|
||error: ld returned 1 exit status|
||=== Build failed: 20 error(s), 50 warning(s) (0 minute(s), 24 second(s)) ===|
In these errors the prefix "_imp__" suggest the GCC compiler is compiling these files that are source of these files as C++ files, not C files, in spite of these file's .c extensions. Where in Code::Blocks will I find compiler flags that will do this?
I am attempting to compile these cminpack files as static libraries. So another possibility that has occurred to me is the linker is trying to link as if these were dll files. But in the code I do not see these functions prefixed with __declspec(dllimport) or __declspec(dllexport). Is there another way these files might be marked for linking as if they are dll?