icl: error can't open file two_exits.obj for write.

icl: error can't open file two_exits.obj for write.

Hi, I'm very new to the Vectorization with Intel C++ Compiler

I read some articles about Vectorization stuff, and I'm wondering how to do the settings

I tried the command line mode, I don't know why it doesn't work for me

It always say that " error: can't open file two_exits.obj for write.
compilation aborted for two_exits.cpp"

any idea?

thanks in advance!

16 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Files and folders can have READ persmissions where you can only access
or view their contents but not be able to modify them. They can also
have both READ and WRITE permission where you can modify them. The
message indicates that the Visual Studio is undable to create the object file for two_exists.cpp. The reason as indicated, is the file cannot be written. This could be because:

1. the folder your source files are in has READ persmission.
2. you may be using Windows 7 and you are trying to write to a folder that was created by another user
3. you may be using windows 7 and the Visual Studio instance you are using does not have user right to modify files

You can modify file/folder READ/WRITE attributes by closing Visual Studio and making sure no other application is currently accessing the folder or files in that folder, and then right clicking the folder name and clicking the "Read-only" check box to deselect it (e.g. if it already has a check mark in it).

If you are using Windows 7, you could close Visual Studio and reopen it by right clicking on it's icon and selecting "Run as administrator" to have permissions to modify files.

--mark

Hi,

I used to run successfully ifort 11.1.51 64-bit on windows 7 in command line mode. Yesterday, for the first time, I got the message: Can't open a.obj for write, where 'a' is the name of the source code. User account is admin. Folder has an inherited read-only, which I can't change. Please advise what to do.

Best regards

Prof. Dr. Said Elnoshokaty

>>...Can't open a.obj for write, where 'a' is the name of the source code. User account is admin. Folder has
>>an inherited read-only, which I can't change...

You need read and write access rights for the folder. Any C++ compiler will fail if it can not write to some output file.

Hi,

I'm the admin, who is supposed to have read-and-write access rights for a-folder and other folders as well. In the same time, a-folder allows admins full control over sub-folders and files. I got the impression that there might be an update to windows 7 which took place to deny write-access right to ifort for a-folder and other folders. Or, a change in ifort took place which denied its write-access right.

Best regards.

Prof. Dr. Said Elnoshokaty

Hi,

Thanks. I have an admin account and a-folder allows admin full control. I had been using ifort successfully before I received the error message. I got the feeling that there might be an update to win 7 which denied write-access right to ifort, or, ifort has been changed to deny its write-access right. I have nothing to do regarding these two causes. Although a-folder has read-only set (no way to unset), all a-folder files have read-only unset.

Best regards

Prof. Dr. Said Elnoshokaty

Hi,

To check whether a change in ifort has denied its write-access right, I un-install ifort version 11.1.51 and install version 13.1 (trial version)instead. The same error message: 'Can't open a.obj for write' is reported. This will leave only one cause: there is a win 7 update which has denied ifort write-access right. This problem is similar to the one at the top of this forum page, except that ifort is used through command-line mode, rather than visual studio.

I hope I'm not all alone in discussing this problem.

Best regards.

Prof. Dr. Said Elnoshokaty

>>...The same error message: 'Can't open a.obj for write' is reported...

Dear Prof. Dr. Said, I wonder if you could post the source code or a test case that causes that problem for review? Thanks in advance.

Dear Sir,

The problem is not in a new program which caused the error message to appear. The problem is in old program which used to compile successfully and suddenly it compiles unsuccessfully.This program is a message-passing-interface program, which if posted here will attract your attention far from real causes. Instead I here post a.f90, which is a test program containing the following 4 statements: program, integer i, i=1, end.

Best regards.

Prof. Dr. Said Elnoshokaty

 

Prof. Dr. Said,

>>The problem is in old program which used to compile successfully and suddenly it compiles unsuccessfully.

If this file (actually the development folder) were really old, you may have archived the folder onto CD. CD is a read-only device. When copying the files back to your computer, sometimes, the files come off the CD with the Read-Only attribute set. Have your sysadmin examine the attributes of this file, let you know the state, then if they have Read-Only, have the sysadmin remove the Read-Only flag.

Althoug a folder can have a Read-Only flag, files too within a folder can individually have Read-Only flags.

Jim Dempsey

www.quickthreadprogramming.com

>>... Instead I here post a.f90, which is a test program containing the following 4 statements...

I don't see any attachments in your last post.

Dear Jim,

Dear Sergey,

Thank you for help. Read-only attribute is unset for all files written to a-folder. What is strange is that when a.f90 is compiled using 'c' option (create object file only), a.obj is created with read-only attribute unset. It seems the Linker has a problem. Whether the problem is write access right or another problem, I don't know.  Why now and not two weeks ago, I don't know either. Are win 7 updates caused this problem, also I don't know.

It does not need an attachment to show a.f90. It contains the 4 fortran statements displayed in my earlier comment.

 The command line says: ifort -o "d:\a\a" "d:\a\a.f90"

Best regards.

Prof. Dr. Said Elnoshokaty

 

 

a.f90 is using ifort

What is your command line to compile two_exits.cpp (include any CD that may set the current directory)

Jim Dempsey

www.quickthreadprogramming.com

Dear Jim,

"two_exits.cpp" is not my program. It is of another community member. I don't use CDs for archiving. I use flash memory instead. 

Best regards.

Prof. Dr. Said Elnoshokaty

We have that discussion for 8th day already and why wouldn't you upload two_exits.cpp?

Dear Sergey,

Please refer to my previous comments, where I already included the 4-statement test program. Attached herewith find another copy.

Best regards.

Prof. Dr. Said Elnoshokaty

Attachments: 

AttachmentSize
Download program-a.doc25.5 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today