[Gambas-user] Get structure from extern function?
Fabien Bodard
gambas.fr at ...626...
Thu Jul 3 13:18:50 CEST 2014
Scuse me I've made a bad read ..
Just do :
Version = LIBVersion()
Le 3 juil. 2014 12:05, "CJ" <lists at ...2828...> a écrit :
> I'm trying to receive a simple structure from a shared library but
> get an Type Mismatch error saying...
>
> "wanted StructVersion, got Function instead in FMain:87"
>
> Before calling the extern function I declare the structure, variable
> and the library using...
>
> Public Struct StructVersion
> Major As Byte
> Minor As Byte
> End Struct
>
> Public Version As StructVersion
>
> Extern LIBVersion() As StructVersion In "libtest"
>
> But get the error when calling the function with...
>
> Version = LIBVersion
>
> I did find an older post made by Benoît and using the code given in that
> post results
> in the same error (i.e "wanted StructTm, got Function instead in
> FMain:107")
>
> --8<-----------------------------------------------------------------
>
> Public Struct StructTm
> tm_sec As Integer
> tm_min As Integer
> tm_hour As Integer
> tm_mday As Integer
> tm_mon As Integer
> tm_year As Integer
> tm_wday As Integer
> tm_yday As Integer
> tm_isdst As Integer
> End Struct
>
> Private Extern localtime(timep As Pointer) As StructTm In "libc:6"
>
> --8<-----------------------------------------------------------------
>
> Source: http://permalink.gmane.org/gmane.comp.lang.gambas.user/16080
>
> Am I missing something?
>
>
> [System]
> Gambas=3.5.90
> OperatingSystem=Linux
> Kernel=3.13.0-29-generic
> Architecture=x86
> Distribution=Ubuntu 14.04 LTS
> Desktop=XFCE
> Theme=QGtk
> Language=en_US.UTF-8
> Memory=1002M
> [Libraries]
> Cairo=libcairo.so.2.11301.0
> Curl=libcurl.so.4.3.0
> DBus=libdbus-1.so.3.7.6
> GStreamer=libgstreamer-0.10.so.0.30.0
> GStreamer=libgstreamer-1.0.so.0.204.0
> GTK+3=libgtk-3.so.0.1000.8
> GTK+=libgtk-x11-2.0.so.0.2400.23
> OpenGL=libGL.so.1.2.0
> Poppler=libpoppler.so.44.0.0
> Qt4=libQtCore.so.4.8.6
> SDL=libSDL-1.2.so.0.11.4
>
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list