Building/Downloading for Mac OSX

Hello,

I downloaded the nightly build for JInput, but it doesn’t have a MacOS X native executable library. It lists linux and DirectX in the plugins directory, but there aren’t plugins fro those systems either.

I tried compiling from the source (all of the nightly-build downloads, including source, are dated back in 2005 on the website: https://games-binaries.dev.java.net/build/index.html ), but that returned the same error that was shown here: http://www.java-gaming.org/forums/index.php?topic=8653.0 even though it’s almost 2 years later.

Have I completely missed something obvious here?

– Scott

Okay, here’s something better:

I got a login to the .dev.java.net website so I downloaded all of the project directories and run ‘ant’ to build them. Jutils built fine; Jinput bombed out pretty early until I copied ‘jutils.jar’ into my system classpath, but that’s fine. Now it bombs out much later into the dynamic lib compilation with the following error message:

compile:
    [apply] gcc-3.3: installation problem, cannot exec `cc1': No such file or directory

BUILD FAILED
/Users/scott/java/games-core/jinput/build.xml:87: The following error occurred while executing this line:
/Users/scott/java/games-core/jinput/build.xml:63: The following error occurred while executing this line:
/Users/scott/java/games-core/jinput/plugins/OSX/build.xml:75: The following error occurred while executing this line:
/Users/scott/java/games-core/jinput/plugins/OSX/src/native/build.xml:54: The following error occurred while executing this line:
/Users/scott/java/games-core/jinput/plugins/OSX/src/native/build.xml:19: apply returned: 1

I’ve posted the whole output here, in case anyone’s interested: http://pastebin.com/888376

I can see clearly the error, though I have little idea what would cause that. I can’t even ind any file which mentions ‘cc1’ at all… -.-;; If someone could get me started in the right direction I would greatly appreciate it.

– Scott

Hi

You can find the latests distributables here. The last one was build in October last year, but not a huge amount has changed since then.

The OSX build process is not something I can test as I have no Mac, so i’ll leave that for someone else to help you with. I’m guessing Elias will be checking the forums at some point :).

Endolf

It seems like your gcc 3.3 install is somehow broken. What version of XCode do you have? Do you have gcc-3.3 installed at all (not gcc-4)? Can you compile a simple hello world example with gcc-3.3?

  • elias

endolf:

I tried the file you linked to, and it worked okay, though it ran into a problem while running…

ce = ControllerEnvironment.getDefaultEnvironment();
controllers = ce.getControllers();

The above code responded with this:
Failed to enumerate device: Device open failed: -536870203
So I’m not sure what to do about that from here.

elias:

You’re right, I tried a simple program and it returned “gcc-3.3: installation problem, cannot exec cc1’: No such file or directory`”. I’m running all o fthis on my Intel Mac, which as I recall doesn’t COME with gcc-3.3, or something like that. Do you know of a way to get it? Or perhaps is there something else wrong entirely?

Thank you both so much for your quick responses!
– Scott

I only have ppc macs handy and using the gcc3 installer package from XCode worked here. You should check if it works on intel macs too.

  • elias

And I’ve tweaked jinput to not let one device open failure to stop enumerating altogether. Fetch the new binaries here:

http://download.oddlabs.com/elias/jinput-25022007.zip

  • elias

Thanks, that works for me now! :slight_smile:

As for gcc, I’m not really sure how that all changed, or why Apple mandates gcc4 for intel macs, but I’m reluctant to go messing about with it since the version you provided works just fine and I honestly don’t know enough to feel comfortable changing things around like that.

[s]Out of curiosity, when I iterate through the controllers and output their .getName() value, I see the mice (a mouse and stylus) and the controller, but then I see three more: “Controller Type: Mouse”, then “Keyboard”, then “Controller”… So that looks like JInput found SIX devices (seven, if you count the one it couldn’t open), but I only have four. Is this expected?

(Sorry for redirecting the thread topic…)[/s]

Nevermind all that. I checked my code and it turns out that I was already calling something to list the controller type when I added the code to list the other information beforehand. >.< My bad.

– Scott

I’m glad it works for you now. You won’t need gcc 3 now, but just in case others see this thread: On (at least PowerPC) macs, gcc 3 and gcc 4 can live happily side by side and won’t step on each others toes. And gcc 4 has been the standard compiler since (I think) Mac OS X 10.4 on both ppc and intel. Jinput (and my other project, LWJGL) use gcc 3 only to build the ppc part of the universal library to make it compatible all the way down to Mac OS X 10.2. The intel part is compiled with gcc 4, since all intel macs have at least Mac OS X 10.4.

  • elias