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

Error: Object reference not set to an instance of an object

Liaqat
Beginner
1,529 Views

Yesterday Steve identified and solved the problemswith installing Intel Visual Fortran 11.1. Now I can re-compile and re-built existing projects that I had created previously.  However, I cannot create new projects using GUI of Microsoft Visual Studio 2008. "File -> New ->Project" gives me "New Project Window", as shown in Page 1 of the enclosure. When I select “Console Application” as Project type and “Main Program” or “Empty Project” as Template, I get the following error message: “Object reference not set to an instance of an object”, as shown in Page 2. Please note that I am using Intel Fortran 11.1 “with Microsoft Visual Studio 2008 Shell and Libraries”. I did not install Microsoft Visual Studio 2008 independently. So I am assuming that the object reference should be provided by the Intel Visual Fortran 11.1 installer (w_cprof_p_11.1.072). I will appreciate suggestions and instructions for fixing the problem with the compiler. Thank you very much.

0 Kudos
11 Replies
SergeyKostrov
Valued Contributor II
1,529 Views
>>...When I select “Console Application” as Project type and “Main Program” or “Empty Project” as Template, I get the following >>error message: “Object reference not set to an instance of an object”, as shown in Page 2. Please note that I am using >>Intel Fortran 11.1 “with Microsoft Visual Studio 2008 Shell and Libraries”. I did not install Microsoft Visual Studio 2008 >>independently. So I am assuming that the object reference should be provided by the Intel Visual Fortran 11.1 >>installer (w_cprof_p_11.1.072). .. It looks like a problem with a Wizard for the Console template project and this is because you did not install Microsoft Visual Studio 2008 independently. I don't think it is directly related to version 11 of Intel Visual Fortran compiler.
0 Kudos
Liaqat
Beginner
1,529 Views

Correct me if I am wrong.

My understanding is that I don’t need to have Visual Studio installed on my computer to use Intel Visual Fortran 11.1. The download website of Fortran 11.1 installer (w_cprof_p_11.1.072; see first enclosed document) states that it comes with Microsoft Visual Studio 2008 Shell and Libraries and integration to Microsoft visual development environment. If I had Microsoft Visual Studio 2008 installed (independently) on my computer I would be using a different Fortran 11.1 installer. Please see the software download site (for customers with Visual Studio 2008 installed).

Information available at user forum states that (see second enclosure): a) “The Microsoft Visual Studio 2008 Shell and Libraries (VS08 shell) is an integrated development environment (IDE) that is bundled with the Intel Visual Fortran Compiler Professional  Edition 1 1 for uers with Commercial or Academic licenses” and b) “This Fortran-only development environment can be used by customers who do NOT have an existing prerequisite Microsoft development environment”. I do have Commercial license and I do not have any need other than using Fortran. I will appreciate explanations of these statements.

Based on my understanding I do not need to have Visual Studio 2008 installed to use Intel Fortran 11.1. If that is the case, the only software I am installing is Intel Visual Fortran 11.1 and I should us able to use it to create new projects also.So, pleasesuggest me how it fix the problem with installed Visual Fortran 11.1.

0 Kudos
Steven_L_Intel1
Employee
1,529 Views

Evan, I've seen this error in some cases before, but not quite like you're seeing it. This is entirely within the VS integration provided by Intel Fortran. I suspect it is because I incompletely removed the newer version.

Please uninstall Fortran. (Leave the Shell.) Delete the folder C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\IntelFortran Then reinstall Fortran.

0 Kudos
SergeyKostrov
Valued Contributor II
1,529 Views
>>... When I select “Console Application” as Project type and “Main Program” or “Empty Project” as Template... Evan, I could create a couple of empty Fortran projects with Visual Studio 2008 Professional Edition or / and Shell Edition. Let me know if it will help you to proceed with programming. Also, did you search on MSDN for 'Object reference not set to an instance of an object' error? There are lots of posts and many of them are related to issues with Visual Studios.
0 Kudos
Liaqat
Beginner
1,529 Views

Steve: Thanks for the suggestion.

Followed the instructions: a) unstalled Fortran 2011 and Fortran 11.1,  b) deleted "IntelFortran", and c) installed only Fortran 11.1. Got the same error message. So did (a) but only for Fortran 11.1,  (b), and (c) for Fortran 2011 and Fortran 11.1 in the sequence. Now the error message is different: "Attempted to read or  write protected memory. This is often an indication that other memory is currupt." Restarting the computer did not help.

Further, default definitions of Fortran File Extensions (source and header) under "Tool->Option->Intel Visual Fortran->General" are not defined. "Compile" option under "Build" in absent, but other options (Built, Rebuilt, etc) are available. 

While looking at folders created by Intel Fortran, I found the following folder: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Program Files (x86)\Microsoft Visual Studio 9.0\Intel Fortran".  There are several subfolders, including "Templates". Should this folder and subfolders be present at all?

Appreciate you help.

 

0 Kudos
Steven_L_Intel1
Employee
1,529 Views

Those folders should be present after an installation. I think you did a bit more than was requested.

So let's try this.  Uninstall all versions of Fortran. Leave VS Shell. Delete the Intel Fortran folder under Visual Studio 9.0 and Visual Studio 9.0\Common7\IDE\ProjectTemplates\IntelFortran . Reinstall 11.1 only.

0 Kudos
Liaqat
Beginner
1,529 Views

Steve: My first step yesterday was exactly what you are instructing now: a) unstall all versions of Fortran, b) delete the IntelFortran folder, and c) reinstall Fortran 11.1. Since it did not fix the problem and I was getting the same error message, I did the bit more part. I will try is again today and let you know. Thanks.

0 Kudos
Liaqat
Beginner
1,529 Views

Steve:

Just to make sure that I am following you instructions correctly, I am listing what I did:

a) uninstalled both the versions of Visual Fortran (see Page 1 of enclosure; Fortran compilers are not listed any more)

b) deleted “C:\Program Files (x86)\Microsoft Visual Studio 9.0\Intel Fortran” (see Page 2; the indicated folder is not listed)

c) deleted “C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\IntelFortran ” (Page 3; again the indicated folder is not listed)

d) installed Fortran 11.1 only (Page 4). Please note “Intel_Composer_XE” is still present. The “General” and “Set Directory List” tabs have the same data as for “Intel(R) Visual Fortran, but “Custom File Extensions” tab list “An error has occurred loading this property page”. I am assuming these are fine as I did not install Fortran 2011.

As suggested I did not do anything to VS Shell.

After these steps, I can compile and built code in existing project (Page 5).

“File->New-> Project-> Console Application and Main Program” gives the error message shown in Page 6, object reference error, as indicated my posting on 04/16/2013. 

Please let me know if I failed to follow the instructions correctly. Otherwise, what do I do next. Thanks.

0 Kudos
Steven_L_Intel1
Employee
1,529 Views

Can we do another GoToMeeting tomorrow sometime? I'm open all day. Let me know a good tme and I'll send you an invite.

0 Kudos
Steven_L_Intel1
Employee
1,529 Views

Problem solved. The issue here was caused by having previously installed the Professional Edition of VS2008 as a trial during evaluation of Fortran - perfectly reasonable. But uninstalling the trial VS didn't remove all of its files, and the leftover files confused the Fortran installer, leaving a mix of shell and retail files that prevented some things from working.

The solution was to uninstall everything, delete the Visual Studio 9.0 directory entirely, then reinstall.

0 Kudos
Liaqat
Beginner
1,529 Views

Steve: Thanks for you time and help. I appreciate you insight to the software. It took quite a bit of you time from you daily schedule.

0 Kudos
Reply