Recent

Author Topic: How do I use an "o" file?  (Read 2841 times)

JimKueneman

  • Full Member
  • ***
  • Posts: 220
How do I use an "o" file?
« on: August 20, 2014, 04:50:53 am »
I am working on converting this:

https://github.com/signal11/hidapi

When I run the make file in the mac folder I get an "hid.o" file.  Once I get the C header file translated to pascal what do I do to link in the "hid.o" file and call a function in the pascal translated file?

Jim

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I use an "o" file?
« Reply #1 on: August 20, 2014, 05:41:25 am »
When I run the make file in the mac folder I get an "hid.o" file.  Once I get the C header file translated to pascal what do I do to link in the "hid.o" file and call a function in the pascal translated file?
Code: [Select]
{$L thatfile.o}Note the object file format (differs per platform AFAIK) and all other things that it uses, including but not limited to standard C library.

JimKueneman

  • Full Member
  • ***
  • Posts: 220
Re: How do I use an "o" file?
« Reply #2 on: August 20, 2014, 05:55:01 am »
Thanks I found that.  As you said I am getting a

Quote
ld: warning: ignoring file hid.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x07 0x00 0x00 0x01 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (i386): hid.o

Error.  I built the hid.o file on the machine I am running Lazarus. 


Jim

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How do I use an "o" file?
« Reply #3 on: August 20, 2014, 06:24:55 am »
The error message is clear. You did read my warning, didn't you? Where you build the .o is not a problem, but HOW you build it could be the problem.

 

TinyPortal © 2005-2018