Silverfrost Forums

Welcome to our forums

RC compiler in VS2005

22 Jan 2007 12:14 #1556

Hello I am trying to use FTN+VS2005 + Winteracter Question : how to define the resource compiler in VS2005 In Plato : Project ⇒ Properties ⇒ Miscellaneous [x] SRC compiler options /include c:\wint\include

How to do this in V2005 ?

Klaus

22 Jan 2007 5:05 #1558

As far as I know there is no equivalent to this in the VS plug-in.

The normal approach would be to copy the resource script into a RESOURCES section immediately after the main program. See 'Resources in FTN95' in the help file.

22 Jan 2007 8:29 #1561

Just to confirm Paul's reply - there is no option in VS for the resource compiler and the way to get it to work is to use a RESOURCES section.

26 Jan 2007 10:44 #1576

Hello thanks for the answer. But could you explain a little bit more how to do it ? I now have a reference file (called reference.rc) which is generated by Winteracter. What do I have to do with this file using VS2005 to compiler it ? The example in 'Resources in FTN95' help file doe not really help me.

Klaus

28 Jan 2007 2:24 #1579

Much like the example provided in the help you would need to include a RESOURCES section after your main program. You should insert the contents of the .rc as produced by Winteracter underneath the RESOURCES statement as the bitmap is done in the example.

WINAPP
INTEGER i,winio@
i=winio@(‘%ca[A beautiful bitmap]&’)
i=winio@(‘%bm[mybitmap]%2nl%cn%`bt[OK]’)
END
RESOURCES
mybitmap BITMAP c:\\bitmaps\\pic1.bmp
29 Jan 2007 9:53 #1582

Can I use an include statement instead of copying the resource file into the code ? Like :

RESOURCES include 'resource.rc'

29 Jan 2007 1:19 #1583

In theory YES. Try it.

29 Jan 2007 1:53 #1584

Well I did try, but does not work.

My program looks like this :

Program Main
.
.
.
end
RESOURCES 
include 'Resource.rc'

Subroutine blabla
.
.
.
end

I get the error : Unsuccessfull compilation of resource script

The line number of error is the last number of the subroutines Do I need to write something like : End RESOURCE

Klaus

30 Jan 2007 7:21 #1588

You could try moving 'RESOURCES' into the 'include' file, otherwise it is something that has to be fixed in the FTN95 proprocessor.

30 Jan 2007 10:13 #1589

I moved 'RESOURCES' into the 'include' file. Here is the a piece of the resource file :

RESOURCES 
///////////////////////////////////////////////////
//
// THIS FILE SHOULD NOT BE EDITED USING A TEXT
// EDITOR OR 3RD PARTY RESOURCE EDITOR, EXCEPT
// WHEN SPECIFICALLY INSTRUCTED BY I.S.S.
//
///////////////////////////////////////////////////
//
// Winteracter resource script. 
//
// Modified : 19/Dec/2006 13:08:58
//
///////////////////////////////////////////////////
//
// Include files
//
#include 'winparam.h'
#ifdef XLIB
#include 'filesel.rc'
#endif
#include 'dirsel.rc'
#include 'editor.rc'
 
///////////////////////////////////////////////////
//
// Parameter Definitions
//
#define IDD_DIALOG001                     101
#define IDF_RADIO1                       1001
#define IDF_RADIO2                       1002
#define IDF_RADIO3                       1003
#define IDF_GROUP1                       1004
#define IDF_BUTTON_help                  1005
#define IDF_PICTURE1                     1006
#define IDF_STRING1                      1007

Now I get lots of fortran compiler errors. Like : **Invalid character '/' at start of line **

It looks like it is trying to compile fortran code and not rescource code. Any more ideas what to do ? Klaus

30 Jan 2007 12:25 #1591

Klaus

'RESOURCES' is only designed to work for a simple subset of resource script commands (i.e. commands one would expect to need with ClearWin+).

For this script you will need to use the SRC compiler directly. At the moment the FTN95 plug-in for VS does not automatically compile resource scripts for you so you will have to do this from a command line or some kind of batch build within VS.

Once you have created a .obj file from your script (by running SRC) you can import this as a reference in your project.

13 Feb 2007 3:19 #1658

I have a *resource.obj * file now . I need to add this file as a reference file to my project ? correct ? When I go on Add references I can only choose .lib .dll and .exe files. How can I get the linker to take the *resource.obj * file ?

14 Feb 2007 9:16 #1659

One way is to put name of the object file in the Project Property Pages dialog under Linker Options->Linker Options->Extra linker options.

Try just giving the name resource.obj but put a copy of the file in each of the places where VS might look for the file (e.g. the Project folder).

My guess is that you will not need anything else but if it does not work take a look at the log file for the build process and compare this with the instructions for using SLINK from a command line.

Another way to get around the problem is to use both VS and Plato. Use VS to edit your resources and Plato to do the build. Each editor will detect changes to the shared files except that Plato (and possibly VS) will not know if the project file (Project.ftn95p) has changed externally so be careful when you change the project properties.

16 Feb 2007 8:41 #1681

Way No. one works. Number two I still have to try Thanks for the help Klaus

Please login to reply.