Jose Antonio Martin has these (slightly edited) instructions for building ANN:

Dear Barry, I have built the library for windows succesfully and it works well.

The first problem was that the ann lib sources are defined taking into acout that if hte environment is WIN32.

This casues a problem for building the library under MinGW: ============================================================== #ifdef WIN32

//---------------------------------------------------------------------- // For Microsoft Visual C++, externally accessible symbols must be // explicitly indicated with DLL_API, which is somewhat like "extern." // // The following ifdef block is the standard way of creating macros // which make exporting from a DLL simpler. All files within this DLL // are compiled with the DLL_EXPORTS preprocessor symbol defined on the // command line. In contrast, projects that use (or import) the DLL // objects do not define the DLL_EXPORTS symbol. This way any other // project whose source files include this file see DLL_API functions as // being imported from a DLL, wheras this DLL sees symbols defined with // this macro as being exported. //---------------------------------------------------------------------- #ifdef DLL_EXPORTS #define DLL_API declspec(dllexport) #else #define DLL_API declspec(dllimport) #endif //---------------------------------------------------------------------- // DLL_API is ignored for all other systems //----------------------------------------------------------------------

#else

#define DLL_API

#endif #define DLL_API =================================================0

So, I have tested two methods for building under Windows XP.

Fisrt I have installed Dev-C++ which is an IDE tool to build c++ applications. I have manually maked a proyect a then configure it to build the ANN.lib under the lib directory of the ANN distribution.

There is no way of building the ANN library when WIN32 is defined, so I have modified the source of the ANN.h adding #define DLL_API That is to, I have eliminated :

====================== #ifdef DLL_EXPORTS #define DLL_API declspec(dllexport) #else #define DLL_API declspec(dllimport) ========================= from ANN.h

just by setting

#define DLL_API

wich causes DLL_API to have no effect.

After this, the library built succesfully under windows using MinGW.

The second way was then to prove the MSYS environment of MinGW.

Again, after the modification the lribary was succesfully generated.

I attached a .zip file to this page containing a Dev-C++ proyect file that build the ANN.lib under /lib directory i order that the python wrapper could be built.

Also, a more simple way for windows user which do not have Dev-C++ is to use the file Makefile.win

then use: mingw32-make --makefile=Makefile.win

this builds the library in the same way under windows with mingw.

Well, thats all for now.

Attachments