VMD-L Mailing List
From: Nicolas CHARVIN (Nicolas.Charvin_at_univ-savoie.fr)
Date: Tue Mar 15 2005 - 11:30:14 CST
- Next message: Luis Rosales: "IMD, basic questions..."
 - Previous message: John Stone: "Re: set a different beta field for each frame of trajectory"
 - In reply to: John Stone: "Re: Building plugins with Borland Bcc32"
 - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
 
>Nicolas,
>   One thing you need to double-check here is that the DLL you create
>(the compiled file will end up being named gmplugin.so when it's finished)
>needs to export several functions as external entry points.
>These functions are:
>   VMDPLUGIN_init()
>   VMDPLUGIN_register()
>   VMDPLUGIN_register_tcl()
>   VMDPLUGIN_fini()
You were right!
2 problems in one:
1) First, I forgot -DVMDPLUGIN_EXPORTS  option for the compilation. Stupid me!
The correct command is:
bcc32 -WD -DWIN32 -DVMDPLUGIN_EXPORTS gmqplugin.c
2) Then, I use tdump.exe to look at the exported function
tdump -ee gmqplugin.dll
                    Display of File GMQPLUGIN.DLL
EXPORT ord:0003='_vmdplugin_fini'
EXPORT ord:0001='_vmdplugin_init'
EXPORT ord:0002='_vmdplugin_register'
Yes, the first underscore should not be there!
Some Googling , and I find that I should use a gmqplugin.def file, to 
create alias at link time.
gmqplugin.def:
  EXPORTS
  vmdplugin_fini = _vmdplugin_fini
  vmdplugin_init = _vmdplugin_init
  vmdplugin_register = _vmdplugin_register
Then:
tdump -ee gmqplugin.dll
                    Display of File GMQPLUGIN.DLL
EXPORT ord:0004='___CPPdebugHook'
EXPORT ord:0003='_vmdplugin_fini'
EXPORT ord:0001='_vmdplugin_init'
EXPORT ord:0002='_vmdplugin_register'
EXPORT ord:0005='vmdplugin_fini'
EXPORT ord:0006='vmdplugin_init'
EXPORT ord:0007='vmdplugin_register'
And finally, VMD recognize my plugin at startup!
It still doesn't load my molecule (vmd > ERROR) Could not read file 
D:/ncharvin/t/tutu/config.gmq) , and I don't know why (remember, it works 
fine under linux), but it should be a bug in my plugin, so I'll keep on 
investigate
Hope this helps someone using Borland tools
Thanks
nicolas
-- Nicolas.Charvin_at_univ-savoie.fr LMOPS - Lab. Matériaux Organiques à Propriétés Spécifiques Bât IUT - Université de Savoie 73376 LE BOURGET DU LAC CEDEX Tel: 04-79-75-86-53 http://www.univ-savoie.fr/labos/lmops
- Next message: Luis Rosales: "IMD, basic questions..."
 - Previous message: John Stone: "Re: set a different beta field for each frame of trajectory"
 - In reply to: John Stone: "Re: Building plugins with Borland Bcc32"
 - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
 



