where can I find definition of project, solution & source?

where can I find definition of project, solution & source?

Rasoul K.的头像

I am confusing the meaning of project and solution.

I already have code and want to run it. I made a new FORTRAN project and opened new source f90 file and copy/pasted the code inside. After end of job I exited IVF.

Now I want to open that project again from inside the VS. source file doesn't show in source folder under soltion explorer.

Is it necessary to open the source file everytime I open the project?

Where can I find the structure of Project, Solution, File and other stuff related to run a FORTRAN code?

10 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
IanH的头像

In Visual Studio terminology (being incomplete for the sake of simplicity and brevity):

- a "Solution" is a container that holds zero or more projects, information about how the projects relate to each other and their high level configuration. Solutions are language independent.

- a "Project" is a set of source files (for a particular language) and a collection of sets of configuration options that build something.

In the simplest case, for a particular thing that you are working on you might have a single Solution that contains a single Fortran Project that contains a single Fortran source file. This might seem like overkill, but Visual Studio is designed for more complicated cases, where for a particular thing that is being worked on there might be many projects in the solution, each project containing many source files.

In order to do anything non-trivial in Visual Studio you must have a solution open. Consequently, if the first thing that you do when you open Visual Studio is to create a new project, then Visual Studio will automatically create a Solution that holds the project for you (for beginners this means that Projects and Solutions often get conflated). Later you could add additional projects to that solution.

Visual Studio allows you to create and edit files that are not part of any currently loaded project or solution (in which instance it is just behaving as a glorified editor). This is what happens if you create a new file via File > New > File... For Visual Studio to understand how to turn that file into something useful the file must be part of a project. You can add existing files to an existing project by right clicking on the project in the Solution explorer and selecting Add > Existing item. Equivalent entries exist under the Project main window menu. Perhaps this is applicable to your situation.

For future questions it might be useful to post screen shots of the Solution Explorer window.

Rasoul K.的头像

Quote:

IanH wrote:

In Visual Studio terminology (being incomplete for the sake of simplicity and brevity):

- a "Solution" is a container that holds zero or more projects, information about how the projects relate to each other and their high level configuration. Solutions are language independent.

- a "Project" is a set of source files (for a particular language) and a collection of sets of configuration options that build something.

In the simplest case, for a particular thing that you are working on you might have a single Solution that contains a single Fortran Project that contains a single Fortran source file. This might seem like overkill, but Visual Studio is designed for more complicated cases, where for a particular thing that is being worked on there might be many projects in the solution, each project containing many source files.

In order to do anything non-trivial in Visual Studio you must have a solution open. Consequently, if the first thing that you do when you open Visual Studio is to create a new project, then Visual Studio will automatically create a Solution that holds the project for you (for beginners this means that Projects and Solutions often get conflated). Later you could add additional projects to that solution.

Visual Studio allows you to create and edit files that are not part of any currently loaded project or solution (in which instance it is just behaving as a glorified editor). This is what happens if you create a new file via File > New > File... For Visual Studio to understand how to turn that file into something useful the file must be part of a project. You can add existing files to an existing project by right clicking on the project in the Solution explorer and selecting Add > Existing item. Equivalent entries exist under the Project main window menu. Perhaps this is applicable to your situation.

For future questions it might be useful to post screen shots of the Solution Explorer window.

Dear IanH

Thank you very much for putting your time and knowledge. Your notes are very valuable for me and I couldn't understand Visual Studio environment without your explanation. And I think no help menu contain this easy-to-understand notes. Thanks a lot.

Back to my project, I would like to have your comments
1-My code
It has 6300 lines (with comments). It uses 57 subroutines. Some of subroutines are used in Do-loops. The structure of the code is not that much complicated but very long with 260 parameters. So it is not easy to follow.
At present all of the main program and subroutines are written in a single file consequently.
Do you recommend to utilize the benefit of projects inside a solution? In general would it expedite the running time or efficiency?
At present my configuration is what you named it over killer. I have single solution with single project and a single source file.

2- Source file
You told when I open a new file and write or copy/paste my code inside, still it is not part of the project and I have to add the source file into project by right clicking and 'add to project'. Have I understand this correctly. Until now I haven't done this and perhaps this is the reason why in new openings of a project I can't find my source file.
I will send screenshot of solution explorer after amnedment.

Again thanks a lot.
Rasoul Khoshravan

Rasoul K.的头像

Quote:

IanH wrote:

For Visual Studio to understand how to turn that file into something useful the file must be part of a project. You can add existing files to an existing project by right clicking on the project in the Solution explorer and selecting Add > Existing item. Equivalent entries exist under the Project main window menu. Perhaps this is applicable to your situation.

For future questions it might be useful to post screen shots of the Solution Explorer window.

I copied/pasted the code from a text file into new file inside the project1. I accepted its default name as console1.f90. I right clicked the project to add existing item. It open up a box for selection of the file. Shall I select console1.f90?
If I don't add and simple save from File menu, would it ad the source file into Project1?

Rasoul K.的头像

For some reason attachment doesn't show in main reply. I have to resend it always.

附件: 

附件尺寸
下载 solutionexplorerconfig.jpg162.67 KB
IanH的头像

Your screenshot shows a single solution (named Console1) holding a single Fortran project (also named Console1), with a single source file called Console1.for. If the Console1.for file shown in the main editor window is the same as that source file in the project (for example, that is the editor window that is displayed when you double click on the Console1.for source file in the Solution Explorer and not some random file called Console1.for from elsewhere on your system) then it looks like things are set up correctly.

Based on messages in the output window it looks like you have sucessfully compiled and run the program.

Rasoul K.的头像

Quote:

IanH wrote:

Your screenshot shows a single solution (named Console1) holding a single Fortran project (also named Console1), with a single source file called Console1.for. If the Console1.for file shown in the main editor window is the same as that source file in the project (for example, that is the editor window that is displayed when you double click on the Console1.for source file in the Solution Explorer and not some random file called Console1.for from elsewhere on your system) then it looks like things are set up correctly.

Based on messages in the output window it looks like you have sucessfully compiled and run the program.

Yes what is visible in the main editor window, is part of my source file, which I copied into console1.for file and debug it. I run the program and got the output.
I think I have passed the first step which was installing the IVF. It took more than 2 weeks to pass this step. Now I have the main step which is 3 amendments I have to make into original code and I have two weeks time. I think from now on my questions will be how to utilize FORTRAN commands in order to accomplish certain tasks.
I will rely on this Forums knowledge share and support for the 2nd step as well.
Thanks IanH for your support and valuable insights.

Rasoul K.的头像

How can I create different source file inside one project.
I have one main project. I want to open few source files for test of some commands related to my main project.
Is it possible?

Also isn't it possible to open two or more projects (or solutions) simultaneously?

jimdempseyatthecove的头像

>>How can I create different source file inside one project.

In the Visual Studio workspace, one of the sub-windows has a tab labled "Solution Explorer". If you cannot find it then click on View | Solution Explorer.
The Solution Explorer operates similar to a file browser tree.
Locate the project, expand the project (click on thing looks like arrow), then you may see "folders" with names "Header Files", "Resource Files", "Source Files".

When adding a source file, right click on "folder" "Source Files", then select Add and you get choices "New Item", "Existing Item", "New Folder".
If you have an existing source file, select "Existing Item" and then browse for the file (copy it to your preferred location first).
If you want to write a new file then select "New Item".
You could also use "New Folder" to create a new collection.
*** Note, the "folders" in this (VS) browse tree are NOT folders in the system file structure. These are known to the VS Project (html file).

Jim Dempsey

www.quickthreadprogramming.com
Rasoul K.的头像

[quote=jimdempseyatthecoveWhen adding a source file, right click on "folder" "Source Files", then select Add and you get choices "New Item", "Existing Item", "New Folder".
If you have an existing source file, select "Existing Item" and then browse for the file (copy it to your preferred location first).
If you want to write a new file then select "New Item".
You could also use "New Folder" to create a new collection.
*** Note, the "folders" in this (VS) browse tree are NOT folders in the system file structure. These are known to the VS Project (html file).

Jim Dempsey

[/quote]

Dear Jim
Thanks a lot. I will try that.

登陆并发表评论。