Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Plugin Development in C/C++ on the wiki

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins
View previous topic :: View next topic  
Author Message
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Fri Aug 07, 2009 12:53 am    Post subject: Plugin Development in C/C++ on the wiki Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Sat Aug 08, 2009 10:10 pm    Post subject: Reply with quote

Does anyone use C/C++ here?! Razz
Back to top
View user's profile Send private message Visit poster's website AIM Address
stumcd
Member


Joined: 02 Jul 2006
Posts: 37
Location: Edinburgh - Scotland

PostPosted: Sun Aug 09, 2009 5:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Wed Aug 12, 2009 3:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
trucker2000
DeleD PRO user


Joined: 11 May 2005
Posts: 1839
Location: Sacramento, California

PostPosted: Wed Aug 12, 2009 9:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Thu Aug 13, 2009 12:47 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Il Buzzo
DeleD PRO user


Joined: 12 Aug 2004
Posts: 271
Location: Italy

PostPosted: Mon Oct 05, 2009 2:46 pm    Post subject: Reply with 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.Cool.
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 Wink
Back to top
View user's profile Send private message Visit poster's website
granada
Team member


Joined: 07 Aug 2004
Posts: 1955
Location: England

PostPosted: Mon Oct 05, 2009 5:54 pm    Post subject: Reply with quote

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 Very Happy .Hope to here more from you soon Wink .

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
View user's profile Send private message Visit poster's website
Il Buzzo
DeleD PRO user


Joined: 12 Aug 2004
Posts: 271
Location: Italy

PostPosted: Mon Oct 05, 2009 8:01 pm    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Mon Oct 05, 2009 8:25 pm    Post subject: Reply with quote

Good to see you're alive and well, I Buzzo! Very Happy
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Grandmaster B
DeleD PRO user


Joined: 03 Jul 2007
Posts: 218

PostPosted: Mon Oct 05, 2009 8:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum