Help need for programming link list in DeV c++..

  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

80 Replies - 6550 Views - Last Post: 17 July 2012 - 11:25 AM Rate Topic: **--- 3 Votes

#1 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Help need for programming link list in DeV c++..

Posted 02 May 2012 - 10:38 PM

Hello,

I am new to programming but i have done basic input output operation, now i want to go for link list programming starting from single list.

so, before that i am having problem with DEv C++ comipler it is not compiling source file.

code is:->
Code:

#include <iostream>
int main()
{
using namespace std;
cout << "hey";
system("pause");
return 0;
}


Select All
and error listed below are.

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

This post has been edited by JackOfAllTrades: 15 May 2012 - 08:58 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Help need for programming link list in DeV c++..

#2 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 10:43 PM

I always thought it was
system("PAUSE")
. Remember that C++ is case-sensitive!
Was This Post Helpful? 1
  • +
  • -

#3 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:09 PM

NOW ALSO IT FILE not compiled!!


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
Was This Post Helpful? 0
  • +
  • -

#4 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:17 PM

PLEASE DON'T POST IN SHOUTING!
You could look here: http://www.cplusplus...m/beginner/485/

This post has been edited by DimitriV: 02 May 2012 - 11:17 PM

Was This Post Helpful? 1
  • +
  • -

#5 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:28 PM

Hi again,

I am getting you what to do for removing linker error, i have seen that link but not getting what to do of that code??
Was This Post Helpful? 0
  • +
  • -

#6 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:33 PM

Near the bottom in that page. It highlights a potential cause to the error.
Was This Post Helpful? 1
  • +
  • -

#7 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:45 PM

A better solution would be to get rid of Dev-C++ and install CodeBlocks instead.

Dev-C++ version 4 was obsolete 5 or more years ago and version 5 never got out of beta and is obsolete.
Was This Post Helpful? 1
  • +
  • -

#8 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 02 May 2012 - 11:48 PM

Really? I never would have thought of it.
Was This Post Helpful? 1
  • +
  • -

#9 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 12:00 AM

Really. I stopped using Dev-C++ at least 6 years ago. I don't think you'll find many serious programmers recommending it.
Was This Post Helpful? 1
  • +
  • -

#10 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 12:11 AM

Ok, after downloading code block:-
I have written this code from some web.

#include <iostream>

int main()
{
 std::cout << "hello world! << std::endl;
 return 0;
}


showing error
fatal error iostream not found!
Was This Post Helpful? 0
  • +
  • -

#11 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 12:16 AM

Maybe look here: http://wiki.codebloc...piling_(errors)
I'm not such an expert on compilers but the wiki for code blocks seems a good place to start.
Was This Post Helpful? 1
  • +
  • -

#12 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 01:54 AM

OK, now the code is working fine but i don't understand why we require to add..
std::cout << "hello world\n";

what it is important to add std:: without it shows error..
Was This Post Helpful? 0
  • +
  • -

#13 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 02:13 AM

It just means that cout is in the std namespace. If you want, use this inside your code:
#include <iostream>
int main(){
using namespace std;
cout << "hi";
system("PAUSE");
}

Or something like that :)
Was This Post Helpful? 1
  • +
  • -

#14 RRITESH  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 30
  • Joined: 02-May 12

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 02:24 AM

So, i was writing a code for comparing int number and returning output, it was working fine as i want to do.
but in top i don't understand the use of int main(), as typing void main() shows and error can we write char main()??

#include <iostream>

using namespace std;
 int main() {
     int a;
   cout << "hello world\n";
   cin>>a;
   if (a==2)
   cout<<"right";
   else
   cout<<"wrongh";

 }


but i want to compare char then what to do??
Was This Post Helpful? 0
  • +
  • -

#15 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Help need for programming link list in DeV c++..

Posted 03 May 2012 - 02:25 AM

Did that code work for you? I hope it did.
Is the issue resolved now?
Was This Post Helpful? 1
  • +
  • -

  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »