Author Topic: windows 7 "permission denied" problem  (Read 104231 times)

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #15 on: September 02, 2011, 06:38:26 pm »
ok case is not closed i am getting those error again i don't know why :shock: :shock: :shock:.

it was working fine tomorrow and now i am back where i was before :x :x  :x


zabzonk

  • Guest
Re: windows 7 "permission denied" problem
« Reply #16 on: September 02, 2011, 07:14:30 pm »
> ok case is not closed i am getting those error again

You still haven't said whether or not  you get the same errors when you compile from the command line. Until you clarify this, I can't see you getting much help here.

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #17 on: September 03, 2011, 05:50:57 pm »
ok i never tried compiling using command line so can any one tell me how to do it (small syntax example will be fine).



Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: windows 7 "permission denied" problem
« Reply #18 on: September 03, 2011, 06:31:36 pm »
First ensure mingw\bin is in your path
path C:\mingw\bin;%path%

Compile and link in single step
g++ myFile1.cpp myFile2.cpp -o outputExecutable

Compile, then link
g++ -c myFile1.cpp myFile2.cpp
g++ myFile1.o myFile2.o -o outputExecutable


Use flags
g++ -Wall -DmyDefine -IC:\my\include\path -c myFile1.cpp myFile2.cpp
g++ -LC:\my\library\path -lmyLibrary myFile1.o myFile2.o -o outputExecutable


To see exactly how your program is built, goto Settings->Compiler and debugger...->Build options (tab) and check Save build log and Always output the full command line.  Code::Blocks will now tell you exactly what it is sending the compiler (it might say mingw32-g++.exe, but that is essentially the same as g++).

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #19 on: September 04, 2011, 05:44:09 pm »
so i tried to compile my file main.cpp which is on my G drive i typed this on command line.

Code: [Select]
G:\g++ main.cpp -o main.exe
but there was no output file on the drive there was only one file main.cpp and nothing else on my G drive.

am i doing something wrong?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: windows 7 "permission denied" problem
« Reply #20 on: September 04, 2011, 06:26:05 pm »
Were there any warnings in the command prompt window?

Code: [Select]
'g++' is not recognized as an internal or external command,
operable program or batch file.
Means that your compiler is not on the path.
First ensure mingw\bin is in your path
path C:\mingw\bin;%path%
I forgot to mention that C:\mingw\bin must (of course) point to your compiler's installation directory; on my computer, for example, it is C:\libraries\mingw, so I would type
path C:\libraries\mingw\bin;%path%

Code: [Select]
g++: main.cpp: No such file or directory
Means that you are in the wrong folder; type
G:
to switch to the G: drive, and
cd \
to ensure you are in the root of the drive.  Then your type
g++ main.cpp -o main.exe
to compile.  The resulting line should look like
Code: [Select]
G:\>g++ main.cpp -o main.exe
If there are no errors, it will produce main.exe (but it will not show any messages).

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #21 on: September 04, 2011, 07:57:24 pm »
on my computer mingw is installed on "C:\Program files\Codeblocks\Mingw"
i included it on my path successfully ( i know about DOS commands a bit).

(i found no difference on use of g++ of linux terminal and mingw's g++ btw i am not too familiar with g++)

there was no error using g++ it was just showing tons of messages but no output windows executable file or object file.

i am feeling that permission denied thing is mingw's problem because when i get the access denied error it show something is wrong about ld.exe which is a mingw file(i found that on mingw directory.)




 
« Last Edit: September 04, 2011, 08:08:16 pm by websnake »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: windows 7 "permission denied" problem
« Reply #22 on: September 04, 2011, 08:18:12 pm »
there was no error using g++ it was just showing tons of messages but no output windows executable file or object file.
If you compile on the commandline, and the file does not have any errors, there should not be any messages.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: windows 7 "permission denied" problem
« Reply #23 on: September 04, 2011, 08:28:52 pm »
If there is a mingw problem, I am not sure what can be done (except perhaps install a new version if you have not - like the unofficial TDM).  One other thing I can think of is that one of your project's settings may be wrong.
(ld.exe is the linker back-end that g++ calls.)

Your could post the command-line log here.

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #24 on: September 04, 2011, 09:21:04 pm »
so now i found there was a output file but it just disappered in few sec windows was not giving me any access to that file.

http://www.youtube.com/watch?v=rTJdvZOaOBY


thats why i can't see main.exe on that drive so finally it looks like it's a Mingw problem so anyone have any suggestions for that (any mingw
alternatives or anything else which will take place of mingw or a solution of the problem i am facing).

if i have wrong compiler and debugger settings then how can i resolve it?
« Last Edit: September 04, 2011, 09:33:50 pm by websnake »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: windows 7 "permission denied" problem
« Reply #25 on: September 04, 2011, 10:41:11 pm »
It seems you are using cygwin, not mingw?!  Not only that, but if I am reading correctly, it is a six year old version of gcc.  Since you did find the mingw folder in your Code::Blocks installation, I assume that it has been installed as well, but that cygwin resides somewhere else on your hard-drive (possibly the root of the C: drive), and is interfering.  I would highly recommend purging your computer of all compilers, then installing the TDM build mingw (the official version should be fine as well if you want).

To get a log of those errors, you can enter
g++ main.cpp -o main.exe > log.txt

Also, it is possible that some previous installation has left something in your path environment.  Look at/post the results of
path > pathLog.txt

I think a rogue cygwin installation is the cause of your problems.  (If I remember correctly, cygwin has some problems about requiring to be run as administrator, so that could explain the "permission denied" problems.)

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #26 on: September 05, 2011, 08:24:16 pm »
so thats the problem i installed cygwin for PSP development.

ok i can remove it i don't use it much now so how can i completely uninstall cygwin(maybe i should use google for this question).
if any one can tell me where i can find a tutorial about uninstalling it that would be really help full.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513

Offline websnake

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: windows 7 "permission denied" problem
« Reply #28 on: September 06, 2011, 05:26:46 am »
thanks.
« Last Edit: September 06, 2011, 05:50:25 am by websnake »

Offline timojaask

  • Single posting newcomer
  • *
  • Posts: 4
Re: windows 7 "permission denied" problem
« Reply #29 on: November 01, 2011, 09:12:14 am »
I am having exactly the same problem, but it cannot be C::B or mingw, because I have the same problem in C::B, in Dev-C++ and in SharpDevelop (msbuild.exe for C# compiling). Deleting executable by hand from Explorer works when compiling in C#, but executables compiled with mingw cannot be deleted even manually. It says I need Administrator permissions, but I am the administrator. Executables compiled with mingw disappear after a couple of minutes after I try to delete them. I am running Windows 7 x64.

The problem occurs even if I don't run the compiled executable.
Turning off AV doesn't help either.
I was trying to search for the name of the executable in Process Explorer, but it doesn't return any results.


This is among the most annoying things I have had in my programming experience. Working on a project 8 hours / day, while compiler fails to write the executable is so damn frustrating.