Problems building wxSpokePov on OSX-10.6

SpokePOV kit for bikes

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
alendria
 
Posts: 8
Joined: Mon Aug 17, 2009 5:56 pm

Problems building wxSpokePov on OSX-10.6

Post by alendria »

I am running into trouble because wxWidgets is based off carbon, not cocoa and the compiler natively wants to build 64-bit which carbon doesn't do. So one must use the -arch i386 switch.

Of course then when I build wxSpokePov it fails because it can't link the i386 formatted libs. So I make it with the correct architecture and predictably, libusb is no longer compatible. Trying to force libusb to i386 doesn't work because it relies on some other library that is already built and shipped with the source.

Any ideas? Optionally, anyone got a command-line interface? I don't really need a GUI.

alendria
 
Posts: 8
Joined: Mon Aug 17, 2009 5:56 pm

Re: Problems building wxSpokePov on OSX-10.6

Post by alendria »

I finally got it to compile. Here's the trick for anyone else who is having a similar issue.


First, you'll need wxMac 2.8.2 found here: http://www.wxwidgets.org/downloads/
Then you need to follow their compile instructions for 10.6: http://wiki.wxwidgets.org/Development:_ ... ow_Leopard

Next you'll need libusb 0.1.* and it must also be compiled with the arch i386 flags. I couldn't get it to compile properly but I did find a compiled binary and sdk over here: http://www.ellert.se/twain-sane/ This is what solved my issue.

Finally, of course, you need to set the same arch i386 flags in wxsoft/macosx/makefile

Probably you'll also want to change the /opt/lib to /usr/local/lib I also removed -Werror because I'm lazy and didn't feel like resolving typecasting issues.

In a few of the c++ files, you'll have to resolve some issues with includes and class prototyping but that's all pretty straight forward. There's also some windows-specific code that you might want to put a #ifdef WINDOWS around.

but yay! Compiles! Ship it! ^_^

alendria
 
Posts: 8
Joined: Mon Aug 17, 2009 5:56 pm

Re: Problems building wxSpokePov on OSX-10.6

Post by alendria »

My previous attempt was not the correct way to do this.

The right way is to use macports and get wxWidgets, libusb and libusb-compat.

My previous attempt used the legacy libusb (which can be superceded with libusb-compat)

Code now compiles on 10.6 AND can connect to the spokepov and read/write to/from it.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems building wxSpokePov on OSX-10.6

Post by adafruit »

whew, we havent had a spare moment to work on this sorry :( did you get it working with your kits?

alendria
 
Posts: 8
Joined: Mon Aug 17, 2009 5:56 pm

Re: Problems building wxSpokePov on OSX-10.6

Post by alendria »

adafruit wrote:whew, we havent had a spare moment to work on this sorry :( did you get it working with your kits?
I did. Everything is now working correctly and I can read/write/verify my kits.

It seems like the real issue was to use macports and get libusb and libusb-compat instead of the deprecated libusb package and to force it into 32-bit mode with the -arch i386 flag.

Attached is a tgz of the code from the wxsoft directory and the macos subdirectory (sans sample bitmaps and whatnot)

It resolves prototyping issues but also has some of the Windows-specific code disabled. In the makefile I also turned off the image format libraries and expat because I didn't need them and it resolved some of my build issues.

I also updated the makefile for wxWidgets 2.8. Using Macports made things a lot easier.

Happy to help if you need a hand.

-Samantha
Attachments
wxSpokePov-OSX-10.6.tar.gz
tar of files inside the wxsoft directory
(41.39 KiB) Downloaded 284 times

Locked
Please be positive and constructive with your questions and comments.

Return to “SpokePOV (discontinued)”