[Gambas-devel] Developing components with C++ for C++libraries

Benoît Minisini gambas at ...1...
Sun Jan 31 20:11:50 CET 2010


> There is some library, written with C++. I want to use its power with
> Gambas.
> It's a static library.
> 
> So, using the documentation for Gambas, I have made an empty component.
> I used gb.mysql component as template, because it consists of only 1
> pair of header and source files.
> I included the header of my library. While compiling there were
> mistakes, because gcc tried to compile namespaces, etc. I resolved
> this problem. All compilled well. Then while including component in
> Gambas-project there was an error #162. I added empty function
> GB_INIT() in <<<extern "C" {}>>>. That is all I can do with the
> documentation.
> 
> But I don't know, what is the next step must be done.
> 
> Regards,
> Dima Malkov.
> 

gb.db.mysql is not a good starting point, as it is not a component that 
declares classes, but that acts a "driver" for the gb.db component. Moreover, 
it a C component, not a C++ one.

I suggest starting from gb.pdf, which is a C++ component using a C++ shared 
library, with only a few classes.

Please look at it, and come back to tell me what you understood about class 
declaration.

And can you tell me which library you want to access, and give me more details 
about what your needs are? Because some interpreter special features may be 
needed or not, and your component could be part of Gambas.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list