[SDL] problems creating a visual C++ project which links SDL
n.griffiths at virgin.net
Fri Oct 12 11:56:00 PDT 2001
Friday, October 12, 2001, 3:46:42 PM, you wrote:
E> I had a problem linking, when I used 'int main()'. Changing it to 'int
E> main(char **argv, int argc)', fixed the problem. So check that out. If
E> anyone could explain it to me please...I have no idea why this should
E> fix the problem, but it does.
You seem to be under the impression that your main function is the
first function called when linking with SDL... Not so. In actual fact,
SDL calls the main function for you - and so you need to declare it
properly - which from memory is "int main(int argc, char **argv)".
If you want to see how this works, use a debugger and continue tracing
after the end of your main() function. You'll end up in the SDL code
whereas it would normally end.
More information about the SDL