2017-06-05 14 views
-2

"HSlider.h"ファイルを使用しています。 "Draw.h"を使用しています。ここでは、それらを使用する関数を定義しています。 しかし、コンパイラは、私はそれらを定義していないと言っています(識別子が見つかりません)。私は類似のエラーについてフォーラムを検索しましたが、それは助けになりませんでした。識別子が見つかりません.C3861

私はVS 2015 Communtyで働いています。

ERROR例: エラーC3861 DrawGUIBox:プロジェクト\ Visual Studioの2015 \ \ユーザー\ LELの\ドキュメント\ try2 \ try2 \ 50 hslider.h:識別子が Try2 cを見つけません。あなたがそれを必要とする場合

HSlider.h

#include <string> 
#include <iostream> 
#include <map> 
#include <iterator> 
#include <conio.h> 
#include "Offsets.h" 

#include "Draw.h" 
using namespace std; 


class Button 
{ 
public: 
    void Init(float _x, float _y, float _w, float _h, int _r, int _g, int _b, int _a, int _rr, int _gg, int _bb, int _aa,int _onr,int _ong,int _onb) 
    { 
     x = _x; 
     y = _y; 
     w = _w; 
     h = _h; 
     r = _r; 
     g = _g; 
     b = _b; 
     a = _a; 
     rr = _rr; 
     gg = _gg; 
     bb = _bb; 
     aa = _aa; 
     onr = _onr; 
     onb = _onb; 
     ong = _ong; 

    } 
    void Move(float _x, float _y) 
    { 
     x = _x; 
     y = _y; 
    } 
    void Update(int _bindb) 
    { 
     BindB = _bindb; 
     DrawGUIBox(x, y, w, h, r, g, b, a, rr, gg, bb, aa); 
     POINT p; 
     GetCursorPos(&p); 

     if ((p.x > x&&p.x<x + w&&p.y>y&&p.y < y + h)) 
     { 
      if ((GetAsyncKeyState(VK_LBUTTON)&1)) 
      { 
       On = !On; 

      } 



     } 
     if ((GetAsyncKeyState(BindB)&1)) 
     { 
      On = !On; 
     } 
     if (On) 
     { 
      DrawGUIBox(x, y, w, h, r, g, b, a, onr,ong,onb, a); 
     } 

    } 
    bool Extract() 
    { 
     return On; 
    } 
    void Off() 
    { 
     On = false; 
    } 
private: 
    float x; 
    float y; 
    float w; 
    float h; 
    int r; 
    int g; 
    int b; 
    int a; 
    int rr; 
    int gg; 
    int bb; 
    int aa; 
    int onr; 
    int ong; 
    int onb; 
    int BindB; 
    bool On = false; 
    bool IsUP = true; 
}; 

Draw.h

#pragma once 
    #ifndef HDRAWFUNC_H 
    #define HDRAWFUNC_H 

    #include "DirectX.h" 

    #pragma warning(disable : 4244) //remove the incoming warns 
    #pragma warning(disable : 4996) //remove the incoming warns 

    #include <d3dx9.h> 
    #include <d3d9.h> 
    #define D3DFVF_TL (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1) 
    #pragma comment(lib, "d3d9.lib") 
    #pragma comment(lib, "d3dx9.lib") 
    static struct D3DTLVERTEX; 
    void GradientFunc(int x, int y, int w, int h, int r, int g, int b, int a); 
    void DrawCenterLine(float x, float y, int r, int g, int b, int a); 
    void DrawLine(float x, float y, float xx, float yy, int r, int g, int b, int a); 
    void DrawCursorLine(float x, float y, float xx, float yy, int r, int g, int b, int a); 
    void FillRGB(float x, float y, float w, float h, int r, int g, int b, int a); 
    void DrawBox(float x, float y, float width, float height, float px, int r, int g, int b, int a); 
    void DrawGUIBox(float x, float y, float w, float h, int r, int g, int b, int a, int rr, int gg, int bb, int aa); 
    void DrawHealthBar(float x, float y, float w, float h, int r, int g, int b); 
    void DrawHealthBarBack(float x, float y, float w, float h); 
    void DrawGroupBox(float x, float y, float w, float h, int r, int g, int b, int a, int rr, int gg, int bb, int aa, char* title); 
    int DrawString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont); 
    int DrawShadowString(char* String, int x, int y, int r, int g, int b, ID3DXFont* ifont); 
    void DrawCircle(int x, int y, float radius, int Sides, D3DCOLOR color); 
    D3DTLVERTEX CreateD3DTLVERTEX(float X, float Y, float Z, float RHW, D3DCOLOR color, float U, float V); 
    void DrawFilledCircle(int xPos, int yPos, int Radius, D3DCOLOR color); 
    void FillARGBTriangle(int x1, int y1, int x2, int y2, int x3, int y3, D3DCOLOR color, IDirect3DDevice9 *pDevice); 
    #endif 

そして、プロジェクト全体。 https://yadi.sk/d/uOPt8pdC3Jb78o

+0

'#pragma once' +' #ifndef HDRAWFUNC_H'/'#define HDRAWFUNC_H' /' #endif'は冗長です。 – Borgleader

+0

hslider.hのテキストTry2を見つけることができません –

+0

あなたはフォントですか?Try2はプロジェクトの名前です。フォントはDirectX.cppにあります。 – bJing

答えて

0

私は自分自身の答えを見つけました。 問題は円形の包含にありました。 これは、.cppファイルの代わりにヘッダファイルにクラスを定義したために発生しました。 これを実行してヘッダーを正しく移動した後、数分で修正しました。

モラル:決してC++ルールを破ることはありません。

0

問題はソースコードにありません。問題は、あなたが投稿したリンクのVisual Studioソリューションファイルが壊れていることです。ソリューションファイルにはTry2というプロジェクトへの参照がありますが、このプロジェクトはソリューションに存在しません。

これを修正するには、次の手順を実行します。

オープンHelp.slnライン

Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Try2", "Try2\Try2.vcxproj", "{BC659ABD-F853-4678-83AF-3D29339A7FC0}" 

がある++メモ帳でファイルを、そしてあなたが表示されますこれはTry2と呼ばれるサブプロジェクトがあるように意図されていることを意味し、それは存在しません。あなたのアーカイブでは、サブプロジェクトは実際には "ヘルプ"と呼ばれています。 、その後

Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Help", "Help\Help.vcxproj", "{BC659ABD-F853-4678-83AF-3D29339A7FC0}" 

ソリューション内のx64フォルダを移動して、Try2を参照してください残っているファイルを削除:だから、に行を変更します。

または、新しい空のソリューションを作成し、.cppファイルと.hソースファイル(一度に1つずつ)を新しいソリューションにコピーします。

は(もOffsets.hファイルが欠落している別の問題がありますが、私はそれを助けることはできません。)

関連する問題