Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
After I switched to Xubuntu Linux I am getting this error when linking with ld.
start.o:start.o:(.text+0x1): undefined reference to `__main'
start.o:start.o:(.text+0xb): undefined reference to `__atexit'
main.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x129): undefined reference to `__dso_handle'
main.cpp:(.text+0x13d): undefined reference to `__cxa_atexit'
support.o: In function `_main':
support.c:(.text+0x9): undefined reference to `_CTOR_LIST__'
support.o: In function `_atexit':
support.c:(.text+0x3b): undefined reference to `_DTOR_LIST__'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/auszero/Programming/ChihuahuaOS/v0.01/Source'
make: *** [all] Error 2
1. -fno-leading-underscore as described in at least tens of threads here, or make a cross compiler (!) since you are not developing for linux.
2. Create _dso_handle and _cxa_atexit as described on iirc the wiki
Okay, I take that first back. Why in gods name are you creating _main and using __main in assembly? What about using the same name in both if you want them to match up?
I fixed one problem, but I still get these errors:
main.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x129): undefined reference to `__dso_handle'
main.cpp:(.text+0x13d): undefined reference to `__cxa_atexit'
support.o: In function `_main':
support.c:(.text+0x9): undefined reference to `_CTOR_LIST__'
support.o: In function `atexit':
support.c:(.text+0x3b): undefined reference to `_DTOR_LIST__'
Do you reference __dso_handle, tatic_initialization_and_destruction_0(int, int), __cxa_atexit, _CTOR_LIST__, or _DTOR_LIST__ anywhere in your code or is LD or GCC doing that?