#Trying to set up my .cpp and .h files. Returning an error. I am unsure of what is wrong.

16 messages · Page 1 of 1 (latest)

short reefBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@lusty elbow

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

elfin tide
#

!sc

short reefBOT
# elfin tide !sc
Grumpy_Pig_Skin
Please Do Not Send Screenshots or Photos!

They're hard to read and prevent copying and pasting.

#

@lusty elbow

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

elfin tide
#

What was the error?>

autumn oyster
#

ummm it seems that they forgot to add header guards as I remember

lusty elbow
#

undefined reference to `output_message(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

elfin tide
#

You did forget header guards, but also what is your command you're using to build the exe?

lusty elbow
#

g++ Main.cpp include/DFA.h -o test

#

Lemme add header guard

#

this is my first attempt at creating header files on my own

autumn oyster
#
  • Add a header guard
  • Compile normally without including the DFA.h because you're compiling the .cpp file (something like g++ main.cpp -o main)
lusty elbow
#

Thanks the command was the issue. Have two .cpp's but wasnt compiling both

short reefBOT
#

@lusty elbow Has your question been resolved? If so, type !solved :)

lusty elbow
#

!solved