3 votes

Erreurs de compilation inattendues du préprocesseur C++

Veuillez consulter le fichier suivant : (il s'agit d'un fichier complet)

#ifndef TEES_ALGORITHM_LIBRARY_WRAPPER_H
#define TEES_ALGORITHM_LIBRARY_WRAPPER_H

#ifdef _TEES_COMPILE_AS_LIB
#include <dfa\Includes\DFC_algorithms.hpp>
#include <DFA\FuzzyClassifier\FuzzyAlgorithmIntialization\InitFuzzyAlgorithm.hpp>
typedef teesalgorithm::tees_fuzzy_algorithms algorithms_switchyard_class;
#else
#include <DFA\Includes\commercial_algorithms.hpp>
//An incomplete class to hide implementation
class algorithms_switchyard_class;
#endif

class AlgorithmLibraryWrapper {
algorithms_switchyard_class * algorithmPtr_;

typedef teesalgorithm::tees_paramObj paramObj_type;
typedef teesalgorithm::tees_errorObj errorObj_type;  
typedef teesalgorithm::tees_statusObj statusObj_type;
typedef teesalgorithm::tees_dataObj dataObj_type;
typedef teesalgorithm::tees_outputObj outputObj_type;

public:

AlgorithmLibraryWrapper(const std::string& sAlgName, paramObj_type& paramObj,     errorObj_type& errObj, statusObj_type& statusObj, const char* sFilePath);
static bool dataReader(const std::string& sFileName, dataObj_type& dataObj,     errorObj_type& errObj, statusObj_type& statusObj);
bool runalgorithm(const dataObj_type& dataObj, outputObj_type& outObj, errorObj_type& errObj, statusObj_type& statusObj); 
~AlgorithmLibraryWrapper();

};

#ifdef _TEES_USE_COMPILED_ALGORITHM_LIB
#   ifdef _MSC_VER
    #if _MSC_VER < 1400  // If VC 2003
        #ifdef _DEBUG
            #error No AlgorithmLibWrapper libraries compiled for this version of VC
        #else
            #error No AlgorithmLibWrapper libraries compiled for this version of VC
        #endif
    #elif defined(UNDER_CE)  // Win CE
        #ifdef _DEBUG
            #pragma comment( lib, "AlgorithmLibWrapperCEd" )
        #else
            #pragma comment( lib, "AlgorithmLibWrapperCE" )
        #endif
    #else  // If VC 2005
        #ifdef _DEBUG
            #pragma comment( lib, "AlgorithmLibWrapperd" )
        #else
            #pragma comment( lib, "AlgorithmLibWrapper" )
        #endif
    #endif
#endif 
#endif

#endif //TEES_ALGORITHM_LIBRARY_WRAPPER_H

J'obtiens les erreurs suivantes ; je ne sais pas pourquoi. J'ai également compté manuellement les directives du préprocesseur.

AlgorithmLibraryWrapper.hpp:10:1 : unterminated #ifdef
AlgorithmLibraryWrapper.hpp:7:1 : unterminated #ifndef

J'utilise le mauvais compilateur gcc de vxWorks. Merci de me faire savoir si la faute est la mienne ou celle du compilateur.

0voto

Michael Burr Points 181287

C'est un peu long, mais dans votre fichier source, vous avez la ligne suivante :

#   ifdef _MSC_VER

où il y a des espaces entre les ' # et le nom de la directive ( ifdef ). Ceci est valable en C/C++ ; cependant, ce n'est pas très courant et je ne serais pas très surpris si un compilateur bizarre s'y opposait.

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X