Anonymous Guest
|
Posted: Sun Aug 20, 2006 4:35 pm Post subject: Building DLL's with data modules ... problem! |
|
|
Hi there! This is my first post ... so be gentle!
I use FTN95 for Net and Win32 (but still at version 4.0.0 ... this may be relevant!).
I have a project with a number of functions and subroutines together with a single data module (the regular stuff!). When everything is together as a single programme, it works fine ... no compiler errors or warnings. So, I thought, let's make it into a .DLL structure.
So, I carefully split out all functions and subroutines into individual units, compiled them with the command:
ftn95 /FULL_UNDEF /ZEROISE /FIXED_FORMAT %1 /MOD_PATH ..MODULES
Then combined all .OBJ files into a .DLL with a .lnk file containing the commands:
dll
lo *.obj
subsystem windows
exportall
file mydll
All seems to work as expected!
Then I run a test programme compiled with the commands:
ftn95 /ZEROISE /FIXED_FORMAT %1 /MOD_PATH MODULES
and link in the files with the commands:
echo subsystem windows > inttemp$.lnk
echo load %1 >> inttemp$.lnk
echo load mydll.dll >> inttemp$.lnk
echo load MODULESmydata_DATA >> inttemp$.lnk
echo file >> inttemp$.lnk
slink inttemp$.lnk
Everything works until I run the programme ... at which point I get an ACCESS VIOLATION initialising a matrix in the data module. This was not a problem in the full programme ... nor is it a problem if I build another test programme that simply initialises that matrix in the data module on its own - but using the mydll.dll. Very puzzling!
Has anyone any thoughts on the solution --- is it the compiler version? Is it a compiler option? Is it dirty programming that only becomes obvious in the .DLL environment.
All thoughts and comments very welcome. Thank you in anticipation.
Norm |
|