c++ - C++:类未定义
问题描述
我正在为一些我根本不理解的基本错误而苦苦挣扎。
实用程序.cuh
#pragma once
#include "stdafx.cuh"
#include "NCMForest.cuh"
#include "NCMTree.cuh"
int readCSV(int Nrow, int Ncol, char *sep, char *filename, double **data, char **fields_names);
int closest_centroid(c_Node **pnodes, double *element, int nb_centroids, int nb_features);
NCMForest.cuh
#pragma once
#include "utils.cuh"
#include "stdafx.cuh"
#include "NCMTree.cuh"
class c_Forest
{
int nb_trees;
int max_depth;
int max_features;
int min_samples_split;
c_Tree **trees;
};
NCMTree.cuh
#pragma once
#include "utils.cuh"
#include "stdafx.cuh"
#include "NCMForest.cuh"
class c_Node;
class c_Tree;
class c_Node
{
public:
float *centroid; //Centroid coords
bool is_leaf; //Is it a leaf
int nb_children; //How many children
c_Node **children; //Node children
c_Node();
int update_centroid(); //Update the centroids
double **current_data;
};
class c_Tree
{
public:
int ID; //Tree ID
c_Node *root; //Root node
c_Tree(int p_features_per_node, int p_max_depth, int p_min_samples_split, int p_min_sample_leaf, int p_nb_features);
~c_Tree();
int train(int nb_labels, c_Node *currentNode);
int classify(double *element, c_Node *Node);
};
第一个是NCMForest.cuh第 14 行的标识符“ c_Tree ”未定义。第二个是utils.cuh第 8 行的标识符“c_Node”未定义”
我不明白为什么我有这个错误。定义此类的标头包含在文件中。有什么线索吗?:/
解决方案
推荐阅读
- ios - 在 iOS 13 中推送 UIViewController 会导致它与状态栏重叠
- ios - 我有 EXC_BREAKPOINT 错误,它只发生在真实设备中
- sql-server - 将代码中的错误消息存储在单独的表中
- java - 如何验证已取消的应用内订阅?
- angular - Angular 应用程序的 nginx 配置-子域映射现在可以工作
- java - 我有一个 JSON 响应,但我一直在使用它
- functional-programming - 为什么我的搜索功能总是输出真?
- javascript - 在两个选择选项之间共享值并使用相同的函数来更改值
- html - ul li 圆形设计与文字
- java - 如何从 JSONObject 获取 JSON 字符串?