User forums > Using Code::Blocks

Alright...DirectX again...

<< < (2/2)

All0i5hu5:
Ok folks....I solved it. It isn't that great of a solution, but I learned a ton along the way. I never had to mess with this stuff using MS Studio programs. Anyhow, for future posterity:

I had the October DirectX SDK, and used the sample browser to install SimpleSample example into my Projects directory.

I then imported the Visual Studio 2003 solution into Codeblocks using Project -> Import -> Visual Studo Solution. I then imported the 2003.sln

This brought in all of the necessary files from the simplesample project.

Now...for the setup of Codeblocks in order to make it work:
***************************************************************************
Settings -> Compiler
                     Microsoft Visual C++ Toolkit 2003 was selected as the default compiler.
                     Under Directories Tab -> Compiler Tab
                                                               C:\Program Files\Microsoft Platform SDK\include
                                                               C:\Program Files\Microsoft Platform SDK\crt
                                                               C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Include
                                                    -> Linker tab
                                                               C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Lib\x86
                                                               C:\Program Files\Microsoft Platform SDK\lib
                                                               C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib
                                                    -> Resource Compiler tab
                                                               C:\Program Files\Microsoft Platform SDK\include
                             Programs Tab -> Addtional Paths Tab
                                                               C:\Program Files\Microsoft Platform SDK\bin
                                                               C:\Program Files\Microsoft Platform SDK\include

Close the Settings Dialogs down. Now, right click on the Project, and go to Build Options:
You should see 3 Items under the project name:
       Debug
       Release
       Profile
Right click on each of these, and make sure you add these items (in addition to what already should be there) on the Linker Tab:
      user32.lib
      shell32.lib
      gdi32.lib
      advapi32.lib

(The rest of them should look something like this:  dxerr9, dxguid, d3dx9 (d3dx9d for debug), d3d9, winmm, and comctl32).

Those libs are found in the Platform SDK lib directory.

Make sure that under the Directories Tab -> Compiler Tab  You see Common (This reflects the common directory that is copied when you installed the project).

For your own projects, you should be able to get to the linker errors (not that you would want them) such as described as above:

IE: error LNK2019: unresolved external symbol __imp__SystemParametersInfoW@16 referenced in function "long __cdecl DXUTInit(bool,bool,bool,bool)" (?DXUTInit@@YAJ_N000@Z)

Go to http://msdn.microsoft.com/library/ and search for SystemParametersInfoW.

This will tell you which libraries you have to add to your Build Options.

Thanks for the tip, Vampyre.

The only thing that I might note is that I had, at that point, added those to my build options, but I added them using the Absolute paths to them rather than just typing in the name of the lib that I needed. I don't know if that made a difference. I went ahead and rebuilt the project using the import project function, whereas the first time I built the project using the Win32 App dialog from Codeblocks.

I hope this helps everyone, and was glad to be of service. I hope it is thorough enough, and if I come across anything else, I will add it.

PS: As noted by the directories above, the only downloads needed for this project was:
Codeblocks RC2
Microsoft Visual C++ Toolkit 2003
Microsoft Platform SDK
Microsoft DirectX 9.0 SDK (October 2005).
           

Vampyre_Dark:
No, I don't need to add the extensions.

I haven't compiled the sample projects, I don't use them. I just include the proper includes where needed, and then I link to the libraries in my build options (like this)



Never had any troubles.

Now please stay tuned for our regularly anti-dx rant.

Michael:
Hmm, I see.

I have had some problems when I did not add the extension .lib. C::B searched for .obj instead of .lib (http://forums.codeblocks.org/index.php/topic,696.0.html). So, personally, I prefer to add .lib, just for make it sure.

Best wishes,
Michael

Vampyre_Dark:
Well I don't know what else to say. Are you including the proper headers in all your source files?

The above screenshot is my exact linking setup for my ogl/dx game, and it works fine. DX always worked fine.

The only things I can think of are that maybe you are compiling with gcc by accident or your linkig directories are setup wrong in your actual build options. Are you not linking to all the proper libraries? Do you have DXGUID linked first?

Michael:
Hello,

I had such experience while compiling/linking the RakNet (a network API) using MS Toolkit 2003, after having imported the solution with the C::B functionality. May be this is just a problem related to the imported solution. I will give a try without .lib extension. Anyway, some days ago I have given a try with the DirectX samples (e.g., Text3D), but without success (and the same sample did not compile with Visual Studio C++ .Net 2003 :?). Still have some work to do. Thank you for your suggestions.

Best wishes,
Michael

Navigation

[0] Message Index

[*] Previous page

Go to full version