Adlane Rebai wrote:
> Hello everybody,
> I have a software (I can access to the source code) which is compiled
> in dll with Compaq Visual Fortran. I want to create an external dll
> which will be called by my software.
> The aim of this manipulation is to allow User defined function: allow
> user that have not the permission to access the source code of the
> software, to create their own function.
> I understand that I have to add
> cDEC$ ATTRIBUTES DLLIMPORT:: function_test
> in the source code of my software
> and in my external dll i have to add:
> cDEC$ ATTRIBUTES DLLEXPORT:: function_test
> But I don't understand how to build my external dll. I have the linker
> error 2001.
> I'm a newbie in CVF so if someone could help me, I'll be greatfull
> Thanks
Error 2001 means "unresolved external symbol" - in other words you are
calling a subprogram, but the linker can't find it. Does this happen
when you are building the DLL, or the main program?
The procedure is described in the online Programmer's Guide - under
"Creating Fortran DLLs". From the command line you have to remember the
/dll command line option when creating the DLL,
e.g. DF /dll mydll.f90
and to include the .lib file that command creates when linking the
calling program.
e.g DF mainapp.f90 mydll.lib
The .lib file is a glue layer that tells the main program how to get at
the DLL.
There are special cases, and the procedure is different if you are using
Visual Studio, but it's all described in the Programmer's Guide.
--
John Appleyard - (send email to john!news@.. rather than spamtrap@..)
Polyhedron Software
Programs for Programmers - QA, Compilers, Graphics, Consultancy
********* Visit our Web site on http://www.polyhedron.co.uk/ *********