-----Original message-----
To: [email protected];
From: matchcoder <[email protected]>
Sent: Wed 16-05-2012 16:16
Subject: [Open Babel] Compile OpenBabel-2.3.1 with VS2010 errors
> I am a new to OpenBabel. I try to compile OpenBabel-2.3.1 with VS2010, But I
> get some errors,can somebody help me, thanks in advance.
Well, I just ran into one of these two issues. It turned out afterwards that
both of these issues have already been resolved in the development source, so
one solution would be to check out the latest sources. I'm giving some details
here below anyway, in case others run into this as well (that is, others like
me who just google the error message and find this question but not the answer).
> Error 1:
> alias.cpp
> D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(75) : error C2001:
> newline in constant
I didn't get this one here, but I'm working directly from the VS 2010 IDE, and
do not use NMAKE, like you did. In fact, what's in the source there, is
if(_alias[0]=='R' && (_alias[1]=='\'' || _alias[1]=='¢' ||
isdigit(_alias[1])))
{
replace(_alias.begin(),_alias.end(),'¢','\'');
int n=1;
if(_alias[1]=='\'' || _alias[1]=='¢')
with 'dollarcent signs'. Apparently that may give problems on some platforms
(this character is not in the lower 128 ASCII characters). Those dollarcents
have since been completely removed in the development source:
if(_alias[0]=='R' && (_alias[1]=='\'' || isdigit(_alias[1])))
{
unsigned int n = 1;
if(_alias[1]=='\'')
> Error 2:
> D:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\xmemory(208) :
> error C2
> 440: 'initializing' : cannot convert from 'int' to
> 'OpenBabel::OBInternalCoord *
> '
> Conversion from integral type to pointer type requires
> reinterpret_cast, C-style cast or function-style cast
Got this one here, too. The answer is that your changes are in principle
correct, though a static_cast may be slightly nicer, and is in fact what was
done in the source (which I found out after implementing the same thing
myself...):
mol.cpp, line 1195:
int_coord.insert(it, NULL);
was changed to
int_coord.insert(it, static_cast<OBInternalCoord*>(NULL));
and obutil.cpp, line 452:
vic.insert(it, NULL);
was changed in the same way.
The deeper reason for this is that VS 2010 implements some features from C++11,
notably a 'nullptr' constant to replace NULL and stricter rules for conversion
of NULL. See http://msdn.microsoft.com/en-us/magazine/ee336130.aspx for more
details.
So, if you really need version 2.3.1 with VS 2010, those changes would be what
you need.
Regards,
Paul.
Paul Becherer
Development Scientist
Culgi B.V.
Leiden, The Netherlands
tel.: +31-71-3322056
email: [email protected]
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss