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.

Error 1:
alias.cpp
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(75) : error C2001:
newlin
e in constant
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(75) : error C2015:
too ma
ny characters in constant
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(76) : error C2143:
syntax
 error : missing ')' before '{'
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(76) : error C2143:
syntax
 error : missing ')' before '{'
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(77) : error C2017:
illega
l escape sequence
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(77) : error C2137:
empty
character constant
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(77) : error C2143:
syntax
 error : missing ')' before 'constant'
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(77) : error C2780:
'void
std::replace(_FwdIt,_FwdIt,const _Ty &,const _Ty &)' : expects 4 arguments -
3 p
rovided
        D:\Program Files\Microsoft Visual Studio
10.0\VC\INCLUDE\algorithm(1317)
 : see declaration of 'std::replace'
D:\MinGW\home\matchcoder\openbabel-2.3.1\src\alias.cpp(77) : error C2059:
syntax
 error : ')'
NMAKE : fatal error U1077: 'D:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe' : return
code
'0x2'
Stop.

The alias.cpp:
line75:    if(_alias[0]=='R' && (_alias[1]=='\'' || _alias[1]=='? ||
isdigit(_alias[1])))
line76:   {
line77:      replace(_alias.begin(),_alias.end(),'?,'\'');
line78:      int n=1;
lline79:      if(_alias[1]=='\'' || _alias[1]=='?')

then I change the these code to 
line75:    if(_alias[0]=='R' && (_alias[1]=='\'' || _alias[1]=='?' ||
isdigit(_alias[1])))
line76:   {
line77:      replace(_alias.begin(),_alias.end(),'?','\'');
line78:      int n=1;
lline79:      if(_alias[1]=='\'' || _alias[1]=='?')

Is that correct? or is just a spell errors?

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
        D:\Program Files\Microsoft Visual Studio
10.0\VC\INCLUDE\xmemory(280) :
see reference to function template instantiation 'void
std::allocator<_Ty>::cons
truct<int>(OpenBabel::OBInternalCoord **,_Other &&)' being compiled
        with
        [
            _Ty=OpenBabel::OBInternalCoord *,
            _Other=int
        ]
        D:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(668)
: s
ee reference to function template instantiation 'void
std::_Cons_val<std::alloca
tor<_Ty>,OpenBabel::OBInternalCoord*,int>(_Alloc &,_Ty1 *,_Ty2 &&)' being
compil
ed
        with
        [
            _Ty=OpenBabel::OBInternalCoord *,
            _Alloc=std::allocator<OpenBabel::OBInternalCoord *>,
            _Ty1=OpenBabel::OBInternalCoord *,
            _Ty2=int
        ]
        D:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(688)
: s
ee reference to function template instantiation 'void
std::vector<_Ty>::emplace_
back<int>(_Valty &&)' being compiled
        with
        [
            _Ty=OpenBabel::OBInternalCoord *,
            _Valty=int
        ]
        D:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(675)
: s
ee reference to function template instantiation
'std::_Vector_iterator<_Myvec> s
td::vector<_Ty>::emplace<int>(std::_Vector_const_iterator<_Myvec>,_Valty
&&)' be
ing compiled
        with
        [
            _Myvec=std::_Vector_val<OpenBabel::OBInternalCoord
*,std::allocator<
OpenBabel::OBInternalCoord *>>,
            _Ty=OpenBabel::OBInternalCoord *,
            _Valty=int
        ]
        D:\MinGW\home\matchcoder\openbabel-2.3.1\src\mol.cpp(1195) : see
referen
ce to function template instantiation 'std::_Vector_iterator<_Myvec>
std::vector
<_Ty>::insert<int>(std::_Vector_const_iterator<_Myvec>,_Valty &&)' being
compile
d
        with
        [
            _Myvec=std::_Vector_val<OpenBabel::OBInternalCoord
*,std::allocator<
OpenBabel::OBInternalCoord *>>,
            _Ty=OpenBabel::OBInternalCoord *,
            _Valty=int
        ]
NMAKE : fatal error U1077: 'D:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe' : return
code
'0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio
10.0\VC\BI
N\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio
10.0\VC\BI
N\nmake.exe"' : return code '0x2'
Stop.

mol.cpp
line1192:  void OBMol::SetInternalCoord(std::vector<OBInternalCoord*>
int_coord) {
line1193:    if (int_coord[0] != NULL) {
line1194:      std::vector<OBInternalCoord*>::iterator it =
int_coord.begin();
line1195:      int_coord.insert(it, NULL);   // error is here ?
line1196:    }

then I change the these code to 
line1192:  void OBMol::SetInternalCoord(std::vector<OBInternalCoord*>
int_coord) {
line1193:    if (int_coord[0] != NULL) {
line1194:      std::vector<OBInternalCoord*>::iterator it =
int_coord.begin();
line1195:      int_coord.insert(it, (OBInternalCoord*)NULL);   // error is
here ?
line1196:    }

Is that correct ?can someone just help me ?



--
View this message in context: 
http://forums.openbabel.org/Compile-OpenBabel-2-3-1-with-VS2010-errors-tp4634564.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
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
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to