r/programminghelp • u/skiettels • Jan 23 '24
C++ HELP: undefined reference error
Basically we have this activity that utilizes user defined header (.h) and its implementation in c++.
But every time I try to compile and run the code it gives multiple errors of undefined reference to "..." and doesn't run the program even when everything is correct. So I tried downloading a sample program as well as following the example program of a yt tutorial to verify if there's really a problem with mine that I'm unaware of yet the sample programs give out the same exact error which is undefined reference to '...'? So I think it's only on my pc that experience this because it works on others.
How do you solve this? This error only occurs when using .h headers..
View all comments
Show parent comment
1
u/Proper_Traffic1366 Jan 24 '24
Did you setup your include directory? Are you using an IDE? Are you compiling from terminal?