Feb 19, 2013 at 8:38pm Feb 19, 2013 at 8:38pm UTC
Hello:
I´m trying programming c with dev-c++ 4.9.9.2 in w7.
When I compile the "hello world" I receive this message.
code:
#include <stdio.h>
int main(){
printf("hello world");
// system("PAUSE");
return 0;
}
answer:
i:\gw\lib\crt2.o(.text+0x8) In function `_mingw_CRTStartup':
[Linker error] undefined reference to `__dyn_tls_init_callback'
[Linker error] undefined reference to `__cpu_features_init'
i:\gw\lib\crt2.o(.text+0x8) ld returned 1 exit status
C:\Users\trabajo\Desktop\proyectos tp\Makefile.win [Build Error] [aaaaaaaa.exe] Error 1
Feb 19, 2013 at 9:14pm Feb 19, 2013 at 9:14pm UTC
Is your linker trying to link from unavailable/unnecessary directories and files?
Go to your linker's settings, or only link the object files themself manually.
If all fails, just try to reinstall, and maybe any search directories, strange libs or linking objects will return to default.
Feb 19, 2013 at 9:38pm Feb 19, 2013 at 9:38pm UTC
I had the same issue when I reinstalled that version of Dev-C++ so it's definitely a common thing. Either your installation is corrupt, or you have more than one mingw installation on your system.
Feb 19, 2013 at 9:52pm Feb 19, 2013 at 9:52pm UTC
dont you have to include <stdio.h>
Feb 19, 2013 at 10:00pm Feb 19, 2013 at 10:00pm UTC
They did include standard I/O library "stdio.h".
The problem seems to be with linking to non-existant objects.
Feb 19, 2013 at 10:23pm Feb 19, 2013 at 10:23pm UTC
i for some reason was thinking they included stdlib
Feb 19, 2013 at 10:37pm Feb 19, 2013 at 10:37pm UTC
Version 4.9.9.2 is pretty antiquated (February 2005).
I'd suggest uninstalling it and downoad the latest version 5.4.0 instead. Note, this is Orwell Dev-C++ which is currently maintained, last update was five days ago:
http://orwelldevcpp.blogspot.co.uk/
Last edited on Feb 19, 2013 at 10:52pm Feb 19, 2013 at 10:52pm UTC