Hi, I am new to smalltalk and I have just started using Pharo. I am trying to read a C++ function from a dll and then display output in pharo. I tried using FFI , but I am unable to implement it in this scenario. Can anyone please help me with this? Regards Shanu
here you go https://gforge.inria.fr/scm/viewvc.php/*checkout*/PharoByExampleTwo-Eng/Alie... I am not expert on these things and the chapter I linked is for C and not C++ but until some expert replies you may have success in trying this ________________________________ From: Shanu Kalra <shanukalra25@gmail.com> To: Pharo-users@lists.gforge.inria.fr Sent: Friday, 23 November 2012, 7:16 Subject: [Pharo-users] Connecting to a C++ dll Hi, I am new to smalltalk and I have just started using Pharo. I am trying to read a C++ function from a dll and then display output in pharo. I tried using FFI , but I am unable to implement it in this scenario. Can anyone please help me with this? Regards Shanu
C++ and FFI = Forget It just google for it.. you will see that literally no single language which fully supports it.. most of things require a lot of extra non-trivial steps and not always working.. On 23 November 2012 09:27, dimitris chloupis <thekilon@yahoo.co.uk> wrote:
here you go
https://gforge.inria.fr/scm/viewvc.php/*checkout*/PharoByExampleTwo-Eng/Alie...
I am not expert on these things and the chapter I linked is for C and not C++ but until some expert replies you may have success in trying this ________________________________ From: Shanu Kalra <shanukalra25@gmail.com> To: Pharo-users@lists.gforge.inria.fr Sent: Friday, 23 November 2012, 7:16 Subject: [Pharo-users] Connecting to a C++ dll
Hi,
I am new to smalltalk and I have just started using Pharo. I am trying to read a C++ function from a dll and then display output in pharo. I tried using FFI , but I am unable to implement it in this scenario. Can anyone please help me with this?
Regards Shanu
-- Best regards, Igor Stasenko.
Is it possible if I use NativeBoost? And if possible can you please tell me exactly how to call an external function from a dll and display the ouput in pharo. Thanks Shanu -- View this message in context: http://forum.world.st/Connecting-to-a-C-dll-tp4656451p4657114.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
no, it is not possible, since NativeBoost is "a kind of FFI" after all... and the problem is not with ffi libraries but with c++ (lack of) standards On Nov 28, 2012, at 1:25 PM, shanukalra <shanukalra25@gmail.com> wrote:
Is it possible if I use NativeBoost? And if possible can you please tell me exactly how to call an external function from a dll and display the ouput in pharo.
Thanks Shanu
-- View this message in context: http://forum.world.st/Connecting-to-a-C-dll-tp4656451p4657114.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
btw, I don't know what are you trying to do, but some c++ libraries provides an "ffi capable" extra library, to handle this kind of issues. On Nov 28, 2012, at 1:31 PM, Esteban Lorenzano <estebanlm@gmail.com> wrote:
no, it is not possible, since NativeBoost is "a kind of FFI" after all... and the problem is not with ffi libraries but with c++ (lack of) standards
On Nov 28, 2012, at 1:25 PM, shanukalra <shanukalra25@gmail.com> wrote:
Is it possible if I use NativeBoost? And if possible can you please tell me exactly how to call an external function from a dll and display the ouput in pharo.
Thanks Shanu
-- View this message in context: http://forum.world.st/Connecting-to-a-C-dll-tp4656451p4657114.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Just one thing, so that he doesn't lose hope so fast. Maybe if he explains a bit of the context there's a better solution. Can you say what library you want to bind? About binding C++, IF it's in a DLL, I wouldn't say that it's plain impossible, but that it depends mainly on how the dll is generated, as there are different degrees of compatibility between C++ and DLLs. As nativeboost let's you generate custom assembly, in theory it may be possible but in practice might be hard, you should be warned, and will require some low-level programming abilities. My first question is if you are sure it's a C++ dll and not a plain C one? You may want to read this<http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL> to understand what you are dealing with first. Cheers, Javier On Wed, Nov 28, 2012 at 9:33 AM, Esteban Lorenzano <estebanlm@gmail.com>wrote:
btw, I don't know what are you trying to do, but some c++ libraries provides an "ffi capable" extra library, to handle this kind of issues.
On Nov 28, 2012, at 1:31 PM, Esteban Lorenzano <estebanlm@gmail.com> wrote:
no, it is not possible, since NativeBoost is "a kind of FFI" after all... and the problem is not with ffi libraries but with c++ (lack of) standards
On Nov 28, 2012, at 1:25 PM, shanukalra <shanukalra25@gmail.com> wrote:
Is it possible if I use NativeBoost? And if possible can you please tell me exactly how to call an external function from a dll and display the ouput in pharo.
Thanks Shanu
-- View this message in context: http://forum.world.st/Connecting-to-a-C-dll-tp4656451p4657114.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Lic. Javier Pimás Ciudad de Buenos Aires
On 28 November 2012 18:20, Javier Pimás <elpochodelagente@gmail.com> wrote:
Just one thing, so that he doesn't lose hope so fast. :)
Maybe if he explains a bit of the context there's a better solution. Can you say what library you want to bind?
About binding C++, IF it's in a DLL, I wouldn't say that it's plain impossible, but that it depends mainly on how the dll is generated, as there are different degrees of compatibility between C++ and DLLs. As nativeboost let's you generate custom assembly, in theory it may be possible but in practice might be hard, you should be warned, and will require some low-level programming abilities.
My first question is if you are sure it's a C++ dll and not a plain C one?
You may want to read this to understand what you are dealing with first.
yes, your link is a nice description of a problem.. it shows that even connecting two different C/C++ modules, possibly compiled by different compilers, can be problematic.. Not saying about connecting C++ module with any other language.
Cheers, Javier
-- Best regards, Igor Stasenko.
participants (6)
-
dimitris chloupis -
Esteban Lorenzano -
Igor Stasenko -
Javier Pimás -
Shanu Kalra -
shanukalra