[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is it possible/acceptable to create a component in Gambas that depends on a shared library?
[Thread Prev] | [Thread Next]
- Subject: Re: Is it possible/acceptable to create a component in Gambas that depends on a shared library?
- From: Lee <t.lee.davidson@xxxxxxxxx>
- Date: Fri, 13 Feb 2026 09:40:25 -0500
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On 2/12/26 1:04 PM, gbWilly wrote:
You did use Exec "getuid" for the first 4 functions in your example. I changed this, because, even though the result happens to be the same, it seems you need to Exec 3 other functions from the library instead for the last 3 functions (see red marked section on screenshot). Is my assumption there correct?
Yes, your assumption is correct. I goofed. I had typed in the first Extern declaration and then copied and pasted it three times. I changed the Gambas function name on those three but not the library's function name. Good catch.
I also managed to use a simple function like basename and interface with it (see yellow marked section on screenshot).
It's good to see that you successfully implemented a different external function call. You see that it /can/ be quite simple. It will get more complex when you need to use pointers.
One thing to keep in mind, for future reference, is that Gambas can interface only with libraries written in C and not in C++ (unless the library does not use any C++ structures or capabilities that are not C compatible). If there is a particular library with which you'd like to interface and it is written in C++, look to see if it has a C-wrapper.
If you have any questions, feel free to ask here. Have fun! -- Lee --- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ---- --- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----
| Re: Is it possible/acceptable to create a component in Gambas that depends on a shared library? | gbWilly <gbWilly@xxxxxxxxxxxxxx> |