Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29334 Discussions

V.Studio: New project from existing code?

Mike_Prager
Beginner
1,919 Views
After many yrs of using my own editor, I thought I would evaluate Visual Studio. When I tried "new project from existing code", I got an error message about "Class not registered" and some gibberish in hex.

How can one start a project from existing code?

Thanks! Mike
0 Kudos
8 Replies
abhimodak
New Contributor I
1,919 Views
Hi Mike

Try following:

(1) After you start the visual studio, click on File --> New --> Project (or just the new project icon on the toolbar; usually it would be just below the "File")

(2) Abovw will open the "new project" window. For Intel Fortran, scroll down a bit in the left panel of project type. Expand (click on the + sign) and select the "console application".

(3) Enter the name and location of the project.

(4) In the "Templates" pane, select "empty project". And then click ok.

(5) Now a new project will be created. On the right hand side of the GUI, there will be solution explorer. (If not there it should be accessible through the toolbar or through the "View" dropdown menu.

(6) Under the project name in the solution explorer, there are three folders. First one is "source". Right click and select "Add exisiting item". If you click that you will get a browse dialogue with which you can browse to your source file.

The above procedure will in fact create a solution AND a project. You can add more than one projects to a solution. Hope this helps.

Abhi
0 Kudos
tropfen
New Contributor I
1,919 Views
Hello,

looking at the one answer by now, i would like to add a additional question.

Is it possible to start the visual studio by opening a fortran file and then say make a project from it? That is something that was possible in the old days of CVF.

Frank
0 Kudos
Mike_Prager
Beginner
1,919 Views
Quoting - abhimodak
Hi Mike

Try following:
...
Hope this helps.

Abhi

Abhi,

Thank you! Yes, I think it will help. VS has its own interface and its own vocabulary -- can you (or anyone reading this) recommend a good online introduction to VS for the Intel Fortran user?

Mike

0 Kudos
Steven_L_Intel1
Employee
1,919 Views
Mike,

Welcome to the forum and Intel Visual Fortran. We prepared a short tutorial video here that you may find of interest.

The "New project from existing code" VS feature does not work for Fortran, sorry. It also seems that you are coming from Compaq Visual Fortran. If so, please read this as well.

If you have further questions, just ask!
0 Kudos
Mike_Prager
Beginner
1,919 Views
Mike,

Welcome to the forum and Intel Visual Fortran. We prepared a short tutorial video here that you may find of interest.

The "New project from existing code" VS feature does not work for Fortran, sorry. It also seems that you are coming from Compaq Visual Fortran. If so, please read this as well.

Steve,

Thanks for your answer, and thanks for the welcome. I'm sure I will find the video tutorial helpful (though I will have to put off watching it -- and evaluating Visual Studio) for a while because of deadlines.

Yes, we were licensed for DVF, but I used mainly Lahey until the last few years, when I've been using Intel Fortran. I also use g95 for checking. I program with a separate editor (SlickEdit), which has compiler and project support, and make utility (Opus make).

SlickEdit is an excellent editor, though its Fortran support is not as good as for C++ of Java (which I don't use). I have used it for almost 20 yr, and it's completely customizable.

My potential interest in VS is for two features that I think it has. (Am I right?)

1. Argument prompting and/or context-sensitive help on keywords.
2. Automatic construction of makefiles.

Of the two, #2 is more important, as manual makefiles are becoming tedious with Fortran's module facilities. However, a drawback to using VS would be lack of portability to other platforms, so I am open to other solutions, as well.

I had a look at cmake, which I've head good things about, but I was baffled. It has typical Unix-style documentation, which starts by listing 1000 options in alphabetical order, each defined in terms of the others or with words used in some highly specialized, but not transparent, ways (unless you already know how to use it, of course). I didn't find an overview in plain English that helped the Fortran user. My impression was that cmake doesn't replace make, but supplements it in some way.

Perhaps I should look for other make-makefile utilities.

Anyway, best wishes of the season!

Mike

0 Kudos
Steven_L_Intel1
Employee
1,919 Views
Mike,

Microsoft dropped automatic makefile creation in VS 2002, so that isn't there. We do have context-sensitive help (press F1 while positioned on a keyword), but not automatic prompting for syntax.

Is there a reason you don't want to use Visual Studio's build facility? You can start a build of a "solution" from the command line if you wish using "devenv".
0 Kudos
Mike_Prager
Beginner
1,919 Views
Is there a reason you don't want to use Visual Studio's build facility? You can start a build of a "solution" from the command line if you wish using "devenv".

Hi Steve,

Thanks for your comments and tips.

The subtext of my original post was that I'd like to evaluate VS for possible use. There are a couple of reasons why I'm not using it right now and the switch isn't a no-brainer.

First, never having used VS, I'd have to climb a learning curve. Last time I opened VS, I found it pretty opaque. (I suppose that if you use it every day, that may be hard to understand, but the jargon alone is a pain, and it was not obvious where to find definitions of, e.g., "projects" and "solutions" as VS defines them.) My present setup (programming editor and make) works pretty well, especially after 20 yr of customization.

The second reason is that I sometimes compile on other platforms, and using VS is not portable (compared to 'make', which is almost portable).

Early next year, I'll review the introductory material suggested here and decide (again) whether learning VS might be worth the effort. Anything you (or others) can say to put the costs and benefits in perspective will be a big help. Other references to VS tutorials relevant to Fortran will also be helpful.

All the best,
Mike
0 Kudos
Steven_L_Intel1
Employee
1,919 Views
Mike,

Most of our customers like Visual Studio, but some prefer the command line environment. That's fine, we support both, but what we don't have is an automatic makefile generator. Do note that for debugging, you must use Visual Studio, but you don't have to build the application there.

I suggest you view the tutorial I linked to earlier and read "Getting Started with the Intel Visual Fortran Compiler", part of the on-disk documentation. Open Visual Studio, create a Console application with sample code, build it and run it. Get a feel for the environment. You can read more detail under "Building Applications" in the documentation.
0 Kudos
Reply