Page 1 of 1

link step fails with "Access denied" [solved]

Posted: Tue Sep 20, 2011 11:04 pm
by gopalvenu
Running CodeLite+mingw4.4.1

Everything running fine on one PC - I moved my projects to another PC, and installed the same toolchain there, but when building the executable, the link step fails somewhere in the makefile snippet below

$(OutputFile): $(IntermediateDirectory)/.d ..\..\workspaces\vpg-default\.build-debug\cfc $(Objects)
@$(MakeDirCommand) $(@D) <---- succeeds
@echo "" > $(IntermediateDirectory)/.d
@echo $(Objects) > $(ObjectsFileList)
$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) <---- never gets here

Fails with the error

mingw32-make.exe[1]: Entering directory .........
Access is denied.
minfw32-make.exe[1]: *** [outputfile] Error 1
mingw32-make.exe: *** [All] Error 2

I checked all the file/directory permisions on both the toolchain and my source code and they are fine (note that it even created the output directory successfully). Problem may be in the two @echo lines..

Prior to getting stuck here, it compiles all the .cpp files and before that it compiles and builds a static library successfully.
The problem occurs only when lining to create an executable. The g++ -o outputfile ... log line never shows up

Re: link step fails with "Access denied" [solved]

Posted: Wed Sep 21, 2011 2:09 am
by gopalvenu
Solved the problem:
- I deleted the project from the workspace (without deleting the files)
- removed any intermediate directories (such as <projectname>./Debug)
- remove the <projectname>/project.mk and the <projectname>/project.txt files in
the top level directory (kept the <projectname>.project file)
- readded the project back into the workspace (using the <projectname>.project file)

Everything works fine now.

Re: link step fails with "Access denied" [solved]

Posted: Wed Sep 04, 2013 7:14 pm
by spaces
Just ran into this today while moving a project from winXP to win7. To clear this up: you need to remove ./Release and ./Debug immediate directories.

I think the "Build/Rebuil Project" should delete these dirs.