problem with dev-cpp

This is a discussion on problem with dev-cpp within the C Programming forums, part of the General Programming Boards category; I use dev-cpp 4.9.9.2 for a large project in c. when i press "compile", it compiles ALL source files even ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    problem with dev-cpp

    I use dev-cpp 4.9.9.2 for a large project in c. when i press "compile", it compiles ALL source files even though i haven't edited them. this is very frustrating because it makes the program take very long to compile. how do i fix this?

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    188
    Are all things in the same project? Incase, that's why.

  3. #3
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    How many C files have you got in the project. If there are many files then obvisoly it would take a longer time to compile. But you wouldn't notice the delay that much when u compile it second time.

    I suspect you are using project file to create small programs. If you are just using some small programs where you dont need any other supposting or external c programs to be included in your program. Then it would be better that if you could use just one single file as a standalone file with no any other file. You could do this by clicking on

    new -> Source file. Or just say Clt+N

    So when ever you compile, you just compile one single file. That would be faster compare to project.

    ssharish2005
    Last edited by ssharish2005; 01-20-2007 at 04:17 AM.

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    188
    Yeah, i were going to say that to

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    2
    Quote Originally Posted by ssharish2005
    But you wouldn't notice the delay that much when u compile it second time.
    when i've used dev-cpp in previous projects, this was the case. it would take a long time to compile the 1st time (or if i pressed "rebuild all", but the 2nd time it would only compile the files i edited. but now, "compile" does the same thing as "rebuild all". that makes no sense, why compile source files again when they have already been built?

    perhaps it has something to do with the fact that the source files are in a different folder than the .dev file?

    my dir structure is "Main Folder (.dev, makefile, resources, ect)" / "source (.c, .h, .o files)"

    ssharish2005: i'm not sure i understand what you are talking about. i am building 1 executable. i do not want to have everything in one source file, because it would be hard to find certain code, and it would take longer to compile. i thought that having many different files in a project would speed up compile times, because the .o files that are up to date do not need to be recompiled. 18 source files btw. not that large, but large enough to make it annoying to recompile everything every time.

    thank you for your replies.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    I found that Dev-C++ did that all the time to me, although I was using an older version of Dev-C++.

    I think it can be fixed by using the option "Generate Makefile", then editing the makefile so it's reasonable. If you don't edit it it only has one compiling rule which compiles everything, which may be the source of your problem now that I think about it.

    You do know how to write a Makefile, right? The basic form is like this.
    Code:
    main.o: main.c
            gcc -c main.o
    # Note: the indentation must be with one tab, not spaces or anything.
    program.exe: main.o
            gcc main.o -o program.exe
    Of course, you get get more complicated ones than that. If you're interested, check out some make tutorials -- that's how I learned how to write them.

    Other than that, check your clock. If you've set it back recently it could mess things up.

    Try re-creating the project.
    Last edited by dwks; 01-20-2007 at 04:35 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 02-12-2009, 01:39 PM
  2. Problem with gcc
    By jayee_spicyguy in forum Linux Programming
    Replies: 8
    Last Post: 10-21-2008, 08:12 AM
  3. Linker Problem with Dev C++
    By Brownie in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2008, 07:18 AM
  4. Problem running prog I wrote in Dev C++
    By KidMan in forum C Programming
    Replies: 8
    Last Post: 09-22-2005, 01:50 AM
  5. problem with using for loops with Dev C++
    By indigo0086 in forum C++ Programming
    Replies: 10
    Last Post: 08-10-2005, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21