ページ 11

龍神録プログラミングの館にて

Posted: 2011年3月19日(土) 02:38
by mm4600
龍神録プログラミングの館の、一章 キャラを描画してみようで下記のエラーが出ています

graph.cpp変更
#include "../include/GV.h"

extern ch_t ch;
extern int img_ch[2][12];

void graph_ch(){
DrawRotaGraphF(ch.x,ch.y,1.0f,0.0f,img_ch[0][ch.img],TRUE);
}

void graph_main(){
graph_ch();
}

1>c:\users\pc user\desktop\project\1章\mydat\source\graph.cpp(7): error C2228: '.x' の左側はクラス、構造体、共用体でなければなりません
1> 型は 'int' です。
1>c:\users\pc user\desktop\project\1章\mydat\source\graph.cpp(7): error C2228: '.y' の左側はクラス、構造体、共用体でなければなりません
1> 型は 'int' です。
1>c:\users\pc user\desktop\project\1章\mydat\source\graph.cpp(7): error C2228: '.img' の左側はクラス、構造体、共用体でなければなりません
1> 型は 'int' です。
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

教えていただけないでしょうか。

Re: 龍神録プログラミングの館にて

Posted: 2011年3月19日(土) 06:39
by ひよこ
4章ですね。

struct.hにch_tの中身を書いているかGV.hをincludeしているか確認してください。
<code>
//キャラクターに関する構造体
typedef struct{
int flag; //フラグ
int cnt; //カウンタ
int power; //パワー
int point; //ポイント
int score; //スコア
int num; //残機数
int mutekicnt; //無敵状態とカウント
int shot_mode; //ショットモード
int money; //お金
int img; //画像
int slow; //スローかどうか
double x,y; //座標
}ch_t;
</code>

Re: 龍神録プログラミングの館にて

Posted: 2011年3月19日(土) 08:18
by mm4600
>truct.h では

//キャラクターに関する構造体
typedef struct{
int flag; //フラグ
int cnt; //カウンタ
int power; //パワー
int point; //ポイント
int score; //スコア
int num; //残機数
int mutekicnt; //無敵状態とカウント
int shot_mode; //ショットモード
int money; //お金
int img; //画像
int slow; //スローかどうか
double x,y; //座標
}ch_t;

上記のとうり、ビルドしました。

Re: 龍神録プログラミングの館にて

Posted: 2011年3月19日(土) 08:51
by Ciel
変数の定義をしてないんじゃないですか?

Re: 龍神録プログラミングの館にて

Posted: 2011年3月28日(月) 13:43
by mm4600
長らく連絡せず申し訳ありません
解決しました。
何故だか