如何安装 Molsketch?

如何安装 Molsketch?

我尝试在运行 cmake 之后运行 make 来安装 molsketch,此时我收到输出:

[  1%] Building CXX object libmolsketch/src/CMakeFiles/molsketch_LIB.dir/stereocenteritem.cpp.o
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp: In member function ‘virtual void Molsketch::StereoCenterItem::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*)’:
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:17: error: ‘StereogenicUnit’ is not a member of ‘OpenBabel’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:17: error: ‘StereogenicUnit’ is not a member of ‘OpenBabel’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:43: error: template argument 1 is invalid
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:43: error: template argument 2 is invalid
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:51: error: invalid type in declaration before ‘=’ token
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:66:97: error: cannot convert ‘OpenBabel::OBStereoUnitSet {aka std::vector<OpenBabel::OBStereoUnit>}’ to ‘int’ in initialization
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:68:40: error: request for member ‘size’ in ‘units’, which is of non-class type ‘int’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:69:17: error: request for member ‘at’ in ‘units’, which is of non-class type ‘int’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:70:62: error: request for member ‘at’ in ‘units’, which is of non-class type ‘int’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:73:17: error: request for member ‘at’ in ‘units’, which is of non-class type ‘int’
/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp:74:62: error: request for member ‘at’ in ‘units’, which is of non-class type ‘int’
make[2]: *** [libmolsketch/src/CMakeFiles/molsketch_LIB.dir/stereocenteritem.cpp.o] Error 1
make[1]: *** [libmolsketch/src/CMakeFiles/molsketch_LIB.dir/all] Error 2
make: *** [all] Error 2

cmake 的输出是:

-- Unit testing enabled, run make test to run them
-- Found OpenBabel Trunk with graphsym.h
Qt QTASSISTANT library not found.
creating /home/brentonhorne/Downloads/Molsketch_build/libmolsketch/src/include/molsketch
UIS = /home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/mechanismarrowdialog.ui;/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/libmolsketch/src/reactionarrowdialog.ui
Qt QTASSISTANT library not found.
UIS = /home/brentonhorne/Downloads/Molsketch-0.2.0-Source/molsketch/src/settings.ui;/home/brentonhorne/Downloads/Molsketch-0.2.0-Source/molsketch/src/drawwidget.ui
-- Test:  valence
-- Configuring done
-- Generating done
-- Build files have been written to: /home/brentonhorne/Downloads/Molsketch_build

答案1

杜宁制作,我在48%的时候遇到了和你一样的问题,
你需要把
Molsketch-0.2.0-Source/libmolsketch/src/stereocenteritem.cpp改一下第 66 行如:std::vector<OpenBabel::OBStereoUnit> units = FindStereogenicUnits(obmol, symmetry_classes);
当编译到90%的时候,遇到另一个问题:

Molsketch-0.2.0-Source/molsketch/src/mainwindow.cpp:22:28:致命错误:QAssistantClient:没有此文件或目录

我的Qt版本是4.8.5。Qt在4.7+之后删除了QAssistantClient。我的解决方案是,注释掉mainwindow.cpp和mainwindow.h中与QAssistantClient相关的每一行。

相关内容