小编JGe*_*eis的帖子

为什么c ++标准库不起作用?

我一直试图让我从学校服务器下载的程序在我的mac上脱机运行.我尝试通过以下教程更新GCC,由于某些原因,即使我使用给定的命令,教程也不起作用.

现在当我编译..我得到一个错误,说没有找到..我不明白.我已经更新了Xcode ..跟随了大量的教程..我仍然无法得到运行的东西!

为什么说找不到随机,导致致命错误?

谢谢

错误:

DungeonLevel.h:6:10: fatal error: 'random' file not found
Run Code Online (Sandbox Code Playgroud)

"由于这是一个编码站点,我需要提供代码,因为我可能忘了包含头文件......"

#ifndef _DungeonLevel_included_
#define _DungeonLevel_included_

#include "Tile.h"
#include <vector>
#include <random>

class Player;

class DungeonLevel {
public:
    DungeonLevel(int iWidth, int iHeight, std::mt19937 & randomGen);
    ~DungeonLevel(void);

    void dump();
    char at(int x, int y);

    Creature * removeCreature(Creature * creatureToRemove);

    void moveCreature(Creature * creatureToMove, char dir);
    void placeInGame(Creature * creatureToPlace, std::mt19937 & randomGen);
    void placeInGame(Creature & creatureToPlace, std::mt19937 & randomGen);
    Tile & returnTile(int x,int y);
    int getWidth();
    int getHeight();

private: …
Run Code Online (Sandbox Code Playgroud)

c++ macos terminal gcc standard-library

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

gcc ×1

macos ×1

standard-library ×1

terminal ×1