[SDL] cant compile SDL project in VC 5

Fredrik Persson perrascout at liux.nu
Mon Jul 22 05:06:01 PDT 2002


While playing with libsdl 1.2.4 on MacOS X, I found a bug in libsdl's
joystick handling. The following code is a test case.

	#include "SDL.h"
	#include <stdio.h>
	#include <stdlib.h>

	int main (int argc, char *argv[]) {
		int err;
		int num_joy;
		int i;
		SDL_Joystick *j;

		err = SDL_Init(SDL_INIT_JOYSTICK);

		if (err == -1) {
			printf("Could not initialise SDL: %s\n",
					SDL_GetError());

			exit(1);
		}

		num_joy=SDL_NumJoysticks();

		printf("%d joysticks found\n", num_joy);


		SDL_Quit();
	}

Under Linux with no joysticks connected, this program outputs:

	0 joysticks found

Under OS X with no joysticks connected, this program outputs:

	Could not initialise SDL: Joystick: Couldn't create a HID
	object iterator.

-- 
 ___________ ____________________________
| Screwtape | Reply-To: munged on Usenet |________ ______ ____ __ _  _   _
|
| "Strange, Enya-like New Age music poured from a cactus." -- Jon Katz
|




More information about the SDL mailing list