User forums > Using Code::Blocks

how to compile c++ programm

(1/2) > >>

ric63:
Hi,
I am an beginner to c++. I installed Code::Block under Ubuntu and I writted a simple program that work.
I now would make a library for Ubuntu.
When I make a new project -> static library, I see a .c file and not .cpp file.
Why ?

Alpha:
All C code is valid C++ code; you could rename the file extension (it probably will need to be re-added to your project).
Alternatively, you could delete the C file and add however many C++ files you want.  The structure of code in a static library is not nearly as strict as in other areas because it is simply a collection of object files waiting to be linked at a later point in time.

You do have a valid point though; for continuity, the static library wizard should have a language selection page...

ric63:
thanks.
it work
I have deleted the .c file and added .cpp file.
So, I have builded the static library.
bye

zabzonk:

--- Quote ---All C code is valid C++ code
--- End quote ---

This is very, very far from true.

Alpha:

--- Quote from: Neil Butterworth on January 15, 2012, 07:44:44 pm ---
--- Quote ---All C code is valid C++ code
--- End quote ---

This is very, very far from true.

--- End quote ---
Example/link??

Navigation

[0] Message Index

[#] Next page

Go to full version