Page 1 of 1

back to C++ - namespace Question -

Posted: Wed Mar 16, 2022 11:03 am
by glenenglish

HI
I wrote alot of c++ in Codelite in 2016-2017, Have not written any c++ than a page since. written plenty of C.
But back to it in spades....

I humberly ask for a little namespace advice, as it seems some thing have changed since I last wrote any c++ -- this is not codelite specific (although it is what I use)

Previous I used GCC V4.7.2. I used Cstd11 ( -c++11) and codelite 9.0
I rebuilt a machine a year ago and now I have GCC10.2.1, codelite 15.0

The compiler complains that my class names etc can't be found, and maybe did I mean std: Cmyclass ?
and of course if I preface the reference to Cmyclass with std:: it find it.
It is like I have prefaced some of the code with using namespace std and it applies to everything..
I dont have using namespace std in my code.... (that I can find).
The compiler is now complaining <stddef.h> can't be found for pthreads.h
Did something change with C++ and treatment of namespaces / default namespaces ?
do I need to apply namespaces for all my source files ?

comments and advice happily accepted !
with thanks,
Glen.


Re: back to C++ - namespace Question -

Posted: Thu Mar 17, 2022 5:02 am
by glenenglish

Update.

unsure about the namespaces still.

I think in the course of installing various things, I have corrupted the build-essential install. IE missing header files etc.

generating a new VM for Debian 11 and I will start from scratch.
of course previous projects are all 32 bit, this is a 64 bit world in this new image , although the code should all be pretty 32/64 int compatible. no long/int pointer confusion.
glen


Re: back to C++ - namespace Question -

Posted: Thu Mar 17, 2022 12:17 pm
by glenenglish

started with fresh linux VM..... all is fine.
corrupted install / corrupted probably something I loaded. installed in dev tools.


Re: back to C++ - namespace Question -

Posted: Sat Mar 19, 2022 1:14 pm
by eranif

No, you don't need to apply namespaces, you can still write C++ as you did back in 2016-2017...