質問編集履歴
2
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
+
提示コードですがクラス部の`///`コメント部にある乱数のクラスの宣言をすると、エラーになるのですが
|
1
|
-
提示コード
|
2
|
+
提示コード`コンストラクタ`のような書き方をしたいのですがこれはどうやってコンパイルエラーを回避するのでしょうか?
|
2
3
|
|
3
4
|
|
4
5
|
|
1
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,25 @@
|
|
22
22
|
}
|
23
23
|
```
|
24
24
|
|
25
|
+
##### Error
|
26
|
+
```
|
27
|
+
shigurechan@shigurechan-System-Product-Name:~/Program/SDLGame/Tetris$ sh run.sh
|
28
|
+
g++ -c -MMD -MP src/Game.cpp -o obj/Game.o
|
29
|
+
In file included from src/Game.cpp:9:
|
30
|
+
src/Game.hpp:57:39: error: ‘seed_gen’ is not a type
|
31
|
+
57 | std::default_random_engine engine(seed_gen());
|
32
|
+
| ^~~~~~~~
|
33
|
+
src/Game.hpp:58:42: error: expected identifier before numeric constant
|
34
|
+
58 | std::uniform_int_distribution<> dist(0, 7);
|
35
|
+
| ^
|
36
|
+
src/Game.hpp:58:42: error: expected ‘,’ or ‘...’ before numeric constant
|
37
|
+
make: *** [Makefile:13: obj/Game.o] エラー 1
|
25
38
|
|
39
|
+
|
40
|
+
Compile Error
|
41
|
+
|
42
|
+
|
43
|
+
```
|
26
44
|
##### クラス
|
27
45
|
```cpp
|
28
46
|
#ifndef ___GAME_HPP__
|