How can I compile multiple files in Dev C/C++ using a Makefile?

  • Context: C/C++ 
  • Thread starter Thread starter trickae
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 6K views
trickae
Messages
82
Reaction score
0
Any tips on using this windows based free C compiler?
Like how to compile one file, multiple files.
 
Physics news on Phys.org
I've used Dev-C++ for a long time but now I recommend Code::Block instead which I find simpler and more intuitive. It is also actively developped whereas Dev development seems all but abandonned from burn-out. It can use GCC as compiler, just like Dev-C++, but it can also use many others, plus it runs on both Windows and Linux. Check the web site: http://codeblocks.org/ where you will find the package along with plenty of instructions in the form of a wiki and a discussion forum where you can get help.
 
...oh, and if you need to use Dev as an academic requirement, here is their discussion forum where volunteers provide help on all related subjects: http://sourceforge.net/forum/forum.php?forum_id=48211
 
Last edited by a moderator:
You can compile one file IRC without the need to do a project, see the menu "compile", also do a project for more than one source, also check the project options and when creating the project, select the option that satisfy your needs.

PellesC and LCC are also free IRC only aplicable to C not C++, there are a page that contain some links to "free" things, is something like "the free country" or some like that, do a search, and you will find it.
 
Last edited:
Thanx guys,

As an academic requirement lol we're meant to use putty. Its just so slow when i use SSH to access it.

My problem is that i have all the files i need in one project in Dev C/c++
and I've

Code:
#include "myHeaderfn.h"

etc but when i compile it only looks at the current file.

like i had a structure definition in my header file and the C file with all the function definitions was the only file that was compiled. And i got errors saying my
struct node
was undefined. But i had definied it.

My unix command for it would be as follows
Code:
% ls 
jt.c     jtdriver.c     Makefile     jt.h
% gcc -Wall -o jt jt.c jtdriver.c

and my function definitons will be in in "jt.c" and my struct definitions and prototypes for funtions will be in "jt.h"

so where are the options i need to access to compile all these together.

Also if i have a Makefile written in the same project will that get mixed up with the entire compilation?

thanx
 
Last edited: