OpenNN是C++编写的神经网络库,从官网上下载后,使用VisualStudio打开可见如下项目树
其中项目opennn是用于生成静态链接库的,而其他所有项目都是案例。右键点击项目opennn,然后选择生成,VS将会自动编译出opennn.lib文件。新项目必须包含这个lib文件。
仅有lib文件是不够的,还需要一系列头文件来说明这个lib文件内部到底有什么函数。opennn的所有头文件(.h)都存放在./opennn目录下。
新建项目(1)新建一个C++控制台项目
(2)在根目录新建lib文件夹,将opennn.lib文件复制到该文件夹中
(3)在根目录新建include文件夹,把opennn的所有头文件(.h)都复制到该文件夹中
(4)打开项目属性,设置包含目录,如下图
(5)设置链接的库文件,如下图
(6)项目的cpp文件中写入以下代码。这段代码来自./blank,意思是一个空的神经网络项目,不实现任何功能
// OpenNN: Open Neural Networks Library // www.opennn.org // // B L A N K A P P L I C A T I O N // // Artificial Intelligence Techniques SL // artelnics@artelnics.com // System includes #include#include #include #include #include #include #include #include #include #include #include #include #include // Systems Complementaries #include #include #include // OpenNN includes #include "opennn.h" using namespace OpenNN; using namespace std; using namespace chrono; int main(void) { try { cout << "OpenNN. Blank Application." << endl; return 0; } catch(exception& e) { cerr << e.what() << endl; return 1; } } // OpenNN: Open Neural Networks Library. // Copyright(C) 2005-2020 Artificial Intelligence Techniques, SL. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(7)编译运行之后显示
OpenNN. Blank Application.
说明opennn已经可以正常运行
最后,我把lib文件夹和include文件夹整理如下,如有需要即可下载:
https://download.csdn.net/download/weixin_43325228/86246277



