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 ?
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...
thanks.
it work
I have deleted the .c file and added .cpp file.
So, I have builded the static library.
bye
QuoteAll C code is valid C++ code
This is very, very far from true.
Quote from: Neil Butterworth on January 15, 2012, 07:44:44 PM
QuoteAll C code is valid C++ code
This is very, very far from true.
Example/link??
Well, a couple of simple examples:
// valid C code not valid C++
int main() {
int new = 0;
char * p = (void *) 0;
}
But there are a lot more.
http://david.tribble.com/text/cdiffs.htm#C++-vs-C (http://david.tribble.com/text/cdiffs.htm#C++-vs-C)
Tim S.
Thanks.
I should have expected I would miss something obvious, having learned to program by means of Google and reading source (like Code::Blocks!) in my free time over the past year and a bit. (But you may already have guessed at my inexperience if you looked at my style in the patches I have submitted.)
I still have much to learn...