Author Topic: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)  (Read 8313 times)

sauce

  • Guest
Hellooo... My first post here. I'm trying to do DirectX Programming and I have all the necessary DX headers and libs but I don't know how to make it link with those libs so I downloaded the Code::Blocks IDE and Microsoft Visual Studio Command Line tools as told by another forum member somewhere else and I was wondering how I get the Visual Studio thing to plugin to Code::Blocks. Sorry if i'm hard to understand but I'm just very rushed at the moment I only have a few minutes to type this. Any help would be greatly appreciated. :wink:

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #1 on: February 19, 2006, 04:09:51 pm »
Hello,

Which version of C::B are you using? RC2? If so, try the latest nightly build. Concerning DirectX programming, there are quite a few posts in the forum. The best would be that you perform a query with e.g., DirectX.

If you still have problems, remember to post C::B version and the errors you are getting.

Best wishes,
Michael

sauce

  • Guest
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #2 on: February 22, 2006, 07:14:23 am »
OK, I'm running Code::Blocks V1 RC2, Build Log:

Project   : Win32 Application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Hillam\My Documents\Bryce\Programming\TriangleApp\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: TriangleApp.cpp
TriangleApp.cpp:6:18: d3d8.h: No such file or directory
TriangleApp.cpp:7:22: d3dx8tex.h: No such file or directory
TriangleApp.cpp:22: error: expected constructor, destructor, or type conversion before '*' token
TriangleApp.cpp:22: error: expected `,' or `;' before '*' token
TriangleApp.cpp:23: error: expected constructor, destructor, or type conversion before '*' token
TriangleApp.cpp:23: error: expected `,' or `;' before '*' token
TriangleApp.cpp: In function `void CreateAppWindow(HINSTANCE__*)':
TriangleApp.cpp:114: warning: passing NULL used for non-pointer converting 1 of `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
TriangleApp.cpp: In function `HRESULT InitFullScreenDirect3D()':
TriangleApp.cpp:146: error: `g_pDirect3D' undeclared (first use this function)
TriangleApp.cpp:146: error: (Each undeclared identifier is reported only once for each function it appears in.)
TriangleApp.cpp:146: error: `D3D_SDK_VERSION' undeclared (first use this function)
TriangleApp.cpp:146: error: `Direct3DCreate8' undeclared (first use this function)
TriangleApp.cpp:149: error: `D3DADAPTER_DEFAULT' undeclared (first use this function)
TriangleApp.cpp:150: error: `D3DDEVTYPE_REF' undeclared (first use this function)
TriangleApp.cpp:150: error: `D3DFMT_X8R8G8B8' undeclared (first use this function)
TriangleApp.cpp:151: error: `D3D_OK' undeclared (first use this function)
TriangleApp.cpp:158: error: `D3DPRESENT_PARAMETERS' undeclared (first use this function)
TriangleApp.cpp:158: error: expected `;' before "D3DPresentParams"
TriangleApp.cpp:159: error: `D3DPresentParams' undeclared (first use this function)
TriangleApp.cpp:165: error: `D3DSWAPEFFECT_DISCARD' undeclared (first use this function)
TriangleApp.cpp:168: error: `D3DDEVTYPE_HAL' undeclared (first use this function)
TriangleApp.cpp:168: error: `D3DCREATE_SOFTWARE_VERTEXPROCESSING' undeclared (first use this function)
TriangleApp.cpp:169: error: `g_pDirect3DDevice' undeclared (first use this function)
TriangleApp.cpp: In function `void CleanUpDirect3D()':
TriangleApp.cpp:179: error: `g_pDirect3DDevice' undeclared (first use this function)
TriangleApp.cpp:181: error: `g_pDirect3D' undeclared (first use this function)
TriangleApp.cpp: In function `void Render()':
TriangleApp.cpp:192: error: `D3DCOLOR_XRGB' undeclared (first use this function)
TriangleApp.cpp:197: error: `IDirect3DVertexBuffer8' undeclared (first use this function)
TriangleApp.cpp:197: error: `pVertexBuf' undeclared (first use this function)
TriangleApp.cpp:198: error: `g_pDirect3DDevice' undeclared (first use this function)
TriangleApp.cpp:199: error: `D3DFVF_XYZRHW' undeclared (first use this function)
TriangleApp.cpp:199: error: `D3DFVF_DIFFUSE' undeclared (first use this function)
TriangleApp.cpp:200: error: `D3DPOOL_DEFAULT' undeclared (first use this function)
TriangleApp.cpp:216: error: `D3DCLEAR_TARGET' undeclared (first use this function)
TriangleApp.cpp:223: error: `D3DPT_TRIANGLELIST' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 2 seconds)

It seems there are alot of problems with the header files I am using, but the book that the program came with also came with all the Direct X Stuff so thry can't be wrong. I'm pretty sure its in the linking libraries, the book says I need to link it using those .libs but I have no idea how, he only gives instructions as to how to do it using Microsoft VC++, and that is why I need to know how to get that plugin working, unless of course it's possible for someone to help me do that using Code::Blocks.

EDIT: Does Code::Blocks have trouble with filesnames that have spaces in them? I'm aware that most other compilers do, but I thought Code::Blocks was fine with it. Correct me if im wrong.
 
« Last Edit: February 22, 2006, 07:16:35 am by sauce »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #3 on: February 22, 2006, 08:13:15 am »
TriangleApp.cpp:6:18: d3d8.h: No such file or directory
TriangleApp.cpp:7:22: d3dx8tex.h: No such file or directory
The first two lines show that you don't have set the include path to the Direct/X components correctly (alllthough you might have installed the Direct/X SDK correctly). Make sure you add the Direct/X include path to the build options (compiler). Furthermore add the Direct/X library path to the build options (linker). When you've done so you shouldn't see the frst two lines. If there are still errors, post the new log again.
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #4 on: February 22, 2006, 12:28:09 pm »
I've provided a template for a Direct/X application to BerliOS as patch no. 853. You might want to use this.
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

sauce

  • Guest
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #5 on: February 22, 2006, 01:17:10 pm »
What's BerliOS?!? Why would I want to use it?!? I would try the method you suggested (telling it to include those damned linking libraries) except the computer I use for programming isn't connected to the internet, and The computer that is connected to the net doesn't have the DirectX SDK installed. I'm currently installing it now so it shouldn't be too long, but I'm gonna call it a night and get some rest.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #6 on: February 22, 2006, 01:28:48 pm »
What's BerliOS?!?
Sorry, I didn't make myself very clear. BerliOS is the platform for coodination the development of C::B. There you can find and submit patches and AddOns to C::B. The C::B project can be found here: http://developer.berlios.de/projects/codeblocks/.

However... If you have a look at http://forums.codeblocks.org/index.php?topic=2436.0 you'll find template files that you can copy to the C:B installation directory under {CB-Directory}\share\CodeBlocks\templates. This will add a project template for a Direct/X application that "automatically" will setup the path's correctly. You will need a nightly build (see here: http://forums.codeblocks.org/index.php?board=20.0) to use this template.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

sauce

  • Guest
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #7 on: February 22, 2006, 02:09:12 pm »
OK, that sounds good then, I might try that. Another quick question. Whenever I start up Code::Blocks I get this error message:


Code::Blocks v1.0 Error

Execution of 'svn.exe' failed (error 2: the system cannot find the file specified.)


I get this error only on one of the two computers that has Code::Blocks installed. How can I fix it?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #8 on: February 22, 2006, 02:26:46 pm »
Code::Blocks v1.0 Error
That's a known bug in C::B RC2. See the "Bug alert box" in http://www.codeblocks.org/downloads.shtml for details. You basically have to remove the svn plugin which was buggy at that time. However: I strongly suggest you try one of the nightlys. They are sooooooooo much better... :wink:
Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

sauce

  • Guest
Re: Direct X Programming and the Code::Blocks IDE (With Visual Studio Plugin)
« Reply #9 on: February 23, 2006, 08:13:43 am »
OK, I downloaded the nightly build and its working, i downloaded your DX templates, I'll have to reset to get DXSDK working and then I can tell it where all the relative paths are.