This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Compilers errors in memory.h

Tags: None
(comma "," separated)
jpicksley
Registered Member
Posts
7
Karma
0

Compilers errors in memory.h

Wed Oct 17, 2012 7:27 pm
When compiling Eigen 3.1.1 into a Visual Studio 2005 C++ project in debug I get the following error:

error C2061: syntax error : identifier 'ptr' c:\m_lincs\3p\eigen\eigen\src\Core\util\Memory.h 326

The code in memory.h is as follows:

template<typename T> inline T* construct_elements_of_array(T *ptr, size_t size)
{
for (size_t i=0; i < size; ++i) ::new (ptr + i) T;
return ptr;
}


Can anyone help with this, please?

Thanks.
jpicksley
Registered Member
Posts
7
Karma
0

Re: Compilers errors in memory.h

Thu Oct 18, 2012 1:25 pm
As a temporary work-around I've commented out the two for loop lines and put in a line to throw an std::exception, as this method doesn't seem to be getting called in my implementation. However, I'd like a proper solution if anyone can help.

Thanks.
Hauke
Registered Member
Posts
109
Karma
3
OS

Re: Compilers errors in memory.h

Thu Oct 18, 2012 1:44 pm
Hi James,

jpicksley wrote:As a temporary work-around I've commented out the two for loop lines and put in a line to throw an std::exception, as this method doesn't seem to be getting called in my implementation. However, I'd like a proper solution if anyone can help.

Unfortunately, I cannot help you with the issue since I have not been working with Visual Studio 2005 for years. When I first started using Eigen I added quite a few Visual Studio related fixes but Visual Studio 2005 was already outdated back then. I think there is pretty much no chance the we start to add Visual Studio 2005 support.

Unfortunately, the only suggestion I have is to switch to a newer version. Since Visual Studio 2012 has been recently released, I would recommend switching to this version (the express version is even free). Not only should Eigen compile out of the box but it should also show much much better performance with more recent compilers.

Kind regards,
Hauke
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Compilers errors in memory.h

Thu Oct 18, 2012 2:10 pm
indeed, it's already difficult enough for us to support more recent MSVC versions, so I don't see ourself maintaining support for MSVC 2005.Nevertheless, we can still accept patches...
jpicksley
Registered Member
Posts
7
Karma
0
Thanks for the replies. I can appreciate that you can't support everything so no worries.

Unfortunately moving onto a more recent version of Visual Studio is not something I can do at the moment, although it may be possible next year. As and when I move on I'll let you know what happens.

At present my temporary fix isn't something that I think is suitable long term (it may be for my specific use of Eigen but I suspect not for the wider user base). If I come up with something better I'll send it in.

Thanks again for your help.

James.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]