Compiling Linux Source in MinGW?

Supporting 2.6 and up
MooseHole

Compiling Linux Source in MinGW?

Postby MooseHole » Wed Apr 08, 2009 5:55 pm

I know a lot of people have asked about using MinGW with Phidgets, and I want to do the same thing.

Apparently, the microsoft visual c++ does some name manging to the .lib which MinGW's gcc linker is unable to deal with. So I tried compiling the Phidgets Linux Source in MinGW, with no luck.

Code: Select all

$ make
gcc  -Wall -Os -I/usr/java/j2sdk1.4.2_18/include -I/usr/java/j2sdk1.4.2_18/include/linux -I. -Iutils   -c -o libusb/usb.o libusb/usb.c
In file included from libusb/usbi.h:4,
                 from libusb/usb.c:14:
libusb/usb.h:67: parse error before "u_int8_t"
libusb/usb.h:67: warning: no semicolon at end of struct or union
libusb/usb.h:68: warning: type defaults to `int' in declaration of `bDescriptorType'
libusb/usb.h:68: warning: data definition has no type or storage class
libusb/usb.h:73: parse error before "u_int8_t"
libusb/usb.h:73: warning: no semicolon at end of struct or union
libusb/usb.h:74: warning: type defaults to `int' in declaration of `bDescriptorType'
libusb/usb.h:74: warning: data definition has no type or storage class
libusb/usb.h:75: parse error before "wData"
libusb/usb.h:75: warning: type defaults to `int' in declaration of `wData'
...


Has anyone successfully compiled the Linux Source in MinGW? Could I get some pointers please?

Thanks.

fitchett
Site Admin
Posts: 259
Joined: Fri Dec 05, 2003 3:45 pm
Location: Canada
Contact:

Re: Compiling Linux Source in MinGW?

Postby fitchett » Wed Apr 08, 2009 11:45 pm

http://www.phidgets.com/documentation/T ... _MinGW.pdf

Please review this document, and provide feedback if you would find anything else helpful.

Chester

MooseHole

Re: Compiling Linux Source in MinGW?

Postby MooseHole » Thu Apr 09, 2009 9:17 am

Thank you for your response.

I have already read that document. However, it does not cover the name mangling part, so I still can't get the linker to work using the windows phidget library.

EDIT: Here is the output from my linker for reference:

Code: Select all

io.o(.text+0x17e): In function `io_win':
C:/msys/home/user/proj/io.c:121: undefined reference to `_imp__CPhidgetInterfaceKit_create@4'
io.o(.text+0x1a2):C:/msys/home/user/proj/io.c:128: undefined reference to `_imp__CPhidgetInterfaceKit_set_OnSensorChange_Handler@12'
io.o(.text+0x1bc):C:/msys/home/user/proj/io.c:129: undefined reference to `_imp__CPhidget_set_OnAttach_Handler@12'
io.o(.text+0x1d6):C:/msys/home/user/proj/io.c:130: undefined reference to `_imp__CPhidget_set_OnDetach_Handler@12'
io.o(.text+0x395): In function `open_socket':
C:/msys/home/user/proj/io.c:211: undefined reference to `_imp__CPhidget_open@8'
io.o(.text+0x40d):C:/msys/home/user/proj/io.c:218: undefined reference to `_imp__CPhidget_waitForAttachment@8'
io.o(.text+0x42a):C:/msys/home/user/proj/io.c:221: undefined reference to `_imp__CPhidget_getErrorDescription@8'

fitchett
Site Admin
Posts: 259
Joined: Fri Dec 05, 2003 3:45 pm
Location: Canada
Contact:

Re: Compiling Linux Source in MinGW?

Postby fitchett » Thu Apr 09, 2009 12:41 pm

We'll take a look at this on Monday. Just to be clear, you should not be attempting to compile the Linux source on Windows - you won't have any success with that.

Chester

MooseHole

Re: Compiling Linux Source in MinGW?

Postby MooseHole » Thu Apr 09, 2009 3:10 pm

Is it possible to get a windows source then, so I can compile it myself?

MooseHole

Re: Compiling Linux Source in MinGW?

Postby MooseHole » Thu Apr 16, 2009 9:42 am

Maybe you can compile it in MinGW's gcc instead?

MooseHole

Re: Compiling Linux Source in MinGW?

Postby MooseHole » Mon Apr 20, 2009 11:22 am

fitchett wrote:We'll take a look at this on Monday.
Hello, I was just wondering if anything useful came from this. Thanks!

Don
Site Admin
Posts: 3
Joined: Tue Mar 10, 2009 3:50 pm
Contact:

Re: Compiling Linux Source in MinGW?

Postby Don » Wed Apr 22, 2009 12:29 pm

Hi,

Please see viewtopic.php?f=37&t=2838&p=10043#p10043 for a continuation of this issue.


Don

MooseHole

Re: Compiling Linux Source in MinGW?

Postby MooseHole » Mon Apr 27, 2009 2:46 pm

Thank you! I updated my MinGW compiler and it works now.

Unfortunately, I now have undefined references to gxx_personality_v0, but that's not your problem.

EDIT: gcc version 3.4.5 does not work with phidgets, but version 4.3.0 (alpha) does work. The gxx_personality_v0 stuff went away when I did a full reinstall of mingw using the candidate version (which includes gcc 4.3.0), and did not install g++.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests