Search code examples
gcccygwineclipse-cdtscons

Access Denied error while using Sconsolidator with Cygwin in Eclipse CDT


I am getting a "Access Denied" error while building my program in Eclipse CDT (Juno) targeting cygwin gcc. Here is the steps I followed.

  1. Installed Python (2.7)
  2. Installed Scons
  3. Installed SConsolidator in eclipse CDT (latest one)
  4. Create a new project using "Scons executable project" wizard

Now while scons is trying to build the project I am getting following error

=== Running SCons at 6/23/13 11:05 PM ====
Command line: C:\Python\Scripts\scons.bat -u --jobs=16
scons: Reading SConscript files ...
scons: done reading SConscript files.

scons: warning: you do not seem to have the pywin32 extensions installed;
    parallel (-j) builds may not work reliably with open Python files.
scons: Building targets ...
File "C:\Python\Scripts\scons.py", line 192, in <module>
scons: building associated VariantDir targets: Debug
gcc -o Debug\demo.exe
Access is denied.
scons: *** [Debug\demo.exe] Error 1
scons: building terminated because of errors.
Duration 1201 ms.
  1. Thought as there is no source file, that's why no executable was there and thus getting Access denied.
  2. Added on demo.c file with simple main method in it. Saved it
  3. Getting the same error as below

=== Running SCons at 6/23/13 11:19 PM ==== Command line: C:\Python\Scripts\scons.bat -u --jobs=16 scons: Reading SConscript files ... scons: done reading SConscript files.

scons: warning: you do not seem to have the pywin32 extensions installed;
    parallel (-j) builds may not work reliably with open Python files.
scons: Building targets ...
File "C:\Python\Scripts\scons.py", line 192, in <module>
scons: building associated VariantDir targets: Debug
gcc -o Debug\demo.o -c -O0 -g3 -Wall -c -fmessage-length=0 demo.c
Access is denied.
scons: *** [Debug\demo.o] Error 1
scons: building terminated because of errors.
Duration 1306 ms.

What am I doing wrong? It suppose to work. Can anybody please help me setting it up?


Solution

  • The error "Access denied" is somewhat misleading in this specific case because the problem is that SConsolidator uses g++ which is a symlink in Cygwin and can only be called within the Cygwin terminal. SConsolidator should instead use the executable the symlink points to (which is either g++-3 or g++-4 depending on which version of GCC you have installed with Cygwin) as the SCons toolchain in its managed build mode. I created a ticket for this problem from your forum post (see http://sconsolidator.com/issues/43).

    Please note that you're using SConsolidator's managed mode. This is the mode to get started with SCons and is not meant to be used with more complex projects and builds. If this is the case with your project, please use SConsolidator's "self-provided build" mode (see http://sconsolidator.com/projects/sconsolidator/wiki/Getting_Started for more information).

    Disclaimer: I'm the author of SConsolidator.