Author Topic: Getting SE 2009 to work with Cygwin...  (Read 11692 times)

achen

  • Guest
Getting SE 2009 to work with Cygwin...
« on: June 17, 2010, 11:16:08 pm »
I have SlickEdit Version 14.0.2.2 installed on a XP machine along with Cygwin (gcc 4.3.4). I followed the procedure described in this old thread and created a "hello world" project. When I try to compile the code, the Build screen says:
Quote
C:\junk\test>"C:\Program Files\SlickEditV14.0.2\win\vsbuild" -signal 9009 -command gcc -c    -g -o "Debug/test.o"  "C:/junk/test/test.c"
VSLICKERRORPATH="C:\junk\test"
gcc -c -g -o Debug/test.o C:/junk/test/test.c
vsbuild: File not found (gcc)
What does "vsbuild: File not found(gcc)" mean? What am I missing here?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #1 on: June 18, 2010, 01:13:23 pm »
Either cygwin\bin is not in your PATH environment variable or there is no gcc.exe.  Cygwin recently started packaging gcc-4.exe and gcc-3.exe to handle separate GCC versions.  You'll have to specify which gcc you want to use in the Compiler and Link command in GNU C Options properties for your project.

The next point release for SlickEdit 2010 will have additional checks for Cygwin installs to look for the separate executables.

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #2 on: June 18, 2010, 05:13:38 pm »
Thanks for the reply. After pointing the Compiler to c:\cygwin\bin\gcc-4.exe, I was able to get through the compilation stage. Here is the output screen for my "hello world" program:
Quote
C: & cd C:\junk\test

C:\junk\test>echo VSLICKERRORPATH="C:\junk\test"
VSLICKERRORPATH="C:\junk\test"

C:\junk\test>"C:\PROGRA~1\SLICKE~1.2\win\vsbuild" "C:\junk\test\test.vpw" "C:\junk\test\test.vpj" -t build -signal 9009
---------- Build Project: 'test.vpj' - 'Debug' ---------- VSLICKERRORPATH="C:\junk\test"
test.c
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.4/configure --srcdir=/gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.4 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --with-slibdir=/usr/bin --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind AS=/opt/gcc-tools/bin/as.exe AS_FOR_TARGET=/opt/gcc-tools/bin/as.exe LD=/opt/gcc-tools/bin/ld.exe LD_FOR_TARGET=/opt/gcc-tools/bin/ld.exe --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)
COLLECT_GCC_OPTIONS='-c' '-v' '-g' '-o' 'C:/junk/test/Debug/test.o' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1.exe -quiet -v -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/lib/../../include/w32api test.c -quiet -dumpbase test.c -mtune=generic -march=i686 -auxbase-strip C:/junk/test/Debug/test.o -g -version -o /cygdrive/c/DOCUME~1/achen/LOCALS~1/Temp/ccaMT0x1.s
/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
*** Errors occurred during this build ***
Does this mean that cc1.exe can't locate where stdio library is?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #3 on: June 18, 2010, 06:40:01 pm »
Do things build normally if you try to build on a command-line?

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #4 on: June 18, 2010, 07:00:39 pm »
The "hello world" code builds fine and runs fine if I do it from cygwin. I am an experienced C programmer but don't know enough about GCC in general.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #5 on: June 18, 2010, 07:24:55 pm »
How about in a Windows Command Prompt?  Our Build window uses that rather the Cygwin shell, it might be that you have some environment vars in the Cygwin shell that need to be in the Windows as well.

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #6 on: June 18, 2010, 10:14:28 pm »
I invoke gcc-4 from the Command Prompt:

C:\cygwin\bin>gcc-4 C:/junk/test/test.c -v

Quote
C:\cygwin\bin>gcc-4 c:/junk/test/test.c -v
cygwin warning:
  MS-DOS style path detected: c:/junk/test/test.c
  Preferred POSIX equivalent is: /cygdrive/c/junk/test/test.c
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Using built-in specs.
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.4/
configure --srcdir=/gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.
4 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libex
ecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --inf
odir=/usr/share/info --mandir=/usr/share/man --datadir=/usr/share --infodir=/usr
/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable
-bootstrap --enable-version-specific-runtime-libs --with-slibdir=/usr/bin --libe
xecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable
-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exception
s --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-symvers --ena
ble-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada
 --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sub
libs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TA
RGET=gnatmake GNATBIND_FOR_TARGET=gnatbind AS=/opt/gcc-tools/bin/as.exe AS_FOR_T
ARGET=/opt/gcc-tools/bin/as.exe LD=/opt/gcc-tools/bin/ld.exe LD_FOR_TARGET=/opt/
gcc-tools/bin/ld.exe --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1.exe -quiet -v -D__CYGWIN32__ -D__CYGWIN__
 -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../.
./../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i68
6-pc-cygwin/lib/../../include/w32api c:/junk/test/test.c -quiet -dumpbase test.c
 -mtune=generic -march=i686 -auxbase test -version -o /cygdrive/c/DOCUME~1/achen
/LOCALS~1/Temp/ccrLpka4.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i6
86-pc-cygwin/include"
ignoring duplicate directory "/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686
-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/include
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/include-fixed
 /usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../include/w32api
End of search list.
GNU C (GCC) version 4.3.4 20090804 (release) 1 (i686-pc-cygwin)
        compiled by GNU C version 4.3.4 20090804 (release) 1, GMP version 4.3.1,
 MPFR version 2.4.1-p5.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d5cdab7e958df0270fe64611765e0bb6
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/as.exe -v -o /
cygdrive/c/DOCUME~1/achen/LOCALS~1/Temp/ccsBzKjI.o /cygdrive/c/DOCUME~1/achen/LO
CALS~1/Temp/ccrLpka4.s
GNU assembler version 2.20.51 (i686-cygwin) using BFD version (GNU Binutils) 2.2
0.51.20100410
COMPILER_PATH=/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/4.3
.4/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc
/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/
:/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/
LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.3.4/:/usr/lib/gcc/i686-pc-cygwin/4.3.
4/:/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.3.4/collect2.exe -tsaware --wrap _Znwj --wrap _Zn
aj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothr
ow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-sea
rch-prefix=cyg -u ___register_frame_info -u ___deregister_frame_info /usr/lib/gc
c/i686-pc-cygwin/4.3.4/../../../crt0.o /usr/lib/gcc/i686-pc-cygwin/4.3.4/crtbegi
n.o -L/usr/lib/gcc/i686-pc-cygwin/4.3.4 -L/usr/lib/gcc/i686-pc-cygwin/4.3.4 -L/u
sr/lib/gcc/i686-pc-cygwin/4.3.4/../../.. /cygdrive/c/DOCUME~1/achen/LOCALS~1/Tem
p/ccsBzKjI.o -lgcc_s -lgcc -lgcc_eh -lcygwin -luser32 -lkernel32 -ladvapi32 -lsh
ell32 -lgcc_s -lgcc -lgcc_eh /usr/lib/gcc/i686-pc-cygwin/4.3.4/crtend.o
The build produces a.exe and if I run a.exe, it shows "hello world".

I am wondering if I have to do more on the "GNU C Options..." menu. Currently I have

Compiler Tab
Compiler:  C:\cygwin\bin\gcc-4.exe
Preprocessor Defines: blank
Other Options: blank

Link Tab
Output Type: Executable(gcc/g++)
Linker: %xup
Output Filename(-o): %bdtest.exe
Libraries/Objects: blank
Other Options: blank

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #7 on: June 21, 2010, 12:26:46 pm »
The Linker setting doesn't look right, it should also be gcc-4.  The other options look correct.

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #8 on: June 30, 2010, 06:34:08 pm »
The build command is:
Quote
C:\cygwin\bin\gcc-4.exe -c -x c -O0 -g1 C:/junk/test/ -o Debug/test.o C:/junk/test/test.c
and the error I get is:
Quote
gcc-4: cannot specify -o with -c or -S with multiple files
Question - How do I remove the '-c' option from the command line?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #9 on: June 30, 2010, 06:58:08 pm »
Looks like an error in the command-line, I'm not sure how the "C:/junk/test/" got between the "-g1" and the "-o".  That shouldn't be there.  Was this set manually or did you configure it with through GNU C options?

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #10 on: June 30, 2010, 11:07:11 pm »
No, I don't recall I manually changed any settings. The test project is in the attachment. Can I ask you to take a quick look? Thanks.

Regards,

Alan


Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #11 on: July 01, 2010, 01:45:33 pm »
There is a %rw (project working directory) in the Other Options setting in GNU C Options under the Compile tab.  That isn't necessary, unless there was a compiler switch that needed it that you forgot to put in front of it.

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #12 on: July 01, 2010, 02:40:17 pm »
Lee,
Thanks for looking into my problem.
Do you have cygwin installed on your computer? I am wondering if I can ask you or perhaps anyone else to follow the New Project wizard in SlickEdit and create a "Hello Word" application to see if it can be successfully built. As I said before, my test project can be built and run from either the command prompt or cygwin shell. My guess is that something in my SlickEdit project setting is incorrect and I am having trouble identifying it. If any of you guys can give me a sample project, I can do the side by side comparison myself and figure out what I have missed. Thanks again.

Regards,

Alan

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Getting SE 2009 to work with Cygwin...
« Reply #13 on: July 01, 2010, 03:10:53 pm »
The main issue I am aware with the new project wizard is that there is no g++.exe or gcc.exe in Cygwin anymore, and it doesn't populate the compiler/linker command with the actual executables gcc-3/4 (or g++-3/4).  The upcoming point release for SlickEdit 2010 should address this issue.  The solution for now is to go into GNU C options and set the Compiler and Linker commands to point to a valid executable.

achen

  • Guest
Re: Getting SE 2009 to work with Cygwin...
« Reply #14 on: July 01, 2010, 09:10:46 pm »
Hmm, I guess I just don't have much luck. I upgraded from SlickEdit 2009 to 2010 (15.0.0). I went through the project wizard to create a GNU C/C++ project for the "Hello World" application. I opened up "GNU C Options", pointed both the compiler and linker to c:\cygwin\bin\gcc-4.exe. The error I got is
Quote
echo VSLICKERRORPATH="C:\junk\gcc_test"
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\junk\gcc_test>VSLICKERRORPATH="C:\junk\gcc_test"

C:\junk\gcc_test>"C:\PROGRA~1\SLICKE~1.0\win\vsbuild" "C:\junk\gcc_test\gcc_test.vpw" "C:\junk\gcc_test\gcc_test.vpj" -t build -signal 9009
---------- Build Project: 'gcc_test.vpj' - 'Debug' ---------- VSLICKERRORPATH="C:\junk\gcc_test"
gcc_test.c
/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
*** Errors occurred during this build ***
Can I ask one of you guys to make a compilable "Hello World" SlickEdit project and upload it here?