replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - newbie to .NET in Visual Studio ...
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 

newbie to .NET in Visual Studio ...

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



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Sat Sep 26, 2009 11:00 am    Post subject: newbie to .NET in Visual Studio ... Reply with quote

I have successfully (yet to be tested!) created a .DLL file containing various functions and subroutines in plain old .FOR. I also included a .F95 file for a data module in the solution. Everything seemd to work OK resulting in the creation of xxxx.DLL.

Then, I decided to run a test programme in .NET (which had run in FTN95 using a data module inside a .DLL). I set up specific references to FTN95lib.dll, salflibc.dll and the newly created xxxx.dll. I then created my test programme which contains a reference to the data module (USE yyyy and so on) which should be inside the xxxx.dll.

It did not compile and I received errors when I tried to build the solution:

"Cannot find definition for MODULE yyyy" which should have been the .F95 file contained in the xxxx.dll.

Is there something obvious that I am missing? Perhaps the compiler and linker options are missing? But which ones?

Thnk you in advance.

regards

Norm Confused
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Sep 26, 2009 12:59 pm    Post subject: Reply with quote

You will need separate and different build processes for Win32 and .NET.
Everything will need to be rebuilt including the DLL and modules.
Back to top
View user's profile Send private message AIM Address
nsinclair



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Sun Sep 27, 2009 12:38 am    Post subject: Reply with quote

Thanks Paul. I should have made it clearer that everything was done in .NET. First, I built the .DLL containing subroutines, functions (.FOR code) and the data module (.F95 code). All in one project producing the .DLL.

Then, a new project in .NET with a single programme using references to the .DLL. It is during the compilation of that programme that the error arises.

Sorry, I should have been clearer.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Sep 27, 2009 9:12 am    Post subject: Reply with quote

First you need to find out where the .MOD files are for your DLL, then you should copy them to your other project or use /MOD_PATH on the FTN95 command line in order to indicate where the compiler can find the .MOD files.

However, you will be limited in what you can do with MODULEs in a DLL.
I think you will be OK with MODULE subroutines and functions but you will not be able to directly share module data between a main program and a DLL or between different DLLs.
Back to top
View user's profile Send private message AIM Address
nsinclair



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Sun Sep 27, 2009 1:46 pm    Post subject: Reply with quote

Thanks Paul

Does this mean that .NET behaves quite differently from FTN95 where I have a .DLL with the data module included which works perfectly well between routines within and outside the .DLL?

Why is this?

Norm
Back to top
View user's profile Send private message
nsinclair



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Sun Sep 27, 2009 2:00 pm    Post subject: Reply with quote

Paul, forgot to add that I have a function in the .DLL that receives the initial data (in character strings) which is only used by other functions and subroutines within the .DLL. The results are passed back to main as character strings from the .DLL. The data module is loaded and maninpulated within the .DLL routines.

I think you were referring to direct access to shared data in the data module.

Is that correct?

Norm
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Sep 27, 2009 7:18 pm    Post subject: Reply with quote

Yes that is correct.
Back to top
View user's profile Send private message AIM Address
nsinclair



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Mon Sep 28, 2009 12:22 am    Post subject: Reply with quote

Thanks Paul

I'll have to go away and think about it ... something is not quite working when I use the additional compiler flags as I try to emulate the command line approach in FTN95.

In FTN95 when I compile the data module file itself, I use /ZEROISE /BINARY flags ...

And, in FTN95 when I compile the other programmes for the .DLL, I use a batch file with the line:
ftn95 /OPTIMISE /ZEROISE /FIXED_FORMAT %1 /MOD_PATH ..\MODULES

The final command sequence for creating the .DLL is to type on the DOS command line, SLINK setup_dll.lnk, where the .lnk file contains the commands:

dll
lo *.obj
lo d:\stclair_core\irisk_online\programmes\modules\irisk_online.obj
subsystem windows
exportall
file irisk

Noting that the data module, irisk_online.obj is added separately to the .DLL.

It is mapping this process to the .NET Visual Studio that is giving me problems.

In Visual Studio, I note that I included the data module .F95 programme in the SOURCE FILES. Should this be compiled separately then added in later in the process?

Your help is much appreciated.

Regards

Norm
Back to top
View user's profile Send private message
nsinclair



Joined: 23 Sep 2009
Posts: 10
Location: Melbourne Australia

PostPosted: Mon Sep 28, 2009 2:11 am    Post subject: Reply with quote

G'Day Paul

Followed instruction and copied .MOD file that was created when .DLL was created successfully. It seems that .NET compiles the MODULE correctly and creates the .MOD file within the project.

I copied the .MOD file to the new project that is to test the .DLL rather than use the /MOD_PATH flag.

I then BUILD the test project with 1 main programme and references to the new .DLL as well as the SLAFLIBC and FTN95LIB.

I get a new error on compilation concerning "more than one source file specified with names" ...:

here is the output from the buildlog.txt file.

Compiling file: FixedFormat1.for
FTN95.EXE "D:\STCLAIR_CORE\irisk_net\test_irisk\test_irisk\FixedFormat1.for" /NO_BANNER /DEBUG /FULL_DEBUG /IMPLICIT_NONE /MOD_PATH /MOD_PATH D:\STCLAIR_CORE\irisk_net\test_irisk\test_irisk /STANDARD_ERROR_REPORTS /SINGLE_THREADED /FPP /CLR /CLR_VER 2 /REF "C:\Program Files\Silverfrost\FTN95\redist\ftn95lib.dll" /REF "C:\Program Files\Silverfrost\FTN95\redist\salflibc.dll" /REF "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /REF "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /REF "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll" /REF "D:\STCLAIR_CORE\irisk_net\test_dll_build\test_dll_build\Debug\NET\test_dll_build.dll" /VS8 /DELETE_OBJ_ON_ERROR /ERROR_NUMBERS /UNLIMITED_ERRORS /BINARY "Debug\NET\FixedFormat1.dbk"


Compiler output:
*** More than one source file specified with names
D:\STCLAIR_CORE\irisk_net\test_irisk\test_irisk\FixedFormat1.for and
D:\STCLAIR_CORE\irisk_net\test_irisk\test_irisk
1 ERROR [D:\STCLAIR_CORE\irisk_net\test_irisk\test_irisk\FixedFormat1.for FTN95 5.20.0] - Compilation failed.

There were compile errors, no link performed


test_irisk build failed.

This seems simple to fix ... but it hasn't been .... any thoughts.

Norm
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 28, 2009 9:14 am    Post subject: Reply with quote

This is probably a linker failure report.
Are you using Visual Studio or your own command line?
Can you look at the command line being issued? You can get this in VS and Plato.
If this does not show anything wrong then create a MAP file for the linker and have a look at that.
Back to top
View user's profile Send private message AIM Address
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