Hey folks, this should be my last question of..well of the immidiate future anyway. I finished this nifty little game, and I'd like to email it to some friends as a .exe. Except I have no idea how to do it.
I've been trying to find as much information myself as I can, but I've had to ask alot of questions to this community anyway. And again now...I tried looking up how to do this, but I havn't really seen any adequite explanations. I read something about something about something called ClickOnce, but no real good explanation of what that is, how to use it, or if its even what I want.
Do I have to do something special to make it a release build?
If not I know exactly what you're talking about, the .exe in the Debug folder (Right?), except that opens a whole new can of worms because even with Duoas's magic tricks for doing a pause without using system();, it wont stay open.
[EDIT] Nevermind figured out that I have to swap the build setting from debug to release, except the .exe still doesn't stay open. Even with
1 2 3 4
int c;
printf( "Press ENTER to continue..." );
fflush( stdout );
do c = getchar(); while ((c != '\n') && (c != EOF));
And I pulled that right off an article in this website...[/EDIT]
If not I know exactly what you're talking about, the .exe in the Debug folder (Right?)
Well if you did a Release build, it would be in the Release folder. Debug builds are unoptimized and export a lot of symbols (ie: they're big and slow -- not ideal for distribution)
Re the 'closing right away' problem... welcome to console. It's supposed to close unless you open a command prompt.
getchar() has worked for me in the past.. no need to check the return, at least I never have to. But I don't generally compile console programs though -- and when I do it's just for quick tests and I don't run them outside of the debugger, so I might be wrong.
1 2
cout << "Press ENTER to continue..."; // or printf(), whatever
getchar(); // works for me
If that doesn't work I can't help you. I'll let someone more familiar with console nonsense step in.
Nope...Just tried it, and I've already tried every other approach I could find on this site. All of them technically work while executing from the IDE, but I don't need it there. And when running it as just a .exe, nothing but system("pause") works. But thats no good...
this one didn't even compile, I got oodles of errors (and yes, I #included <limits>) I remember one of them being about max not having enough parameters, but there were more than that.
save it as "run.bat", keep it with your exe. Run that instead of your exe.
EDIT:
this one didn't even compile, I got oodles of errors (and yes, I #included <limits>) I remember one of them being about max not having enough parameters, but there were more than that.
This is because <windows.h> #defines min and max.. effectively screwing the standard lib