#C++ Hello World

15 messages · Page 1 of 1 (latest)

swift citrus
#

Im struggling with this error what im doing wrong?

flint dune
#
  1. Did you watch the video on the Hello World page?
  2. Please use text/codeblocks and not images to share text. Pixels are hard to copy/paste and sometimes to even read.
#

C++ Hello World

wind questBOT
#

Asking questions well increases your chance of getting help. Learn how to write good support requests in this article: http://bit.ly/howto-ask

flint dune
#

@swift citrus ?

swift citrus
#

emm sooo thats the code that i have:

 #include "hello_world.h"
#ifdef EXERCISM_TEST_SUITE;
#include "test/catch.hpp"
#include <string>

TEST_CASE("Hello, World")
{
    REQUIRE(hello_world::hello() == "Hello, World");
}

and thats the error what is wrong with code?

We received the following error when we ran your code:
/tmp/hello-world/hello_world.cpp:2:27: error: extra tokens at end of #ifdef directive [-Werror]
    2 | #ifdef EXERCISM_TEST_SUITE;
      |                           ^
/tmp/hello-world/hello_world.cpp:2: error: unterminated #ifdef
    2 | #ifdef EXERCISM_TEST_SUITE;
      | 
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/hello-world.dir/build.make:90: CMakeFiles/hello-world.dir/hello_world.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/hello-world.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
flint dune
#

That looks like the test code, not your solution code

#

Did you watch the video?

swift citrus
#

yas i watched the guy told me to edit the code ive got soooo i edited it

flint dune
#

You might want to click the ... in the top right and reset your solution first

#

You're not supposed to edit the test file

swift citrus
#

ooooooooo okeeey that make sens

#

aaaa okey thx sm

flint dune
#

Got it working?

wind questBOT
#

If everything is resolved, we ask that people react to the top/original post with a :white_check_mark: (:white_check_mark:). This indicates to others that this issue has been resolved and locks the thread.
If all the tests pass and you want to further improve your solution, we encourage you to use the "Request a Code Review" feature on the website!