User forums > Help
Cant make iomanip to work
(1/1)
sedlacek:
it straight sends me to a behind page with a few log errors on "namespace std"
stahta01:
The rules https://forums.codeblocks.org/index.php/topic,9996.0.html
--- Code: ---namespace std;
--- End code ---
Note: I am not a C++ Programmer; but, the problem is likely the ";" semi-colon you added or the fact you are missing an "using".
Note: As stated in the rules this is *not* a programming help web-site.
Tim S.
sedlacek:
You got me wrong, i didnt write that code. I dont know if its a IDE problem or something else, but i tried to add the iomanip library to my project and it just sent me to that page i screen shotted. I was watching one of those youtube tutotrials and the same code worked fine on another IDE. This is what i actually coded:
ios worked fine and if i type the library name wrong, it gives me an error on my acutal code page.
stahta01:
I suggest posting a build log in code tags if you want help; posting a image will likely get you ignored.
https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
I also suggest reading the rules. https://forums.codeblocks.org/index.php/topic,9996.0.html
I will not be helping you again because as I have already stated I am not a expert C++ programmer.
Edit: My best guess is you accidently typed an ";" in a header file; so, re-installing your compiler might be the proper fix.
Edit2: Yes, that is the problem. You entered an ";" and a newline in file "ctime".
--- Code: ---namespace std
{
using ::clock_t;
using ::time_t;
using ::tm;
--- End code ---
Tim S.
blauzahn:
@sedlacek:
1. In your first screenshot gcc's error message shown by cb told you correctly where the code had a syntax error:
--- Code: ---C:\msys64\m... 58 error: expected '{' before ';' token
--- End code ---
One might argue that gcc's message is not as helpful as it can be. Codeblocks OTOH did its job in displaying whatever the compiler in use suggests.
2. You did not
--- Quote ---add the iomanip library
--- End quote ---
as it is just an include.
Please buy a decent C++-book and study it thoroughly. For C++ see https://isocpp.org/ and https://en.cppreference.com/w/. And please have a look into the links stahta01 suggested.
Thank you.
Navigation
[0] Message Index
Go to full version