Hi All
I haven't followed the progress on this subject for many years, but do recall a member
writing a program called h_2_bi.
I have tried every search term in my Jurassic brain but can't get a hit.
Does anyone know of an updated solution or a link to the OP.?
Regards
C Header to .bi
Re: C Header to .bi
hello Dinosaur
you find h_2_bi at https://www.freebasic-portal.de/downloa ... s-134.html
I use fbfrog by dkl https://github.com/dkl/fbfrog
you find h_2_bi at https://www.freebasic-portal.de/downloa ... s-134.html
I use fbfrog by dkl https://github.com/dkl/fbfrog
Re: C Header to .bi
Hi All
Thanks srvaldez,
I don't know how you find that so quick, but the search facility on the FB Forum frustrates me.
Why can't i simply search for ONE word "h_2_bi".
Either way, fbfrog does the trick nicely.
Regards
Thanks srvaldez,
I don't know how you find that so quick, but the search facility on the FB Forum frustrates me.
Why can't i simply search for ONE word "h_2_bi".
Either way, fbfrog does the trick nicely.
Regards
Re: C Header to .bi
You can search with google, it usually gives results:
https://www.google.de/search?source=hp& ... g9AVjmnxwk
https://www.google.de/search?source=hp& ... g9AVjmnxwk
Re: C Header to .bi
Hi All
Using FBFrog on a .h file creates lots of "Not Found" .h files.
For exampleI have added the
Like:
bits/waitflags.h (not found)
Should be:
/usr/include/x86_64-linux-gnu/bits/waitflags.h
How do you normally handle this kind of problem ?
Do you correct the path in the source .h file or do you copy the .h file to another folder.
If correcting the path, how do I know which .h file to find the statement in ?
Regards
Using FBFrog on a .h file creates lots of "Not Found" .h files.
For example
Code: Select all
bits/wchar.h (not found)
bits/wordsize.h (not found)
AIOUSB_Core.h
AIOUSBDevice.h
AIOTypes.h
/usr/include/stdlib.h
stddef.h (not found)
bits/waitflags.h (not found)
bits/waitstatus.h (not found)
sys/types.h (not found)
/usr/include/alloca.h
stddef.h (not found)
bits/stdlib-float.h (not found)
/usr/include/assert.h
/usr/include/errno.h
bits/errno.h (not found)
ADCConfigBlock.h
AIOEither.h
/usr/include/stdlib.h
/usr/include/string.h
stddef.h (not found)
/usr/include/xlocale.h
/usr/include/stdlib.h
USBDevice.h
libusb.h (not found)
/usr/include/stdlib.h
AIOPlugNPlay.h
cJSON.h
/usr/include/semaphore.h
sys/types.h (not found)
/usr/include/time.h
bits/types.h (not found)
bits/semaphore.h (not found)
libusb.h (not found)
/usr/include/pthread.h
/usr/include/endian.h
bits/endian.h (not found)
bits/byteswap.h (not found)
/usr/include/sched.h
bits/types.h (not found)
stddef.h (not found)
/usr/include/time.h
bits/types.h (not found)
bits/sched.h (not found)
/usr/include/time.h
stddef.h (not found)
bits/time.h (not found)
bits/types.h (not found)
bits/types.h (not found)
bits/types.h (not found)
bits/pthreadtypes.h (not found)
bits/setjmp.h (not found)
bits/wordsize.h (not found)
libusb.h (not found)
/usr/include/stdio.h
stddef.h (not found)
bits/types.h (not found)
/usr/include/libio.h
/usr/include/_G_config.h
bits/types.h (not found)
stddef.h (not found)
/usr/include/wchar.h
stdarg.h (not found)
bits/stdio_lim.h (not found)
bits/sys_errlist.h (not found)
/usr/include/stdlib.h
/usr/include/unistd.h
bits/posix_opt.h (not found)
bits/environments.h (not found)
bits/types.h (not found)
stddef.h (not found)
bits/confname.h (not found)
/usr/include/getopt.h
sys/stat.h (not found)
libusb.h (not found)
AIOChannelMask.h
/usr/include/stdlib.h
/usr/include/assert.h
AIOContinuousBuffer.h
AIOUSB_ADC.h
AIOBuf.h
/usr/include/stdlib.h
/usr/include/stdio.h
AIOFifo.h
/usr/include/stdlib.h
/usr/include/stdio.h
AIOCmd.h
/usr/include/stdlib.h
/usr/include/stdio.h
/usr/include/stdlib.h
libusb.h (not found)
/usr/include/math.h
bits/math-vector.h (not found)
bits/huge_val.h (not found)
bits/huge_valf.h (not found)
bits/huge_vall.h (not found)
bits/inf.h (not found)
bits/nan.h (not found)
bits/mathdef.h (not found)
bits/mathcalls.h (not found)
bits/mathcalls.h (not found)
bits/mathcalls.h (not found)
DIOBuf.h
/usr/include/assert.h
/usr/include/stdio.h
/usr/include/stdlib.h
sys/stat.h (not found)
AIODeviceInfo.h
/usr/include/stdlib.h
AIODeviceQuery.h
/usr/include/stdio.h
/usr/include/stdlib.h
libusb.h (not found)
AIOCommandLine.h
AIOConfiguration.h
/usr/include/stdlib.h
/usr/include/stdio.h
/usr/include/assert.h
AIODeviceTable.h
libusb.h (not found)
/usr/include/stdlib.h
/usr/include/errno.h
AIOUSB_Properties.h
AIOProductTypes.h
AIOList.h
CStringArray.h
sys/queue.h (not found)
/usr/include/stdio.h
/usr/include/stdlib.h
/usr/include/assert.h
/usr/include/stdio.h
AIOUSB_Log.h
/usr/include/stdio.h
/usr/include/getopt.h
/usr/include/ctype.h
bits/types.h (not found)
/usr/include/stdlib.h
mex.h (not found)
emitting: libaiousb.bi (2511 declarations, 92 TODOs)
The missing .h files seem to have their paths incorrectly specified../fbfrog -incdir /usr/include libaiousb.h
Like:
bits/waitflags.h (not found)
Should be:
/usr/include/x86_64-linux-gnu/bits/waitflags.h
How do you normally handle this kind of problem ?
Do you correct the path in the source .h file or do you copy the .h file to another folder.
If correcting the path, how do I know which .h file to find the statement in ?
Regards
Re: C Header to .bi
Hi All
I have one issue with a number of C Functions that I don't understand.
The Functions are typically declared as per:
The error I get is as follows:
Regards
I have one issue with a number of C Functions that I don't understand.
The Functions are typically declared as per:
I then write a small test program as such:unsigned long AIOUSB_Init()
Code: Select all
Extern "C"
Extern AIOUSB_Init() Alias "AIOUSB_Init()" As Longint
Extern AIOUSB_ListDevices() Alias "AIOUSB_ListDevices()" As Longint
End Extern
Dim au As Longint
au = AIOUSB_Init(0)
Print au
There are descriptions relating to this problem for C/C++ but can't find anything usable in FreeBasic./home/barfresh/projects/aiousb/AIOTest.c:40:27: error: lvalue required as unary ‘&’ operand
AU$0 = *(int64*)*(int64*)&AIOUSB_Init();
^
Regards
Re: C Header to .bi
You state that the original C prototype is unsigned long AIOUSB_Init(), which takes no arguments, but then you go on to try to call it with 0 as an argument. Is there something missing there?
Anyway your declarations are not correct. try something like:
Anyway your declarations are not correct. try something like:
Code: Select all
Extern "C"
declare Function AIOUSB_Init Alias "AIOUSB_Init" () As Longint
declare Function AIOUSB_ListDevices Alias "AIOUSB_ListDevices" () As Longint
End Extern
Re: C Header to .bi
Hi All
caseih, I was aware of that, but tried dozens of different ways to call the function
to get rid of the error.
Regards
caseih, I was aware of that, but tried dozens of different ways to call the function
to get rid of the error.
Regards