Error please help :S

Hi im new to scripting and i tryed to do the famous "hello world !" but not even that simple c++ code i get to work every code i do i get some kinda error. btw i use Dev C++ 4.9.9.2

[Linker error] undefined reference to '__dyn_tls_init_callback'
[Linker error] undefined reference to '__cpu_features_init'
Id returned 1 exit status

I tryed several codes but it keeps gettin this error and i dont think im doin somethin wrong look this is the code.

#include <iostream>

int main(){
using namespace std;

cout << "Hello World !!" << endl;

system("pause");
return 0;

}


help me please !
Last edited on
take using namespace std; and put it under #include<iostream>. Also it's not a scripting language. What compiler are you using as well?
Last edited on
The using directive is fine where it is.
You're missing a #include <cstdlib>, though (or rather, you have a system("pause") too many).

What is the command line you're using to call the compiler?

Edit: never mind, I see you're using Dev-C++ and probably MinGW.
Uninstall Dev-C++ and make sure all traces of the directory you installed it to are gone.
Then install the Code::Blocks+MinGW package:
http://www.codeblocks.org/
Last edited on
closed account (z05DSL3A)
There should be no problem with the location of using namespace std;.

I would hazard a guess that something has gone wrong with the complier install.

Last edited on
I use the compiler in dev C++ so when i scripted i click on compile and run and then i get that error... but i will try to do Athar his way to uninstall and install blocks thingy
Are you using windows?

I believe System( "pause" ) is a windows call... Maybe try a platform specific Hello World example.
Yes i use windows 7 64 bit and btw without system("pause") it gives the same error :S
closed account (z05DSL3A)
It is a linker error, the code is fine. It is the tool chain that is at fault.

Dev C++ is a doddery old piece of detritus, best change it for something else.
You prefer any program that is better ?? I just deleted Dev C++ so what program do you use ??
closed account (z05DSL3A)
On windows I use Visual Studio mainly but I also have code::blocks (with MinGW) and other Compilers/IDEs installed. There is nothing stopping you installing multiple environments on the same system, it can be very useful for sanity tests.
thanks :)
Are you using windows?

I believe System( "pause" ) is a windows call... Maybe try a platform specific Hello World example.


It's not declared in windows.h if thats what you mean by "system call". Even if it was platform specific the console would still come up and say somthing like "pause is not a vaild command" or somthing of that sort.

EDIT: pause I do believe is windows specific.
Last edited on
Topic archived. No new replies allowed.