Archived

This topic is now archived and is closed to further replies.

Got Win32 Now need DirectX to work. (updated title)

This topic is 5018 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

Lol, here I am attempting to learn the languages (or atleast part, (must beat out my friend's java pong)) and I can't seem to get Win32 programs to compile, (nor do I know how to properly install the DirectX SDK ) could someone enlighten me on these? I see throu the directories that it has some things and Win32 in an option box so I had thought it was ready, but it keeps giving me a unresolved link error about wanting a regular main function. Since non of the tutorials I got has a main function I am thinking its something on my part (you can compile and build/run off of the Visual Studio for both right?). Any help appreciated! Allow me to drive a friend of mine face first into his own smugness! [edited by - RyoxSinfar on March 19, 2004 11:37:58 AM]

Share this post


Link to post
Share on other sites
When you create a new project, if you create a console application, it will expect a main() function. However, if you create a new Windows application, it will look for a WinMain() function. So you probably need to simply create a new project, and make sure it is a Windows Application, not a Windows Console Application.


int Agony() { return *((int*)0); }    Mwahaha... >8)

Share this post


Link to post
Share on other sites
its .cpp if thats what ya mean? Its not executable (the exe that came with does work thou)

(just tried puting in a main, yeah it just gave me press any key to continue (notta happened)

[edited by - RyoxSinfar on March 18, 2004 11:49:08 AM]

Share this post


Link to post
Share on other sites
Well if you''re trying to compile and link a Win32 program then you need the main function (unless of course you''re making a library, which I''m guessing you''re not).

Maybe you should try out the tutorials at DrunkenHyena which uses DirectX.

Under all circumstances do you need a main function (or WinMain depending on project).



Human beings, by changing the inner attitudes of their minds, can change the outer aspects of their lives.

William James (1842 - 1910)

Share this post


Link to post
Share on other sites
It has the WinMain (replacement main as I said), but it wants main?

tried making it exe and it didn't work I am using 6.0...

[edited by - RyoxSinfar on March 18, 2004 11:50:48 AM]

Share this post


Link to post
Share on other sites
If it has WinMain you should compile it as a Win32 application NOT a console application.



Human beings, by changing the inner attitudes of their minds, can change the outer aspects of their lives.

William James (1842 - 1910)

[edited by - rohde on March 18, 2004 11:53:08 AM]

Share this post


Link to post
Share on other sites
If you have WinMain() then in VS when you create a new project, you need to select the project type that says "Win32 Application". If you are using main(), select the type that says "Win32 Console Application".

Tadd
- WarbleWare

Share this post


Link to post
Share on other sites
Okay I did that then opened the basic window tutorial I had but it would not run. I also tried opening the .exe file but it gave me the source and no option to compile or build, only run.

Quick walkthrou on how to open the tut then compile and run it maybe? (gone for a few hours

[edited by - RyoxSinfar on March 18, 2004 12:05:41 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by RyoxSinfar
can someone please jsut say, open this with this, change this and cmpile with THIS or something (what was your search string?)


May I ask if you''re expecting to learn anything? Just getting people to tell you what to do won''t get you far!

Share this post


Link to post
Share on other sites
*cries* all I wanna know is how to properly compile a win32 program! I;ve tried everythign here sofar and notta. I already am learning the other parts but when I try and build it I get a main unresolved link error. All I wanna no is how to get it to run.

Share this post


Link to post
Share on other sites
if your using visual c++ 6 do the following

file >> new
on the projects tab click on win32 application
do NOT click on win32 console application
enter your project name and click ok

Share this post


Link to post
Share on other sites
Obviously, if you don''t know what you are talking about, you shouldn''t be doing this things.

First of all, do you actaully know C/C++ already? I don''t think you do, sicne you can''t even get a normal program to compile. If you don''t know how to write a normal program or to compile it, why bother with Win32 and DirectX?

Get a C++ book first, learn it and then come back and read the Win32/DirectX tutorials.

kthxbye
Toolmaker



-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites
Well I am having a bad day so sorry in advance for being spitefull. But here goes. (anyone wishing to not go throu the arguement parts can go to the next two paragraphs and skip the others, those that do thanks for your help )

Well I must ask you, in response, do you know how to read? Cause if you don''t I suggest Dr. Seuss which has good tutorials for that. As I said I DO know C++ and have worked as far as threading my programs, and recently finished a program that plays Texas Hold''em using a screen buffer. the PROBLEM I am facing is that when I opened a PREMADE Win32 program and attempted to compile and run it, it gave me a link error wondering where the main method was. As I have looked in multiple places for an explanation, I came here asking in what way you compile and run a Win32 program. I tried opening a new project and doing it THAT way (no yelling intended at those not spitefull toward me) but when I opened the preexisting .cpp file into the new Win32 Application project (I am using WinMain) but it still gave me a link error. What I would like right now is for someone to tell me how to OPEN A .CPP program (not a project) that was previously made with Win32 before I downloaded it (I learn by experiments and if I can fool around I can''t learn as much).

What I would ALSO like to know is (not where to LEARN directX) but how to get the DirectX 9.0b SDK that I installed to work with my Visual Studio. So basicly the same thing that I was asking about for Win32 but with alittle more. Yes I have learned some stuff for both, but no none of the tutorials I found ever decide to explain how to compile and RUN a program after its made.

And I seriously do not appreciate the way you accused me of not knowing my stuff. As I am never TAUGHT I must almost always teach myself. I have already gone way past what my current class will teach me and I end of learning HOW to code by getting code and teaching myself what everything does. The book I bought on C++ is 90% unread to me because I look at the program and what it did and then puzzle out the components. And last time I PERSONALY checked books on C++ and classes on C++ in my highschool do not teach you how to work with the Visual Studio program more than what is required for BASIC projects, So believe it or not this is my first time working on an extension of a programing language and have never encountered problems like this. So my question is how insecure are you that you must prey on someone going in blind to a problem that no one in my school can help me with, and do your thoughts ever go deeper then a toothpick could go? As it seems you did not even try to look from my view. You don''t get right awnsers by saying I''m right bud, you get it by taking a point then defending it against your own mind argueing against it.

I say this not because this gives me satisfaction, well it does, but to cut off the fact that the first thing you think is that I am being hypocritical (if you can think that deep), I say this because your attitude was cocky and full of self satisfaction with no real intent on helping me. While I do envy the fact that you rely this much on others for your self esteem (as I find my lack of, does not promote my work habits), your personality (i must say) is the one that really ticks me off.

kthxthink
-Ryox

The malicious comments were intended to mr. Tool here only.

And let me just say (as this has been done often before) if the attempt you make at making yourself feel better (as I know it will soon follow) involves in any way putting down my grammar or spelling capabilities. It will only prove my point. I would say just end it now, but that will provoke response. So I will just say now "I am too smart for you and know you will post" in hopes that you don''t.

If anyone feels I was too harsh sorry. I deal with his kind every day, and those taht would harrass me have the same personality. yes the internet is nice as I can strike down imaginary foes as I picture the heads of my true enemies on thier shoulders.

Share this post


Link to post
Share on other sites
OKAY Thank you those that help and persistantly told me to do the project thing. After fooling around with the project I made I figured out how to get it to work. Thank you VERY much to those who helped.

And a prethanks to those who would help me now on getting my SDK to work for DirectX?

Share this post


Link to post
Share on other sites
quote:
Original post by RyoxSinfar
And a prethanks to those who would help me now on getting my SDK to work for DirectX?

Are you getting error messages about DX not working? Post them and we can tell you the fix. How exactly do you mean it''s not working? In general after you get the Win32 project setup right, you''ll have to add some libraries for DX to work and some paths so the include files will be found. When you compile the project, the error messages will tell if something is missing and we can look at them and say how to fix it. I gotta go now - will check back later.

Tadd
- WarbleWare

Share this post


Link to post
Share on other sites
Obviously, if you can''t get a normal app to compile, I would consult the documentation that came with the compiler. Duh!

Secondly, I did point you to 10 articles on DirectX.

Third, where to get the sdk? They invented google for that. The funny think is, that when you go to http://www.google.nl/search?q=directx+sdk&ie=UTF-8&oe=UTF-8&hl=nl&btnG=Google+zoeken&lr=
the first link you find will be.....

The DirectX SDK. H00ray! Or get it here http://msdn.microsoft.com/directx/

Well, you should RTFM when you got such problems, and you can''t compile a CPP into a win32 application without a project since the compiler can''t smell what you want it to do.

Toolmaker



-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites
I just found this old file I wrote up for my brother. This is probably what you need. In particular the link points to the first DX tutorial on AndyPike where he goes over "creating your first project". Hope it helps:
--------------------------------------------------------
Here are my notes on setting up your project to use the DirectX SDK.

In Project->Settings, change "Settings for" to "All Configurations" (not just "Win32 Debug") when making changes. Note, it always changes back to "Win32 Debug" after exiting.

Below worked for me originally, but the AndyPike way is probably better. So I changed to do like he says here:
AnyPike #1
Follow those instructions, but use "d3d9.lib" instead of "d3d8.lib".

------------------------------------------------------------------------
(my old original way)
Project->Settings->Link->General->Object/library modules:
must include d3d9.lib file
Project->Settings->Link->Input->Additional library path:
must include path to DX library files (Lib\)
Project->Settings->C/C++->Preprocessor->Additional include directories:
must include path to DX include files (Include\)

------------------------------------
Also, from DX 9.0 SDK install readme:
- Be sure to set the paths to the DirectX 9.0 lib and headers within Visual Studio. They must be listed first. Otherwise you may experience compiler errors.

Tadd
- WarbleWare

Share this post


Link to post
Share on other sites
Thank you reanna thats just what I needed, I am guessing its a WIn32 project?

Now for mr. tool.

well we seem to be lashing out an awefull lot. We enjoy yelling at me for things I did not do yes? Well first off, where to find the SDK? Thanks for the tip, woulda been great if I hadn''t had the SDK for almost a month now, and no one really told me how to get it to work with the program. Had I not talked to reana here (thanks again) I would of gotten completely wrong.

On the oh your so smart part of obviously the .cpp won''t compile... Other than me looking at premade programs, I have a basic class I am taking. And they arn''t even going to do screenbuffer stuff. They don''t even mention project stuff. So again as I aready mentioned, remember the Dr. Seuss tutorials, I have no real experience working with visual studio''s interface (so deep we go backwards, yes?).

And thanks again for the tutorials, which I don''t need, and repeatedly said so too. I did not need to know how to program in anything, I DID need to know how to get it to compile and run.

Well I don''t feel like doing more, so you may say what you wish, I don''t raelly care.

Well, night all

Thanks again reana, really helped me out here.

Share this post


Link to post
Share on other sites
quote:
Original post by RyoxSinfar
Thank you reana thats just what I needed, I am guessing its a Win32 project?

Yes, that will work for a Win32 Application project on VS 6.0. Once you've done it a few times, you'll get used to it. The AndyPike way is really better than what I had directly listed below (EDIT - I mean above). His way will make the directory settings always be there for all new projects you make. Then after the first time, the only setting you'll have to always change will be to add whatever "Object/library modules" you need.

Tadd
- WarbleWare

[edited by - reana1 on March 19, 2004 9:45:58 PM]

Share this post


Link to post
Share on other sites