1 Attachment(s)
Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
So recently I re-formatted my computer. This is due to the fact that everytime i turned on my computer... it'd go straight to the BSOD (Blue Screen of Death).
So i went and downloaded Visual C++ 2005 Express Edition. I would install the Visual Studio 2005 but as my dad and i arent on speaking terms right now.... i cant exactly do that.
After installing V++ 2005 Ex Ed. I went and tried to create a Win32 Project....Its then i relized i didnt have a Win32 Application Project Option...
I searched around for a solution to this, because before my re-format, i could and was creating Win32 Applications... and found out what to do, at this site, http://msdn.microsoft.com/vstudio/ex...alc/usingpsdk/.
Funny thing is... i remember creating Win32 Windows Applications.Before even installing the PlatForm SDK....
I installed (Microsoft ® Windows Server® 2003 R2 Platform SDK Web Install)
So After i did all that tweaking, I decided to try out a tutorial from a couple of sites. http://www.functionx.com/win32/ And http://gameprogrammer.org/main.php?p...&subject=win32 /
http://gameprogrammer.org/main.php?p...bject=direct3d
But sadly... They didnt work. Which is funny, Because again prior to the re-format.I could build the project from those sites.As they were my main source of learning Win32 Application coding.
This is the site and project name of the first project i tried.Aswell as the errors.
Site:http://gameprogrammer.org/
Tutorial Link:http://gameprogrammer.org/main.php?page=tutorials&no=11
Project:Beginning Win32 SDK Programming
Type of Project your building: Mesage Box.
Error Messages:
VB Code:
Compiling...
main.cpp
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(12) : error C2664: 'GetDlgItemTextW' : cannot convert parameter 3 from 'char [256]' to 'LPWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(13) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [256]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(34) : error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(45) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [4]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(51) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(57) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\***\main.cpp(63) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Then i decided to try out DirectX too see if it'd work. So i downloaded and installed DirectXSDK (August 2006) and proceeded to create a project thru win32.
So I Selected Win32 Console App. checked empty project and selected Windows Application.
I linked my lib's : d3dxof.lib dxguid.lib d3dx9d.lib d3d9.lib winmm.lib
I also Tried: d3dxof.lib dxguid.lib d3dx9d.lib d3d9.lib winmm.lib
Site:http://gameprogrammer.org/
http://gameprogrammer.org/main.php?page=tutorials&no=8[/url]
Project:Beginning Direct3D
Type of Project your building: Basic DirectX Enabled Window.
And because its a DX8 Project i changed things DX9.Which last time i did... worked....
Error Message(s):
VB Code:
Compiling...
winmain.cpp
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\dx9test\winmain.cpp(30) : error C2440: '=' : cannot convert from 'const char [6]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\dx9test\winmain.cpp(41) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [6]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Now here's the real Kicker.... The Default Win32 Windows Application that the IDE creates as a default works perfectly... and so does the DirectX Examples from the Sample App that comes with the SDK.
Then i went and copied the source code from a book i had on DirectX
(Programming Role Playing Games with DirectX Second Edition - Jim Adams)
Which has all examples created in VC++ 6. But i has always been able to compile them before after i "re-built" them in VC++ 2005 Ex Ed IDE.
And i when i went to compile I got all these errors:
VB Code:
Compiling...
WinMain.cpp
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\alpha\winmain.cpp(68) : error C2440: '=' : cannot convert from 'char [11]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\alpha\winmain.cpp(78) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char [11]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\alpha\winmain.cpp(102) : error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'char [11]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\alpha\winmain.cpp(104) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
c:\documents and settings\hp_owner\my documents\visual studio 2005\projects\alpha\winmain.cpp(117) : warning C4244: 'return' : conversion from 'LRESULT' to 'long', possible loss of data
Could someone please help me fix this problem... Would this all be fixed if i installed VS2005?
Am i simply not including something? Did i not install the correct things?
I just find it funny that The DirectX Eamples that Come With the DirectX SDK......... work on compiling by my hands.Unlike before where they'de give me errors. And yet the books code that used to work... doesnt....
Attached is the "books example".Untouched.
Also you may note that i DO NOT WANT to create Managed DirectX app's.
I just find it "f***ed up" that i cant do what i used to do before the re-format.
--------------------Edit------------------
I'll update with new progress.
I found my Book mentioned above and have started to read it to see if i need to do anything else.
---
My Biggest concern is whether or not i should/may-have-to do another re-format.And then Re-Install the PlatformSDK/DXSDK.
Its not a big deal to me tho.I would do a system restore... but idk how nor have i ever done one.
Now i say "re-format"/"system restore" instead of "uninstalling" the SDK's...
because again....idk how and i keep remembering that you "cant".For some odd reason...
----
Converting the projects seem to work.....for the bookCode
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
I would think it would be a compiler setting of some sort, since its throwing out errors like that. Either that or your includes are corrupted.
chem
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
Check that you are linking to the same files in the project that is working and the project that you can't compile. Maybe you are linking to the managed libraries.
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
on second Note(Me), I had a similar problem (read about it in the last NoteMe post in the C++ section. And then it was a PlatformSDK error). But then it should have said something about Windows.h in the output. It doesn't even seem to find it on your computer. Try:
Quote:
1. Create a directory "PlatformSDK" under "%ProgramFiles%\Microsoft Visual Studio 8\VC"
2. Copy the "bin", "include" and "lib" directory from the PSDK-installation into this directory.
Then you do not need to change any config file.
If that doesn't help. Then googling is my best guess. There is a million errors with VC++ Express and the platform SDK. I guess the reason is:
Quote:
"A decision was made long ago by the team that Visual C++ Express (a free product) cannot be used for native Windows development out of the box. It can only be used for .NET/CLR development. "
- ØØ -
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
I've re-installed the PlatformSDK twice. Second time was after i re-downloaded it.
Quote:
1. Create a directory "PlatformSDK" under "%ProgramFiles%\Microsoft Visual Studio 8\VC"
2. Copy the "bin", "include" and "lib" directory from the PSDK-installation into this directory.
I'll give this a try.
Quote:
"A decision was made long ago by the team that Visual C++ Express (a free product) cannot be used for native Windows development out of the box. It can only be used for .NET/CLR development. "
So that'd mean that i would have to find some way of getting VS?
---
Some DirectX Projects "from the book" work after i "convert" them to the compilers current visual c++ project format. Others dont... but i suspect that thats only because its using DirectX9 from back in 2004. So i guess in order for them to compile... i'll need to study the DX samples/tutorials that come with the sdk...
Also on a side note... You wouldnt happen to have/know of a book that can teach a complete beginner that came out within (2005 — present)... because thats what i am still... a beginner. Everytime i find something that looks good.... Always seems to have flaws that hinder my learning experience...
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
What are you really trying to learn here? C++ doesn't change the way VB and .NET does. There is more or less no change to it (unless you drag the new CLI/.NET version into it, but that is just as much C++ as VB6 is to VB.NET. Doesn't have much to do with each other except the syntax. VS2005 is just a new IDE for C++. The language stays more or less unchanged.
- ØØ -
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
Quote:
Doesn't have much to do with each other except the syntax. VS2005 is just a new IDE for C++. The language stays more or less unchanged.
I know that the language stays more or less unchanged.And i also know that VS2005 is just a new IDE for C++.
Im just saying that its wierd that something that worked "before" my reformat. Doesnt work anymore...Even after installing the "same" stuff.
Quote:
What are you really trying to learn here?
This is a strange question to be asking, especially after stating a few facts that im a "beginner" in C++ DX, and that i'm also posting on this forum/site for help.So that i can "learn".
Everytime i have had some time to learn about programming in C++/DX, in the past ten years(Im 20 years old btw) that i've had a liking to learn about C++, and the interest in making games, something always goes wrong.But Im not here to complain about the past. Im here to figure out why certain tutorials dont work....right after i had re-installed everything....
I guess i'll just wait and see. Though Like stated in my last post. I'd like to hear your thoughts on any books that you might recommend to me on learning DirectX9.
Cuz the book i have now... has problems after chapter 6. Probably reguarding the DX syntax....or so i think, hope. Book made in 2004.
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
DX changes a lot all the time. The biggest problem with old books on DX is that they use the DX Common Framework that now change nearly every second month. No book can keep up with that. If I was new these days I am not sure if I would have used a book to learn about the basics at all, but rather used the samples in the SDK to learn the basics like vectors, matrices, translations, lightning, textures, materials, and maybe loading a mesh. Then bought a book before that.
But you don't really seem to have a problem with DX right now. It is a long way to go with C++ before you should start learning DX or any graphics at all. C++ doesn't have any graphics API call, but there is still tons to know about it. Do you really feel that you are mastering the ins and outs of C++ already, like object orientation, inheritance, polymorfism, function pointers, call backs, and so on and so on. If you don't then DX will be really hard to comprehend.
- ØØ -
Re: Is this weird? Too me it is...Cant Compile Win32/DX prj(s)
Im a quick learner... as long as i have the resources(or can find the "good" resources) to do so.
I know some C++... but not enough to do anything fantastic. Since everytime i got "going" and started to really learn. I had obstacles.Obstacles that just wouldnt let me have much "fun".Although thats about to change.Since I now have time on my hands at which to learn it more indepthly.
And i dont think it hurts that i know PHP, which although doesnt have the exact same syntax, gives me some understanding into the language.No matter how small that understanding may be.