replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Problems in linking to 3rd party DLL (VS 2008)
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems in linking to 3rd party DLL (VS 2008)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
darlyb



Joined: 16 Aug 2010
Posts: 2

PostPosted: Mon Aug 16, 2010 3:28 pm    Post subject: Problems in linking to 3rd party DLL (VS 2008) Reply with quote

I seem unable to link to my external DLL when using the VS 2008 IDE and modifying the project properties (probably because I do not know what setting to change).

Using the IDE I can build the obj code from the ftn95 code and then use : slink xxx.obj mydll.dll. This creates an exe that will run and reference the function from the DLL.

Whenever I add mydll.dll to the project settings, the dll appears in the slink output but as its before the obj code (which is in the link.lst file) it gives a warning about the function is missing. I can also get this error from the command line if using : slink mydll.dll xxx.obj, it would appear the parameters passed to slink are order sensitive.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Mon Aug 16, 2010 7:13 pm    Post subject: Reply with quote

The order is probably not significant but there are cases when the compiler needs to be able to "see" the DLL at compile time or alternatively have access to the correct function interface.

In other words you may been assuming the default interface whilst the DLL contains different function details. For example the DLL may have been created using STDCALL whilst the usage does not include this information.

Help may be available for you here if you can provide details of how the function is defined in the DLL and how it is called in the exe etc.
Back to top
View user's profile Send private message AIM Address
darlyb



Joined: 16 Aug 2010
Posts: 2

PostPosted: Tue Aug 17, 2010 9:10 am    Post subject: Reply with quote

The DLL is built using VS 2005 and all exported functions are defined as STDCALL (WINAPI). Function in ftn95 is defined as stdcall func 'exportedfunc' (val, val) : integer * 2.

The DLL is accessible during compile time as the full path is entered, it all works when dropping to the command line and using slink.

Not sure if it is relevant but when using the command line if the order is obj then dll it will compile an exe that runs and calls the function, if the order is dll then obj it will compile with with a warning of 'Warning the following symbols are missing : <function name> <obj name>. You can then run this exe which then throws a 'Run-time Error' call to missing routine <function name>.

For the time being I have set the project to supress linking and then do a post build setup calling slink obj dll - this is working without problems.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
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


Powered by phpBB © 2001, 2005 phpBB Group