The problem here is that the dos/windows compilers automatically assume that files ending in .c or .cpp are source files. As a result, they automatically know to compile the files.
Another problem is related to syntax highlighting and the editors
I guess that you might be a better programmer if you learn on the dumbest compiler/editor combination available. But I see no reason to make programming more difficult than necessary.
Borland C++ 5.02
Project Definition
To create a project, from the menu, select
File / New / Project...and set the following parameters
Parameter | Value |
---|---|
Target Type | Application [.exe] |
Platform | Win32 |
Target Model     | Console |
Now you can highlight the exe node and right click to add a new node (source file). Using this, you can add any existing source file or create a .cpp file. You can NOT create a .cxx file this way. I use notepad to create empty cxx files and then add them.
You should also add the header (.h) files to your project. They are not required to compile the project, but, once added, the nodes can be double clicked in order to view their source. (Double clicking the .exe node will compile and execute it.)
Handling Unknown Node Types
This procedure must be followed for each .cxx file in your project. However, once it is done once, these definitions are remembered in the .ide (project) file. When you want to re-open your project, be sure to open the ide file and not the individual source files.
Options / Tools... / CppCompile / Edit / Advanced
Options / Tools... / EditText / Edit / AdvancedAdd ".cxx;" to both Applies To and Default For.
Once this is done, it applies to all future projects.
Editor - Syntax Highlighting
Options / Environment... / Topics / Syntax Highlightingadd whatever extension you want to the Syntax Extensions data entry field. The syntax is fairly obvious - just add
;*.cxxto the end of the existing text.
Once made, this change is remembered and it applies to all furture projects.
GNU g++ (Unix)
lab5: lab5.o bag2.o item2.o g++ lab5.o bag2.o item2.o -o lab5 bag2.o: bag2.cxx bag2.h g++ -c bag2.cxx item2.o: item2.cxx item2.h g++ -c item2.cxx lab5.o: lab5.cxx g++ -c lab5.cxxAs far as Syntax Highlighting - forget it. There are a few editors that support this, but pico does not. If you work in an X-window, you will have more options. Author: Robert Clemenzi - clemenzi@cpcug.org