[FIXED] C++ undefined reference to main

So, I get all the steps correct, but when I get to step 4 and want to run the entire program by entering in g++ temperature.cpp I get an error message saying “undefined reference to ‘main’” but I have everything done correctly, and the information is typed in correctly word for word.

Hello, @unearthlysoap!
Is this the full text of the error you are seeing?

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

If so, your code is not causing it. It is a problem with the website that will hopefully be addressed soon.

Yes that’s exactly what is happening thank you! Glad to know I did all the correct steps!

1 Like

I can’t say for sure that you did everything correctly, but this particular error is not related to your code. :wink: