Jump to content
  • Advertisement
Sign in to follow this  
Plasmarobo

Little bit of error

This topic is 4593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I get an error that I just cannot find the source of: Direct.cpp:17: error: expected unqualified-id before "using" Direct.cpp:17: error: expected `,' or `;' before "using" Here are my files Hfile:
//Direct.h
//This file will have our interface to Direct X graphics.
//Chronicles 2 may use OGRE, but for now, Direct X must suffice.
//Austen Higgins-Cassidy
// 4/16/2006


//Include Direct X files
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <string>


#include <dplay8.h>
#include <dpaddr.h>
#include <dinput.h>

#include <stdio.h>

//Setup a graphic struct
IDirect3D9 *iDirectX;
//2-D graphics


//3-D graphics


//Setup Class

class eGraphics
{
     D3DPRESENT_PARAMETERS Present;
     D3DDISPLAYMODE Display; 
public:
       eGraphics();
       ~eGraphics();
       
       bool Init();
       bool LoadMesh(std::string fname);
       bool LoadGraphic(std::string fname);
       bool Render();
       bool Update();
       
};


and the cpp file
//Expantions for Direct.h

//include files
#include "Direct.h"
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <string>

#include <dplay8.h>
#include <dpaddr.h>
#include <dinput.h>

#include <stdio.h>


using namespace std;

eGraphics::eGraphics()
{
                 
}

eGraphics::~eGraphics()
{

}

bool eGraphics::Init()
{       
if((iDirectX = Direct3DCreate9(D3D_SDK_VERSION)) ==NULL)
return false;


Display.Width = 1200;
Display.Height = 800;
Display.RefreshRate = 0;
Display.Format = D3DFMT_A8R8G8B8;

if(FAILED(iDirectX->CheckDeviceType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Display.Format, Display.Format, false)))
return false;
}


Yeah...

Share this post


Link to post
Share on other sites
Advertisement
ha, thanx.
That is resolved, but now my linker decided to crap out:

here is the log:

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\projects\Chronicles\Media\Makefile.win"
Executing make clean
rm -f ../../../Templates/WinMain.o Direct.o "Chronicles Engine.exe"

g++.exe -c ../../../Templates/WinMain.cpp -o ../../../Templates/WinMain.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -I"C:/DX90SDK/Include" -ansi -fexpensive-optimizations

g++.exe -c Direct.cpp -o Direct.o -I"lib/gcc/mingw32/3.4.2/include" -I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include" -I"C:/DX90SDK/Include" -ansi -fexpensive-optimizations

g++.exe ../../../Templates/WinMain.o Direct.o -o "Chronicles Engine.exe" -L"lib" -L"C:/DX90SDK/Lib" -mwindows

Direct.o(.text+0x26):Direct.cpp: undefined reference to `Direct3DCreate9@4'
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

make.exe: *** ["Chronicles] Error 1

Execution terminated

Share this post


Link to post
Share on other sites
You're missing a semicolon at the end of your eGraphics class declaration.

edit - must have fallen asleep before clicking the submit button.


[Edited by - Dave Hunt on April 20, 2006 12:52:31 PM]

Share this post


Link to post
Share on other sites
Sorry missed taht you did it in the header. your class is missing a semi colon, that always leads to odd error messages. HOpe that solves your problem.

Cheers
Chris

Share this post


Link to post
Share on other sites
Nope, didn't work, sorry. :(

I have checked my lib and include directories, they both point to my directX SDK folders. What do those errors mean!?

Share this post


Link to post
Share on other sites
You need to add the dx9 libraries to your linker options. You've told the linker where to find them, but haven't told it which ones to look for.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!