View previous topic :: View next topic |
Author |
Message |
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Fri Aug 07, 2009 12:53 am Post subject: Plugin Development in C/C++ on the wiki |
|
|
In an effort to get a foot in the door of deled plugin development, I tried out the sample code that's listed on the wiki:
http://www.delgine.com/wiki/index.php/Plugin_Development_in_C/C%2B%2B
However, when deled loads in the dll, I get an error in the plugin log saying it has "no version property" and it fails to load.
I kind of doubt that the code itself is incorrect, so it may be maybe I'm not setting things up right in Visual Studio (Visual Studio 2008, not the express version).
Does anyone who develops plugins in VS have any suggestions or advice? |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Sat Aug 08, 2009 10:10 pm Post subject: |
|
|
Does anyone use C/C++ here?! |
|
Back to top |
|
|
stumcd Member
Joined: 02 Jul 2006 Posts: 37 Location: Edinburgh - Scotland
|
Posted: Sun Aug 09, 2009 5:58 am Post subject: |
|
|
Yes, but 1) I dont write plugins. 2) I use g++ for portability so don't work with VS. If it's not the code, then I would assume the problem is name mangling. The loader will expect standard functions, but C++ will name mangle. However, I just looked at the wiki and it's got STDCALL which seems reasonable (Like I said I don't work with MS).
So if I was trying to debug it I'd try and see what symbol names are in the DLL and check them against a working DLL. I'd use nm for that, there must be a Windoze equivalent. If they don't match, then some googling to see how you need to compile the code to get them right.
Best I can offer I'm afraid. |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Wed Aug 12, 2009 3:02 am Post subject: |
|
|
stumcd wrote: |
Yes, but 1) I dont write plugins. 2) I use g++ for portability so don't work with VS. If it's not the code, then I would assume the problem is name mangling. The loader will expect standard functions, but C++ will name mangle. However, I just looked at the wiki and it's got STDCALL which seems reasonable (Like I said I don't work with MS).
So if I was trying to debug it I'd try and see what symbol names are in the DLL and check them against a working DLL. I'd use nm for that, there must be a Windoze equivalent. If they don't match, then some googling to see how you need to compile the code to get them right.
Best I can offer I'm afraid. |
That's what I thought too, eh well, this is a low priority project for me at the moment, and I'll probably eventually figure it out.
Though maybe I should learn delphi since there seems to be a ton of support for that! |
|
Back to top |
|
|
trucker2000 DeleD PRO user
Joined: 11 May 2005 Posts: 1839 Location: Sacramento, California
|
Posted: Wed Aug 12, 2009 9:53 am Post subject: |
|
|
Quote: |
However, when deled loads in the dll, I get an error in the plugin log saying it has "no version property" and it fails to load. |
This is just a shot in the dark, but do you have this defined in your pluggin?
Code: |
char* STDCALL PluginDeleDVersion() {
return "1.8"; }
char* STDCALL PluginVersion() {
return "1.0"; }
|
It's really the only place I can see that asks for a version. _________________ Some day I will grow up and be a real modeler.
"Never give up! Never surrender!!"
Sys specs:
asus
8 gigs ram
Invidia gtx560 video card
Windows 8 (worst op sys Ever) |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Thu Aug 13, 2009 12:47 am Post subject: |
|
|
trucker2000 wrote: |
Quote: |
However, when deled loads in the dll, I get an error in the plugin log saying it has "no version property" and it fails to load. |
This is just a shot in the dark, but do you have this defined in your pluggin?
Code: |
char* STDCALL PluginDeleDVersion() {
return "1.8"; }
char* STDCALL PluginVersion() {
return "1.0"; }
|
It's really the only place I can see that asks for a version. |
I know. I copied the code exactly from the wiki, just to test it out and use it as a template. But then I ran into the above mentioned error, which is why I had a feeling it was something more to do with project settings than the actual code. |
|
Back to top |
|
|
Il Buzzo DeleD PRO user
Joined: 12 Aug 2004 Posts: 271 Location: Italy
|
Posted: Mon Oct 05, 2009 2:46 pm Post subject: |
|
|
Hi guys,
I've been out of DeleD programming for a lot now, also because I switched almost totally to linux.
However I can help in the creation of a new plugin extension for Visual Studio as soon as I update my DeleD version (I'm currently on 1..
You can try Visual Studio Wizard (if you're using VS 2005 or 2008, also express version).
You can start creating a simple export plugin and changing the code (I don't think specifications changed a lot).
I'll try the new DeleD version as soon as possible.
Bye all |
|
Back to top |
|
|
granada Team member
Joined: 07 Aug 2004 Posts: 1955 Location: England
|
Posted: Mon Oct 05, 2009 5:54 pm Post subject: |
|
|
Quote: |
Hi guys,
I've been out of DeleD programming for a lot now, also because I switched almost totally to linux.
However I can help in the creation of a new plugin extension for Visual Studio as soon as I update my DeleD version (I'm currently on 1..
You can try Visual Studio Wizard (if you're using VS 2005 or 2008, also express version).
You can start creating a simple export plugin and changing the code (I don't think specifications changed a lot).
I'll try the new DeleD version as soon as possible.
|
Hi there,its realy good to see your still alive and well .Hope to here more from you soon .
Dave _________________ AMD Phenom(tm)IIx6 1090t Processor 3.20 GHS
8.00 GB memory
Windows 7 64 bit
Nvida Geforce GTX 580 |
|
Back to top |
|
|
Il Buzzo DeleD PRO user
Joined: 12 Aug 2004 Posts: 271 Location: Italy
|
Posted: Mon Oct 05, 2009 8:01 pm Post subject: |
|
|
Hi All,
I just downloaded DeleD 2.1.0 and tested plugins created with VS2005 and VS2008 using the wizard I created some times ago for version > 1.6.
I tried both the import and the export plugin and they worked without problems.
So I suggest to start from wizard code to create plugins in VS2005 or VS2008, you can download from:
http://www.delgine.com/plugins/viewPlugin.php?catid=41&catdesc=Extensions&contentid=26
Bye all |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Mon Oct 05, 2009 8:25 pm Post subject: |
|
|
Good to see you're alive and well, I Buzzo! _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
Grandmaster B DeleD PRO user
Joined: 03 Jul 2007 Posts: 218
|
Posted: Mon Oct 05, 2009 8:37 pm Post subject: |
|
|
Look into the DLL with "Dependency Walker" ( http://www.dependencywalker.com/ ) and see how the function symbols are named. They should be readed as:
PluginName
PluginDescription
PluginDeleDVersion
PluginVersion
PluginAuthor
PluginEmail
PluginSetCallback
PluginExecute
Without any decoration or underscope!
If they have any decoration create a file "plugin.def" with the following content:
Code: |
EXPORTS
PluginName
PluginDescription
PluginDeleDVersion
PluginVersion
PluginAuthor
PluginEmail
PluginSetCallback
PluginExecute
|
Then in Visual Studio go to the project options and set this file as the "Module Definition" (/DEF:name) under the linker options (probably under "Linker/Input"). |
|
Back to top |
|
|
|