Sign in to follow this  

help:use sdl in vc++6

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

Quote:
Original post by song6295

when i chang 'int main()' to 'int main(int argc, char **argv)',that is ok


As the tutorial shows on page 2, but does not explain:

// Entry point
int main(int argc, char *argv[])

You MUST have that styled entry point for SDL to work properly, it's just the way it was made. That's why when you did not have the parameter list, it did not link properly, because internally SDL uses those parameters passed in.

Share this post


Link to post
Share on other sites
Quote:
Original post by song6295
the ouput is in a text file,why?


Take a look at this thread for solving that problem, but what's in the text file? If it's an error message, it might because you are using fprintf to output there. Instead you will need to use cout or printf to get the display to the console. That shouldn't be a problem because in VC6, the streams should be set correctly.

As for being able to use 'cin', just have a #include <iostream> then you can add a using namespace std; It depends on where you want to get input, but going with tutorial 2, before the // Main loop: loop forever. you can add in a cin >> i; or whatever you want to do before hand to get input. You just have to be careful since you have an infinite loop for the SDL program.

Share this post


Link to post
Share on other sites

This topic is 4391 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this