I'm very new to C++, only a few days, but I have some experience with other languages. Currently I am building a program for a class that creates a circular linked list and repeatedly "kills" every other member of the list by removing them. This continues until the only member of the linked list points to itself, revealing the winner of the deathathon.
Previously I have used Java and Actionscript, so I had to teach myself pointers for C++. I may have gotten something incredibly simple wrong with my program, but upon compiling, it returns this error:
[Linker error] undefined reference to `__dyn_tls_init_callback'
[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
I will paste my code below. I googled these errors for a while, but could not seem to find the origin of the problem. Can someone please tell me where I went wrong in my program? Thanks!
You don't include <string>, you don't return 0, you don't have anything to stop the program from closing when it ends (for example, cin.ignore().get(); ).
Besides that I really don't know what could be wrong. It compiled and worked nicely for me. There could be something wrong with your compiler settings.
Thanks for the tips, I totally forget that main is supposed to return an int...
I'm still getting the error after all the fixes, I'm not sure what the problem is. We're supposed to submit the problem on a unix system, so I'll try compiling and running it on there, but it would be nice to fix the problem locally as well.