I use Eigen in my software, and today I ran into a problem caused by changing my code to create a static library for a dynamic library on Windows using Visual Studio 2013. The reason for this switch was not related to Eigen.
I embed Eigen in my own library file, which itself is then bound to my applications. As mentioned earlier, this library was before the static library until today; I just updated my codebase to generate a dll file.
Since making this change, I get the following error message from Visual Studio:
The block in -------------------- has been allocated using aligned routines, use _aligned_free ()
(this message appears many times with different addresses every time, I used the dash above, since I do not think that specific addresses are related to this problem).
selecting "repeat" opens the debugger on line 255 on Memory.h
Visual studio IntelliSense (if there is no debugging) assumes that EIGEN_ALIGN and EIGEN_HAS_MM_MALLOC are both defined as 1, EIGEN_MALLOC_ALREADY_ALIGNED and EIGEN_HAS_POSIX_MEMALIGN are both undefined. Accordingly, it should be run _mm_free (ptr), which (again based on IntelliSense) is an alias for _aligned_free (a). So it looks like this code should work with the correct function, but it is not.
When I change the code back to the static library, this question disappears.
The only thing that is remotely relevant that I found from numerous Google searches is an article from Intel Fortran Compiler, which says that this error message can be obtained from a library that was compiled in an earlier version, which is called by code compiled with the latest version. In addition to using Visual Studio C ++ 2013, I rebuilt the code several times to make sure it was completely recompiled from a clean state, and this error message is saved.
I downloaded the latest code from mercurial repo (default branch), but this did not solve the problem.
I tried to be as thorough as I could. If you need more information, please let me know.
Edit:
Further context:
The "client code" that the DLL uses in this case is Google Test; The error message appears after testing the wait - that is, the class in the DLL file starts the destructor to clear the temporary object. I'm not trying to do evil things, for example, allocate memory in a DLL file, and then de-allocate it in the driver application - partly because I find this so confusing ....