Thread: error with compiling

  1. #1
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6

    error with compiling

    right.. i think this is the right thread for it.

    Compiler: Default compiler
    Building Makefile: "C:\my projects\Makefile.win"
    Executing make...
    make.exe -f "C:\my projects\Makefile.win" all
    Execution terminated

    My code i have made is ok so.. nothing wrong with the code.
    I just don't understand how compiling works i have looked around on a few tutorials and so on aswell..

    I'm using DevC++ as my compiler.

    I just hit execute->compile
    then i save the file as name.cpp then i get that error.
    also after the compile error in the folder i saved the name.cpp in a new file appears called makefile.win

    im clueless what makes this error so any help is welcome!

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    yes, this is the wrong section..

    it doesn't say anything after "execution terminate" ?

    try these things:
    1. save before compiling
    2. make sure you closed the last execution of the program (or the program has finished)
    3. post any further error messages here
    4. try starting a new project and adding the files to your new project (i have this problem from time to time when i rename files)


    that's about all i can say without any further knowledge of the problem....
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Try renaming "my projects" to something with no spaces and try it then

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by Thantos
    Try renaming "my projects" to something with no spaces and try it then

    yea, when you ditch the IDE and go command-o you'll be thanking yourself...

    although i believe i was running dev-c++ on projects stored under "My Documents" for some time and didn't have (m)any problems...but it's worth a shot renaming it
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  5. #5
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6
    hm, first of all i changed "my projects" folder to "projects".

    I looked my error up in the compile log in the bottom of the screen, i dunno if that's the right place to look but i think so.
    So.. that's really all it said about my error. Something about this "makefile.win" if anyone know what that could be.

    I also notised a lot of options and so on.. I dunno if i need to touch them or not since it didn't say so in the tutorial i'm doing.

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    wait a minute.........does it say "compilation successful" after "execution terminated"?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  7. #7
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6
    nope, all i get from the error is a makefile.win in the same foler i saved the .cpp in.

    I have had this error on a lot of projects i've made, first i thought there is something wrong with the code i had but now im using a finished and extremly short and easy code to see if it was the code causing the error.. but it isn't.

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    let's do this....

    create this file and name it test.cpp
    Code:
    #include <stdio.h>
    int main()
    {
         printf("Compiler works fine. Post a copy of makefile.win on message board\n");
         system("PAUSE");
    }
    search your hard drive for "g++.exe"

    copy test.cpp to the directory g++.exe is in
    open ms-dos prompt
    type "cd C:\Directory_That_g++_Is_In"
    type "g++ test.cpp -o test.exe"
    type "test.exe"
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  9. #9
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6
    Ok..

    everything went fine until this part where i typed "g++ test.cpp -o test.exe"
    Then this text came under it:

    test.cpp: In function `int main<>´:
    test.cpp:5: error: `system´ undeclared <first use this function>
    test.cpp:5: error: <each undeclared identifier is reported only once for each function it appears in.>
    test.cpp:6:2: warning: no newline at end of file

  10. #10
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    oh crap..i'm sorry....also include the line "#include <stdlib.h>"
    if you want that to work...but it should...

    go ahead and post the make file and the version of dev-cpp you're using
    Last edited by misplaced; 12-19-2004 at 08:14 AM.
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  11. #11
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6
    Ok..
    That looks better now but still something wrong...

    after typing "g++ test.cpp -o test.exe" now i only get one line under it:

    test.cpp:7:2: warning: no newline at end of file

    The compiler version im using is:

    Dev-C++ 5.0 beta 9 (4.9.9.1) (7.6 MB) with Mingw/GCC 3.3.1
    Dev-C++ version 4.9.9.1, includes full Mingw compiler system (GCC 3.3.1) and GDB 5.2.1

    Actually now i don't have the same error suddenly on my old code:

    #include <iostream.h>
    int main()
    {
    cout<<"The Compiler Works";
    return 0;
    }

    Now my error has changed and i think i know the problem.. i don't have the default options.

    I have reinstalled DevC++ but i still don't get my default options.
    Can you tell me how i reset my DevC++ to the default options and i can try if that is the problem..

  12. #12
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by Fengus
    That looks better now but still something wrong...
    after typing "g++ test.cpp -o test.exe" now i only get one line under it:
    test.cpp:7:2: warning: no newline at end of file
    That typically can be ignored in windows, but for the sake of your compiler and everyone elses, when you finish typing your files, just take a second and hit "enter" a time or 2 at the end of the file.

    i'm not really sure what you mean by default options, so no.

    if you really think it's that, then completely UN-install devcpp first and then re-install it.....you will get back all the default setting.
    if you don't uninstall devcpp before installing it then it WILL screw up.
    Last edited by misplaced; 12-19-2004 at 08:55 AM.
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  13. #13
    Newbie
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    6
    Ok i put a few empty lines after my codes and i reinstalled my compiler and changed all my compiler options to the right paths..
    and now my compiling is succesfull!!

    misplaced i'm really thankful to you for replying to everysingle reply i made on this thread and if it wasn't for you i would never fixed it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling Issues
    By pc_doctor in forum C Programming
    Replies: 3
    Last Post: 11-30-2007, 10:00 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Problem Compiling
    By Flakster in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 01:09 AM
  4. Compiling
    By Dae in forum C++ Programming
    Replies: 7
    Last Post: 06-15-2005, 01:08 AM
  5. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 02:24 PM