Menu

cygwin causing me problems

Osito
2007-08-27
2012-09-26
  • Osito

    Osito - 2007-08-27

    I recently installed some tools from Altera (chip company) and they included cygwin. I've found that when the cygwin\bin folder is in the Windows path, I can no longer compile in Dev-C++. Here is my log before cygwin:

    Compiler: Default compiler
    Building Makefile: "C:\Bittware\chamber\Makefile.win"
    Finding dependencies for file: C:\Bittware\chamber\chamber.c
    Executing make...
    make.exe -f "C:\Bittware\chamber\Makefile.win" all
    "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
    gcc.exe -c chamber.c -o chamber.o -I"C:/mingw/include" -I"C:/mingwnu/include" -Wall -Werror -Wformat=2 -Wunused-parameter -Wextra
    windres.exe -i chamber_private.rc --input-format=rc -o chamber_private.res -O coff
    gcc.exe chamber.o chamber_private.res -o "TheChamberMaid.exe" -L"C:/mingw/lib" -L"C:/mingwnu/lib" -mwindows -s -lcomctl32 visaext.lib agvisa32.lib agvisaext.lib visa32.lib
    del chamber.o chamber_private.h chamber_private.rc chamber_private.res
    Execution terminated
    Compilation successful

    And after:

    Compiler: Default compiler
    Building Makefile: "C:\Bittware\chamber\Makefile.win"
    Finding dependencies for file: C:\Bittware\chamber\chamber.c
    Executing make...
    make.exe -f "C:\Bittware\chamber\Makefile.win" all
    "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
    /usr/bin/sh: C:\Program Files\TortoiseSVN\bin\SubWCRev.exe: command not found
    make.exe: *** [all-before] Error 127
    Execution terminated

    The line it chokes on is from my extra make file, which extracts the SVN revision. Removing the cygwin\bin folder from the path and restarting Dev-C++ makes it work again, but then I don't have access to the Altera tools. What changes when that path is added? And is there a way to force Dev-C++/gcc/make/whatever to use the files they're supposed to rather than the Altera/cygwin versions?

     
    • Wayne Keen

      Wayne Keen - 2007-08-28

      Have you tried putting Dev in your path before Cygwin?

      Wayne

       
      • Osito

        Osito - 2007-08-28

        Dev doesn't get put into the path by default. I could certainly add it - what exactly do I need to add though? Is it C:\Dev-Cpp\bin or is it something in my separate mingw installation? I guess I can just experiment. I was hoping someone could tell me which exe is the problem.

         
        • Wayne Keen

          Wayne Keen - 2007-08-28

          Are you compiling with the version of MinGW that came with Dev? If so, I would start by putting C:\dev-cpp\bin early in my path. If you are using the seperate MinGW as your compiler, then c:\mingw\bin would seem appropriate.

          (I haven't had an issue with Cygwin, which I have on all of my machines, but that may have been dumb luck. I do have some issues (mostly good ones), where elements of my seperate MinGW installation are picked up by Dev, because the MinGW component of Dev will look for things in c:\mingw by default in addition to the Dev directories - I have even seen recomendations about keeping your seperate MinGW installation in someplace like c:\mymingw to keep this from happening,)

          Wayne

           
          • Osito

            Osito - 2007-08-28

            I am not compiling with the mingw that came with 4.9.9.2. I have two additional mingw installations. One is from their page, installed in c:\mingw, and it uses gcc-3.4.2. It's my default compiler in Dev-C++. I created a second compiler setup in Dev-C++ (under Tools-Compiler Options) that points to my second mingw, from nuwen.net, which uses gcc-4.2.1 and is installed in c:\mingwnu. I can switch between the two by choosing the appropriate compiler set, and that seems to work fine (outside of this cygwin issue).

            I tried adding c:\mingw\bin to my path before the cygwin entry, but the result is the same. It seems that it doesn't like "/usr/bin/sh", which I'm guessing uses the sh.exe in my cygwin install. I search my computer for other instances of sh.exe but there are none.

             
    • Anonymous

      Anonymous - 2007-08-28

      The trick is to specify the fully qualified paths for all the toolchain programs in Tools->Compiler options->Programs.

      When Dev-C++ builds it temporarily modifies the PATH variable with the paths specified in Tools->Compiler options->Directories->Binaries, unfortunately (and rather stupidly) it adds them to the end of the PATH, and any existing tools of the same name in a previously specified path will override it.

      You can explicitly put dev or mingw paths ahead of cygwin, but then it is just as likely to screw up you Cygwin based tools!

      One alternative is to create a batch file that sets the path variable and then runs Dev-C++, and create a shortcut to that and use it to launch Dev-C++ rather than any other method. The batch file would look something like:

      set path=c:\dev-cpp\bin;%path%
      c:\dev-cpp\devcpp.exe

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.