Menu

Compiling Projects

2007-08-01
2012-09-26
  • Nobody/Anonymous

    Hi all,

    I'm a newbie C++ programmer. I've been using the learn c++ in 21 days book and have gotten through most of that. However, I purchased a new book that works with projects (instead of putting everything in one source file as my previous book seemed to do). Whenever I try to compile any project, I get the same error 32. My compile log looks as follows:

    Compiler: Default compiler
    Building Makefile: "C:\Dev-Cpp\Examples\Hello\Makefile.win"
    Executing make...
    make.exe -f "C:\Dev-Cpp\Examples\Hello\Makefile.win" all
    g++.exe -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

    process_begin: CreateProcess(C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make36002.bat, C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make36002.bat, ...) failed.
    make (e=32): The process cannot access the file because it is being used by another process.

    make.exe: *** [Hello.o] Error 32

    Execution terminated

    That was the compile log when I try to compile the "Hello" example that comes with dev-c++. I have done a full uninstall and reinstall. Also, it might be worth noting that as this began to happen, I tried different compilers (something call rolan or something like that) and those failed to compile projects as well. I've since deleted all files related to those other compilers and reinstalled dev-c++ prior to posting this. It still doesn't work.

    I'm using Windows XP SP1. I was reading through other sites and the posters often mention "paths". I don't know what these are but maybe that's what's going on.

    I would appreciate some help with this before I quit my attempt to learn C++.

    Thanks!

     
    • Anonymous

      Anonymous - 2007-08-02

      Copy the examples folder to c:\cppprojects\examples - i.e. not under the installation directory; for some reason that can sometimes cause a problem for Dev-C++. Before rebuilding in the new location, delete any files called "makefile.win" and do a "Rebuild All" from the project menu.

      A path BTW is simply the string that defines a file and/or its folder location, line "c:\cppprojects\examples" for example.

      "Rolan or something like that" - Never heard of it or anything remotely like it, cannot imagine what you mean. If you install anything on your computer that you download from the Internet you really should know what it is - not all programs are 'nice'! I would stick to the 'well known' tools such as Dev-C++, wxDev-C++, Eclipse/CDT+MinGW, Code::Blocks with MinGW, MS Visual C++ 2005 Express Edition, Open Watcom, Digital Mars, Ultimate C++. Not all of these have IDEs, some are IDEs only to which you add your compiler of choice, some are that, but come with a default compiler/toolchain.

      Clifford

       
    • Nobody/Anonymous

      Since c:\cppprojects\examples does not exist for me, are you saying that I should just create a new folder? Also, I've tried compiling a few projects besides the example and those don't work as well. However, I saved most of those projects in that installation folder is well. Perhaps, that's the explanation.

      I'll try it out and get back to you tonight. Thanks.

       
    • Nobody/Anonymous

      Okay, here's what I've done today and it still does not work

      1) Uninstalled Dev-C++ by following the instructions. I ran the regular uninstall out of the control panel. Deleted the Dev-C++ folder as well. I looked for the other devcpp files that the article mentioned but I could not find them.

      2) Reinstalled Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2 from the website. The program was installed in c:\dev-Cpp

      3) Tried to run the "hello" example. Specifically I went into the examples folder and opened Hello.dev. I opened it up and tried to "compile and run". Also tried a few examples from my book. Everything results in the "error 32"

      I also rebuilt everything. Here is the rebuild log:

      Compiler: Default compiler
      Building Makefile: "C:\Examples\Hello\Makefile.win"
      Executing make clean
      rm -f Hello.o Hello.exe

      g++.exe -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

      process_begin: CreateProcess(C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make23322.bat, C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make23322.bat, ...) failed.
      make (e=32): The process cannot access the file because it is being used by another process.

      make.exe: *** [Hello.o] Error 32

      Execution terminated

      Here is the compile log:

      Compiler: Default compiler
      Building Makefile: "C:\Examples\Hello\Makefile.win"
      Executing make clean
      rm -f Hello.o Hello.exe

      g++.exe -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

      process_begin: CreateProcess(C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make23322.bat, C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make23322.bat, ...) failed.
      make (e=32): The process cannot access the file because it is being used by another process.

      make.exe: *** [Hello.o] Error 32

      Execution terminated

      This is getting kinda annoying. Why is C++ so hard???

      Thanks

       
    • Wayne Keen

      Wayne Keen - 2007-08-03

      This is skipping details:

      "I looked for the other devcpp files that the article mentioned but I could not find them."

      HOW did you look? If you used Windows Search - how did you configure it? The way you look
      is vital, as these files are in directories that Windows chooses to label as "hidden".
      By default, the Windows search engine is NOT configured to search hidden folders.

      Let me change your way of thinking. If you are told to look for something, and you do not
      find it, assume that you did something wrong, not that things you were told are there are
      really not there.

      Think detail please.

      Wayne

       
    • Nobody/Anonymous

      okay. i just used the windows search to find them. Is there a more efficient way I can approach this?

      Thanks.

       
      • Wayne Keen

        Wayne Keen - 2007-08-03

        You can use Windows Search, but you will need to change your preferences to have it search
        in Hidden and System folders. It varies with versions of Windows, so open the search windows,
        and explore through the settings to turn on the option to search hidden folders.

        Wayne

         
    • Nobody/Anonymous

      I searched again looking for hidden files. Those two do not show up anywhere. Do you really think this problem has to do with the install anyway? It seems more like a failure to link the files and/or find certain items needed to compile.

       
    • Wayne Keen

      Wayne Keen - 2007-08-03

      It can be an install problem, so I need to systematically eliminate it. Now, you say:

      "Those two do not show up anywhere."

      Is this with Dev installed, or uninstalled?

      Now, the following message also makes me wonder:

      "The process cannot access the file because it is being used by another process."

      What anti-virus are you running?

      Wayne

       
    • Nobody/Anonymous

      Well, I first ran the Dev uninstall through the control panel and then went back through my c: drive and removed the dev folder. Only after all of this did I look for the files (perhaps they were removed during either of the two previous steps).

      I have Norton antivirus. I don't think it is set up to be continuously running, however.

      --Charlie

       
    • Wayne Keen

      Wayne Keen - 2007-08-03

      "Well, I first ran the Dev uninstall through the control panel and then went back through my c: drive and removed the dev folder. Only after all of this did I look for the files (perhaps they were removed during either of the two previous steps)."

      In your previous post, you said you did an uninstall, searched, did not find the files, then reinstalled.

      Then you told me that you had not in fact configured search to look in hidden folders.

      This most recent message indicates you went back and looked with search configured hidden folders.

      Pardon my confusion, but was there a second uninstall done before your hidden folder search?

      Wayne

       
    • Nobody/Anonymous

      Yes there was. I apologize. I've done a few un and reinstalls. Nothing is there by that file name.

       
    • Anonymous

      Anonymous - 2007-08-03

      >> I have Norton antivirus. I don't think it is set up to be continuously running, however.

      Who knows where NAV gets its fingers. Normally it will have a process running checking file accesses and activity. We have certainly seen problems with NAV before - this might be the culprit. I presume it is possible to temporarily disable it?

      I never have problems with AVGFree, and it updates daily - for free, none of that subscription nonsense.

      Clifford

       
    • Nobody/Anonymous

      I completely removed Norton. Still getting the same error.

      Please let me know if I'm simply not running the project correctly. After reinstalling Dev-C++ I went to open new project. I then opened Hello.dev. The code is as follows:

      include <iostream>

      using namespace std;

      int main (int argc, char *argv[])
      {
      char quit;

      quit = '\0';
      while (quit != 'q')
      {
          cout &lt;&lt; &quot;Hello ! This is a console app.&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;To create a console, go to Project Options and select&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;\'Win32 Console\'.&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Press q to quit &quot; &lt;&lt; endl;
          cin &gt;&gt; quit;
      }
      
      char response;
      cin &gt;&gt; response;
      return 0;
      

      }

      I then choose Compile & run. At this point I get the Error 32.

      Thank you.

       
    • Anonymous

      Anonymous - 2007-08-03

      You seem to be doing everything correctly, and are exhibiting incredible patience. Even if you were, no amount of "doing it wrong" should result in this error.

      If you want to get on, my advice would be:

      1) Try a different PC
      2) Try a different tool - MSVC++ 2005 Express Edition is both free and IMO far better in any case, Dev-C++ has its good points - size, simplicity, speed, third-party support, but nothing beats a working debugger! ;-)

      Note Norton AV is better than No AV! I'd put it (or something) back soon!

      Clifford

       
    • Anonymous

      Anonymous - 2007-08-03

      Sorry we did not solve your problem. A quick Google should have found: http://msdn.microsoft.com/vstudio/express/

       
    • Nobody/Anonymous

      Just moved the file. Still doesn't work however. I've copied the compile log below:

      Compiler: Default compiler
      Building Makefile: "C:\cppprojects\Examples\Hello\Makefile.win"
      Executing make...
      make.exe -f "C:\cppprojects\Examples\Hello\Makefile.win" all
      g++.exe -c Hello.cpp -o Hello.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

      process_begin: CreateProcess(C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make34282.bat, C:\DOCUME~1\CHARLE~1\LOCALS~1\Temp\make34282.bat, ...) failed.
      make (e=32): The process cannot access the file because it is being used by another process.

      make.exe: *** [Hello.o] Error 32

      Execution terminated

      Any idea what's going on?

       
      • Wayne Keen

        Wayne Keen - 2007-08-02

        When you did your uninstall and reinstall, did you follow the directions for
        getting a clean uninstall that are in the "Please Read" thread? Running the
        uninstaller and deleting the Dev directory is not sufficient.

        In the spirit of fairness, this is a question to which a simple "Yes" is NOT
        in fact an acceptable answer. The directions for doing a clean uninstall
        make a point (to the point of being obnoxious), that is you are still having
        some kind of a problem after uninstalling, you will need to tell us exactly
        what you did to do a clean uninstall - step by step. (You would be surprised
        at the people who thing a generic statement like "Yes, I followed the directions
        TO THE LETTER" is an acceptable substitute for telling us what they did by the
        way)

        You are not by any chance running Vista as your OS, are you?

        Wayne

         
        • Wayne Keen

          Wayne Keen - 2007-08-02

          I also noticed that the log you posted does not look like a "Rebuild All", as was
          directed.

          Wayne

           
    • Anonymous

      Anonymous - 2007-08-02

      >>Since c:\cppprojects\examples does not exist for me, are you saying that I should just create a new folder?

      Of course it doesn't - that would be a strange concidence; and yes that is what I mean. Looks like that is what you did in any case ;-) You can call it what you like, just so long is it is not a sub-folder of the Dev-C++ folder and it does not contain spaces. Don't put it in "My Documents" for example.

      Too bad however that it did not solve your problem - it was still a good idea for lots of reasons, so don't think you wasted your time.

      I trust you deleted the makefile.win and did a rebuild all as directed? It is helpful if you post the log from such a build - it would not look quite like the one you did post.

      Now I did a quick search on the forum, and the exact same problem came up in November last year - even using the same code in the same examples folder. (http://sourceforge.net/forum/message.php?msg_id=3996610). However that guy seemed too impatient to be bothered to get to the bottom of it and ended using a different tool - I don't blame him for that, maybe he needed to get stuff done - but he made a rod for his own back IMO by installing "every vershion i can get my hands on" before hand - not very methodical.

      Other instances of "Error 32" appear to be related to the file location and/or were resolved by deleting the makefile and doing a Rebuild All.

      Have you tried creating your own project rather than using the provided examples? Try it: File->New->New Project. You will find a number of templates for various project types - pick one and build it without modifying the template code. See if that works.

      Clifford

       
    • Nobody/Anonymous

      I'll definitely try all of that tonight. Unfortunately, I'm at work right now and don't have C++ on this computer. I'll get back to you when I attempt what you have said.

      Obviously, being such a noob, I hope that I'm at least running the project right and that something I'm doing is not to blame.

      Thanks again.

       
    • Nobody/Anonymous

      Thanks, Clifford. Do you by chance have a link where I can get MSVC++?

      You and Wayne are so helpful. It's great that there's a site like this on the internet.

       

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.