Hello all :) It was a forgotten double declaration with a "extern".
Problem
I believe it is a problem of object between differents files or a problem of "&" or "*"
I have the error line:
-lws2_32/tmp/ccBWAJ1F.o: dans la fonction « Z2iav »:/home/myfolder/ia.hpp:217: référence indéfinie vers « union_range »collect2: erreur: ld a retourné 1 code d'état d'exécution
(undefined reference to union_range with 1 code state execution)
I am at 95% sure that the error is from my use of a CarSet object (union_range) in ia.hpp in valeur_main_board_range(moment()+1,union_range)
I have a very close function valeur_main_board(moment()+1) without any error.
ia.hpp
the error is here: int valeur_main = valeur_main_board_range(moment()+1,union_range);
in my file ia.hpp
#include "variable_calcule.hpp"
extern std::set<CardSet> union_range, resultat, range_joueur;
// the error was the "extern" to remove
void ia()
{
std::set<CardSet> union_range, resultat, range_joueur;
for (int j=0; j<10; j++)
{
range_joueur=range_action(action[0][j][1],j);
set_union(union_range.begin(),union_range.end(),range_joueur.begin(),range_joueur.end(),std::inserter(resultat,resultat.begin()));
union_range=resultat;
}
int valeur_main = valeur_main_board_range(moment()+1,union_range); // BUG HERE
}
valeur_main_board_range() code (using union_range)
union_range include from #include "variable_calcule.hpp" in include #include "analyse_action.hpp"
#include "CardSet.h"
using namespace pokerstove;
using namespace std;
int valeur_main_board_range(int nb_carte, std::set<CardSet> &range) {
int dessus=0;
[...]
return dessus;
}
If I find the answer I will remove unnecessary code for future readers. For the moment I prefer put too much... But if you want I remove or add code just ask :)
Thank you for your reading :)