Re: [Dev-C++] I need a basic walk-through compiling with classes
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2001-12-05 23:41:57
|
Hi, Danny If your program is a console application, what I'll say should work, if instead your dealing with Windows applications, I can't help you. I'll also assume that Windows is your OS. Your question is: given source files, how do I build the binary file?. There are two ways I can think of: one uses Dev-C++ (so it is a GUI method) and the other is the classic CLI method resorting to makefiles. -Using Dev-C++: 1- use Explorer to make a new folder (say c:\test) and move (or copy) the source files of your program (dynarray.h, dynarray.cpp and your main which I'll name test.cpp) to it; 2- start Dev-C++, from the "File" menu select new project, then select "console application" and give a name to your project (the obvious choice would be "test", so that "test.dev" would be created, but then Dev-C++ will not allow you to add the file "test.cpp" to the project, so I suggest you use "test_prj"), also save your project file to "c:\test" (so that everything is stored in one folder); 3- close the "Untitled1" window, and remove the "Untitled1" file from the project (by left clicking on "Untitled1" in the project manager window and then choosing "remove from project"); 4- left click on "test_prj" in the project manager window and choose "add to project", then select the three source files you have in the directory "c:\test"; 5- from the "Execute" menu, select "compile", this will build the binary file named "test_prj.exe" (if your code is error free! (-; ), you can now run it from inside Dev-C++ in the usual way (i.e selecting "run" from the "Execute" menu). -Using a makefile: this approach is a bit longer to describe and probably you are not interested, so I'll say nothing about it, I just mentioned it so that one knows the method exists (actually makefiles are nice tools when your OS has no GUI). If instead you are interested let me know and I'll try to explain an easy way to put up a simple makefile and to use it to build/update your binary file. I hope the above helps. At 21.32 04/12/01 -0500, Danny wrote: >Hola, >I am trying to find out how to properly compile a program when there are >user-written classes involved. I have 3 files- a header file (dynarray.h), >an implementation file (dynarray.cpp), and my main program. Using Dev C++, >what is the proper method and order to correctly compile? This is my first >program where I have had to implement a class, and I can't find information >on how to use Dev C++ to do this. Thanks! > >Danny -- gisan gi...@li... |