C ++命名空间“首先在这里定义”的bug?

时间:2014-03-22 03:01:29

标签: c++ sfml

编译时我有这个奇怪的错误。我已在此帖子的底部提供了该错误的图片,您也可以在此处查看错误列表:http://puu.sh/7EzYk.txt

代码:

#ifndef CFO_HPP
#define CFO_HPP

#include <string>
#include <SFML/Graphics.hpp>

class Res
{
    public:
        // Methods
        std::string getWord(std::string l, int x);
        std::string getWords(std::string l, int x, int y);
        int getWordCount(std::string l);
};

class shell;

namespace cfo
{
    // Variables
    static std::string version = "- Alpha [0.1]";
    static int screenshot = 0;

    // Classes
    Res res; // Tools etc.
    //shell config;
    //shell gfx;

    // Methods
    void screenshoter(sf::RenderWindow &window);
};

void cfo::screenshoter(sf::RenderWindow &window) // This was in a .cpp file, but I moved it here.
{
    sf::Image screen = window.capture();
    screen.saveToFile(screenshot + ".jpg");
    screenshot++;
}

#endif

BUG IMAGE:http://puu.sh/7EzG9.png

0 个答案:

没有答案