尝试使用Visual Studio构建OpenNN以在C#中使用

时间:2017-11-02 15:57:08

标签: c# c++ visual-studio dll opennn

Link来源。 Link到构建说明。

  1. 我为.NET 4.7创建了一个新的DLL C ++库项目。
  2. 我进入属性并将特征目录(依赖项)添加到"其他包含目录"和#34;其他#using Directories"。
  3. 我将opennn目录中的所有.h文件添加到项目" Header Files"目录和项目的所有.cpp文件"源文件"目录。
  4. 我尝试构建项目并获得大量相同的错误。我找到解决方案here,选择Source Files目录中的每个文件,进入属性,然后设置" Precompiled Header"到"不使用预编译标题"。
  5. 构建运行正常,我可以忽略一堆签名/未签名的不匹配警告。
  6. 我收到很多错误。

    missing type specifier - int assumed. Note: C++ does not support default-int ~ informedness_optimization_threshold.cpp ~ 172
    syntax error: missing ';' before '*' ~ informedness_optimization_threshold.cpp ~ 172
    'performance_functional_pointer': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 172
    'get_performance_functional_pointer': is not a member of 'OpenNN::TrainingStrategy' ~ informedness_optimization_threshold.cpp ~ 172
    'performance_functional_pointer': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 174
    left of '->get_neural_network_pointer' must point to class/struct/union/generic type ~ informedness_optimization_threshold.cpp ~ 174
    'maximum_iterations_number': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 238
    'MaximumIterations': is not a member of 'OpenNN::ThresholdSelectionAlgorithm' ~ informedness_optimization_threshold.cpp ~ 247
    'MaximumIterations': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 247
    'final_binary_classification_test': is not a member of 'OpenNN::InformednessOptimizationThreshold::InformednessOptimizationThresholdResults' ~ informedness_optimization_threshold.cpp ~ 275
    'maximum_iterations_number': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 316
    'maximum_time': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 325
    'maximum_time': undeclared identifier ~ informedness_optimization_threshold.cpp ~ 449
    'set_maximum_iterations_number': identifier not found ~ informedness_optimization_threshold.cpp ~ 527
    'set_maximum_time': identifier not found ~ informedness_optimization_threshold.cpp ~ 546
    
  7. 如何实现从C#调用OpenNN函数的最终目标?

1 个答案:

答案 0 :(得分:0)

我用流程编写了OpenNN。

  1. 从项目中删除informedness_optimization_threshold.cpp,informedness_optimization_threshold.h。

  2. 将tinyxml2.cpp,tinyxml2.h添加到tinyxml2文件夹中进行投影。

  3. 我认为这不是一个好的解决方案,但我们可能需要更多的OpenNN更新。