I have to delve into the world of C++ and wondered if anyone has a wrapper class already done for newlisp? I realise I can do C calls within C++ but was wondering about a more 'native' solution.
Nigel
C++ wrapper for newlisp ?
-
- Posts: 429
- Joined: Tue Nov 11, 2003 2:11 am
- Location: Brisbane, Australia
I assume you want to import newlisp.so or newlisp.dll from a C++ application? When using C++ I guess you would have to declare all imported functions as:
extern "C" { int myImportFunc(); }
You then can call myImportFunc(); from inside a C++ Class function. I don't think that there is any other possibility, because all C++ function and class names are 'mangeled' to different names by the C++ preprocessor before compiling and linking, the 'extern' declaration protects from that. My C++ knowledge is a bit rusty though.
May be there are special import facilities in the C++ Class library you are using, which take care of everything?
Lutz[/code]
extern "C" { int myImportFunc(); }
You then can call myImportFunc(); from inside a C++ Class function. I don't think that there is any other possibility, because all C++ function and class names are 'mangeled' to different names by the C++ preprocessor before compiling and linking, the 'extern' declaration protects from that. My C++ knowledge is a bit rusty though.
May be there are special import facilities in the C++ Class library you are using, which take care of everything?
Lutz[/code]
-
- Posts: 429
- Joined: Tue Nov 11, 2003 2:11 am
- Location: Brisbane, Australia
Thanks for the pointer Lutz.
I was actually wondering if someone had already done a full class
eg maybe a class that acts like a iostream sink/source treating newlisp
like an interaction with a user viz
newlispout << "(+ 2 3 4)"
newlispin >> strResult
- if not I'll post anything worthwhile I code.
Regards
Nigel
I was actually wondering if someone had already done a full class
eg maybe a class that acts like a iostream sink/source treating newlisp
like an interaction with a user viz
newlispout << "(+ 2 3 4)"
newlispin >> strResult
- if not I'll post anything worthwhile I code.
Regards
Nigel