Dev c++ telling me project is not compiled

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 26766 Views - Last Post: 29 February 2012 - 09:52 PM Rate Topic: -----

#1 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Dev c++ telling me project is not compiled

Post icon  Posted 01 February 2009 - 10:26 AM

hello well i just started c I'm learning it. my question is why is Dev c++ telling me the project is not compiled ? i saved it and i compiled it every time i i try to run the program it tells me the project in not compiled

i'm using Dev c++ 4.9.9.2

trying to do the basic hello world in c

here is the code i wrote in dev c++
 
main()
{
	  printf("helloworld\n");
	   getchar();
}



i mad a project and then i the source file ? i seve the source file as hello world.c
and the project as hello

what am i doing wrong

it say's i have 2 errors in the compile log

[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] ["hello] Error 1

why am i using the getchar();

well i just following the tutorial

it dosnt work ether way with or with out getchar();

i'm not sure witch one is the one to look at ?

this is from the compiler ?

[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] ["hello] Error 1


this is from compiler log

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c "hell world.c" -o "hell world.o" -I"C:/Dev-Cpp/include"

gcc.exe "hell world.o" -o "hello .exe" -L"C:/Dev-Cpp/lib"

/mingw/lib/crt2.o(.text+0x37):crt1.c: undefined reference to `__cpu_features_init'
collect2: ld returned 1 exit status

make.exe: *** ["hello] Error 1

Execution terminated

This post has been edited by combox27: 01 February 2009 - 11:11 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Dev c++ telling me project is not compiled

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4359
  • View blog
  • Posts: 12,176
  • Joined: 18-April 07

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 10:30 AM

Well first of all when a compiler reports errors in the code, it doesn't compile. The error prevents it from compiling. So it would be helpful if you show us the error messages you are getting.

And also keep in mind that if a program does compile it doesn't mean that it is going to be correct. It just means you don't have any "compile time" errors. You can still have "run time" errors when you run it.

:)
Was This Post Helpful? 1

#3 OrganizedChaos  Icon User is offline

  • D.I.C Head

Reputation: 39
  • View blog
  • Posts: 153
  • Joined: 29-November 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 10:42 AM

1. C is not the same as C++
2. You have no #include<iostream> statement at the top of your code
3. Why are you using getchar()?

Posting the error messages always helps, too.
Was This Post Helpful? 0
  • +
  • -

#4 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 11:03 AM

[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] ["hello] Error 1

why am i using the getchar();

well i just following the tutorial

it dosnt work ether way with or with out getchar();

i'm not sure witch one is the one to look at ?

this is from the compiler ?

[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] ["hello] Error 1


this is from compiler log

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c "hell world.c" -o "hell world.o" -I"C:/Dev-Cpp/include"

gcc.exe "hell world.o" -o "hello .exe" -L"C:/Dev-Cpp/lib"

/mingw/lib/crt2.o(.text+0x37):crt1.c: undefined reference to `__cpu_features_init'
collect2: ld returned 1 exit status

make.exe: *** ["hello] Error 1

Execution terminated
Was This Post Helpful? 0
  • +
  • -

#5 claudio  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 29-January 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 11:41 AM

Hello and good afternoon.

So if you're getting that error, you probably have more than one MinGW & Msys instance installed?

After Googling for a while I found out best choice is to re-install Dev C++ in preference in a new directory.

Hope what I'm saying is right.

Also, for start, you need an header there. For that you should probably use:

#include <iostream.h>  


int main()
{
//Desired operations
}



Was This Post Helpful? 1
  • +
  • -

#6 FrozenSnake  Icon User is offline

  • En man från Sverige!

Reputation: 122
  • View blog
  • Posts: 998
  • Joined: 30-July 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 12:01 PM

// C++ Code
#include <iostream>

int main()
{
	printf("helloworld\n");
	getchar();
}

// C code
#include <stdio.h>

int main()
{
	printf("helloworld\n");
	getchar();
}




You need to use the headerfiles that contains the functions you want to use, the compiler does not know what printf() or getchar() is without the headerfile

C++
iostream is the headerfile to use with C++

C
stdio.h is the headerfile to use with C

Some tutorials show code as
int main()
{
	printf("helloworld\n");
}

but later on or before tells the reader that he are suppose to use one or more headers. In this case iostream for C++ and stdio.h for C

This post has been edited by FrozenSnake: 01 February 2009 - 12:04 PM

Was This Post Helpful? 0
  • +
  • -

#7 mono15591  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 406
  • Joined: 05-November 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 12:03 PM

Quote

why am i using the getchar();


you using that so your program doesn't close as soon as you start it
getchar();basically just waits for user input and then when you hit enter the program will end

right?
Was This Post Helpful? 0
  • +
  • -

#8 FrozenSnake  Icon User is offline

  • En man från Sverige!

Reputation: 122
  • View blog
  • Posts: 998
  • Joined: 30-July 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 12:14 PM

View Postmono15591, on 1 Feb, 2009 - 11:03 AM, said:

you using that so your program doesn't close as soon as you start it
getchar();basically just waits for user input and then when you hit enter the program will end

right?

Correct, cin.get() doesn't work in C =)
well It maybe works if you tinker a bit with some headers :P but it wouldn't be ANSI/ISO and if you doesn't stick to well known standards people cant help :P

This post has been edited by FrozenSnake: 01 February 2009 - 12:19 PM

Was This Post Helpful? 0
  • +
  • -

#9 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 01:19 PM

View Postclaudio, on 1 Feb, 2009 - 10:41 AM, said:

Hello and good afternoon.

So if you're getting that error, you probably have more than one MinGW & Msys instance installed?

After Googling for a while I found out best choice is to re-install Dev C++ in preference in a new directory.

Hope what I'm saying is right.

Also, for start, you need an header there. For that you should probably use:

#include <iostream.h>  


int main()
{
//Desired operations
}



im deleting all the compiler and restart my pc
Was This Post Helpful? 0
  • +
  • -

#10 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 04:19 PM

View Postcombox27, on 1 Feb, 2009 - 12:19 PM, said:

View Postclaudio, on 1 Feb, 2009 - 10:41 AM, said:

Hello and good afternoon.

So if you're getting that error, you probably have more than one MinGW & Msys instance installed?

After Googling for a while I found out best choice is to re-install Dev C++ in preference in a new directory.

Hope what I'm saying is right.

Also, for start, you need an header there. For that you should probably use:

#include <iostream.h>  


int main()
{
//Desired operations
}



im deleting all the compiler and restart my pc


i think i should use a different compiler i'm learning c what is a good c compiler
Was This Post Helpful? 0
  • +
  • -

#11 FrozenSnake  Icon User is offline

  • En man från Sverige!

Reputation: 122
  • View blog
  • Posts: 998
  • Joined: 30-July 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 04:43 PM

GCC is a good one.
A good IDE is Dev-Cpp. I think Dev-Cpp uses GCC.

And C do not have iostream use stdio.h
read this
Was This Post Helpful? 0
  • +
  • -

#12 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 05:05 PM

View PostFrozenSnake, on 1 Feb, 2009 - 03:43 PM, said:

GCC is a good one.
A good IDE is Dev-Cpp. I think Dev-Cpp uses GCC.

And C do not have iostream use stdio.h
read this

but i never put
#include <iostream>
in my code ?

and i didn't put int main () what is that for in the tutorial lol i haven't moved on because i have not found out my problem i did get codebreaker but i hing i'm getting the same thing as a problem omg

can i have a link to the gcc ? what you thing is a good c compiler

This post has been edited by combox27: 01 February 2009 - 05:07 PM

Was This Post Helpful? 0
  • +
  • -

#13 Blade2021  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 204
  • Joined: 31-October 08

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 05:12 PM

its very obvious that you are not taking time to read the replies to this post. I have over read them all and they explain answers to all your questions you have listed. I suggest you read over the replies that these users have taken their time to help you with.
Was This Post Helpful? 0
  • +
  • -

#14 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 07:49 PM

check this forum this guy is having the same problem as me but the is so much mix talk i can find out if they fix the problem ?

http://forums.devshe...led-409726.html
Was This Post Helpful? 0
  • +
  • -

#15 combox27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 01-February 09

Re: Dev c++ telling me project is not compiled

Posted 01 February 2009 - 08:02 PM

View PostBlade2021, on 1 Feb, 2009 - 04:12 PM, said:

its very obvious that you are not taking time to read the replies to this post. I have over read them all and they explain answers to all your questions you have listed. I suggest you read over the replies that these users have taken their time to help you with.



this is my 10th time reading over them and i still get the same warning witch is "project is not compiled "

my code that im working on now from my tutorial
is
#include <stdio.h>
int main()
{
/*my veriables box*/	  
  int age;
  int whatsyourage;
/* my veriables box end*/  
  
	printf("hello world\n");
	age = 20;
	printf("my age is %d\n",age);
	printf ("pleas enter your age:");
	scanf("%d",&whatsyourage);
	printf("the age you entered is %d\n",whatsyourage);
	
	fflush(stdin);
	getchar(); 
	return 0;

}




and the 2 errors are

[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] [yohello.exe] Error 1
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2