Error through codeblocks?

I'm looking for someone who uses the IDE codeblocks to try and run the program I made for class and see why it's not working. I didn't think it's anything major as it runs for me in visual studio 2019 but my teacher who is grading it is only using codeblocks and unfortunately I cannot manage to install it.

https://gist.github.com/Newtochr/3a7b4f7870232ad2d4eefb36e5df16f0
An IDE is just a text editor combined with a compiler combined with a linker all together in one easy, noob-friendly, package. There is nothing inherently different about Code::Blocks that would make it not work. I tested your code on cpp.sh and it is working fine fore me.

You should have no problems if it is run on Code::Blocks, provided the compiler is up to date and supports whatever standard of C++ you are using.
Hmm that is true I suppose but there are differences for some I thought. For example my version of visual studio doesn't need #include "stdafx.h"

Whatever the minor differences are they seem to be preventing my professor from running it on his computer and it does run on mine so I am just lost I guess.
stdafx.h is a precompiled header that some version Visual Studio uses. Other than that, everything is working fine. If the code doesn't work for him, its his own fault because it is valid C++ code. He shouldn't be getting any compilation errors.
Last edited on
Thanks for the information. He gave me this error https://i.imgur.com/LUfHBeb.png

Which tells me nothing. He did say before that I was missing some couts but I highlighted where the possible cout was missing and sent him the screenshot so he could just add that if that was the problem. It did not actually seem to be a problem though as it was running for me on visual studio like I said.
Things might be different now, but last time I checked, the compiler that comes with Code Blocks is somewhat outdated. It might not even compile with C++11 by default.

Your teacher gave you that screenshot as the error message? The heck? In a sane world, your teacher would give you the actual compiler error, and not a useless pop-up message. Ask for the actual compiler message!

In other words, what I'm saying is to get rid of C++11 features.

Try to compile your program using cpp.sh and select "C++98" as the compiler standard.
The most glaring thing is the use of raw strings, which is a feature new to C++11. But I'm not your teacher, so this is just me guessing as to what the problem could be.

Last edited on
Ooo thanks for the tip, yeah I had other people confirm it to be working on codeblocks and using other compilers. I don't know what I'm gonna do, I asked him now if he can send me the compiler errors at least.
That's quite funny that he sent a picture of the dialog box LOL.
https://imgur.com/a/06cLECl
In code blocks, you need to select project->build options and tick the required language standard.
Topic archived. No new replies allowed.