0

My name is Hector Perez. I am an international student from Guatemala studying Computer Science and Music. I am very interested in using OpenNN for a Computer-Music project. I have tried today to create a Visual C++ project that has the appropriate dependencies (as stated in http://www.opennn.net/documentation/building_opennn.html).

However, I think after some attempts, I realized I was probably doing something wrong. I include my procedure after the end of this message. I would highly appreciate it if you can point me to a tutorial where it performs a project build step by step.

My procedure:

  1. Created a C++ project in Visual Studio.
  2. Right clicked the application folder in the Solution Explorer,
  3. Went to Properties under VC++ Directories.
  4. Copied the full paths for the dependencies into 'Include Directories'.
  5. I built the project, but errors occur - as if the files are not found.
  6. They are found if I explicitly use #include, but that's probably not the intent.

This is the kind of error I get. (JUST WAY BIGGER ! )

... SimplePatternRecognition.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenNN::NeuralNetwork::save(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?save@NeuralNetwork@OpenNN@@QEBAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function main
1>...C:\Users\Owner\documents\visual studio 2017\Projects\SimplePatternRecognition\x64\Debug\SimplePatternRecognition.exe : fatal error LNK1120: 46 unresolved externals
1>Done building project "SimplePatternRecognition.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
sheldonzy
  • 5,505
  • 9
  • 48
  • 86
Hector
  • 11
  • 1
  • You need to tell it to link against the library too probably – Flexo Oct 18 '17 at 07:08
  • There was originally NO .lib file. --- I tried building OpenNN with CMake, and posteriorly built a .sln file it created using Visual studio. And this created the .lib file. I had a development. I realized from research that probably a .lib file needs to be added, as well as the directory where the .lib file is (to Visual Studio Project). Using CMake, I was able to build the .lib file !!! – Hector Oct 18 '17 at 07:23
  • I tried now adding the .lib file to the project simplepattern recognition. The problem I have now is that it says that the .lib is x86, and the project is x64. This is a console project in Visual Studio 2017 , and only 32 bit option is available :( – Hector Oct 18 '17 at 07:25
  • You either need to build a 64 bit library or a 32bit executable then – Flexo Oct 18 '17 at 20:32
  • Hey Flexo. I did try changing the setting machine type target in Visual Studio project settings, but the still error still came up. – Hector Oct 19 '17 at 02:58
  • I also build openNN again explicitly making it 64 bit x64. And it did come with a .lib that I assume is 64 bit – Hector Oct 19 '17 at 02:59

1 Answers1

0

I solved it!

I put on this repository my sample code and my steps to add OpenNN to Visual Studio: Look at the README.md file.

REPOSITORY: https://github.com/HectorGit/allMyOpenNNCode

Hector
  • 11
  • 1