Die tree.h Datei:Ich habe codeabhängige Header in C, die mir Fehler geben. Wie kann ich es entfernen?
#ifndef tree
#define tree
#include "common.h"
#include "set.h"
/*Tree Structure*/
typedef struct
{
Set *set;
unsigned int setLength;
int vertexLength;
int *vertex;
int idle;
int parent;
int level;
int numberOfChildren;
} TreeNode;
typedef struct
{
TreeNode* node;
int nodeLength;
int height;
} Tree;
Tree* fill_tree(char *filename, int worldSize, int rank);
int get_number_of_leaves(Tree *tree);
TreeNode get_tree_node(int index, Tree* tree);
TreeNode* get_tree_nodes(Tree* tree);
int get_tree_nodes_length(Tree* tree);
void compute_level(int u, Tree* tree);
void print_tree(Tree* tree);
int get_max_level(Tree* tree);
int* create_task_list(Tree* tree, int* taskListLength, int rank);
int* map(int* taskList, int taskListLength, int* mapLength, int rank);
void generate_combination_sets(Tree* tree, int nodePerProcess, int rank);
#endif
Die set.h Datei:
#ifndef set
#define set
#include "common.h"
#include "tree.h"
/*Tree Structure*/
typedef struct
{
int combinationLength;
int* combination;
} Set;
Set* generate_subsets(int* vertex, int vertexLength, unsigned int pow_set_size, int rank);
Set* match(Set* parent, unsigned int parentLength, Set* child, unsigned int childLength, TreeNode childNode, TreeNode parentNode, unsigned int* solutionLength, Graph* g, int rank);
int* union_operation(int* parenteCombination, int parentCombinationLength, int* childCombination, int childCombinationLength, unsigned int* mergedLength, int rank);
int not_in_solution(Set* solution, int solutionLength , int* merged, unsigned int mergedLength);
void print_set(Set set);
#endif
Die common.h Datei:
#ifndef common
#define common
// Libraries
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <pthread.h>
#include <limits.h>
#include "mpi.h"
#include "graph.h"
#define true 1
#define false 0
#endif
ich Fehler haben, dass der Baum und der Satz Header-Dateien sind Code-abhängig, und der Compiler gibt mir einen Fehler, der nicht in tree.h und ebenso für set gefunden wird. Sollte ich alle Felder in die Datei common.h aufnehmen?
Welche der beiden markierten Programmiersprachen verwenden Sie _actually_? –