【问题标题】:Error:.. 'va_list' has not been declared错误:.. 'va_list' 尚未声明
【发布时间】:2013-09-06 10:22:19
【问题描述】:

我一直在尝试编译 flann,但出现了这个错误! ''va_list' 尚未声明' 谁能帮我解决这个错误? 如果可以的话,请让我这么简单,我真的是编程新手!

In file included from ./flann/nn/index_testing.h:41,
                 from ./flann/flann.hpp:43,
                 from src/common.hpp:12,
                 from src/main.cpp:9:
./flann/util/logger.h:74: error: 'va_list' has not been declared
Makefile:43: recipe for target `src/main.o' failed
make: *** [src/main.o] Error 1

这里是 logger.h

#ifndef LOGGER_H
#define LOGGER_H

#include <cstdio>
#include "flann/general.h"


namespace flann
{

class Logger
{
    FILE* stream;
    int logLevel;

public:

    Logger() : stream(stdout), logLevel(LOG_WARN) {};

    ~Logger()
    {
        if (stream!=NULL && stream!=stdout) {
            fclose(stream);
        }
    }

    void setDestination(const char* name)
    {
        if (name==NULL) {
            stream = stdout;
        }
        else {
            stream = fopen(name,"w");
            if (stream == NULL) {
                stream = stdout;
            }
        }
    }

    void setLevel(int level) { logLevel = level; }

    int log(int level, const char* fmt, ...);

    int log(int level, const char* fmt, va_list arglist);

    int fatal(const char* fmt, ...);

    int error(const char* fmt, ...);

    int warn(const char* fmt, ...);

    int info(const char* fmt, ...);
};

extern Logger logger;

}

#endif //LOGGER_H

【问题讨论】:

标签: c++ compiler-construction variadic-functions flann


【解决方案1】:

您错过了相关宏的包含

 #include <cstdarg>

【讨论】:

    猜你喜欢
    • 2011-01-22
    • 1970-01-01
    • 1970-01-01
    • 2013-08-21
    • 1970-01-01
    • 2012-11-24
    • 2016-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多