Error message "Linker error"????

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2009
Posts: 15
Reputation: discovery-power is an unknown quantity at this point 
Solved Threads: 0
discovery-power discovery-power is offline Offline
Newbie Poster

Error message "Linker error"????

 
0
  #1
Nov 2nd, 2009
Hi All,

I am trying to write a small program to better understand and practise writing blocks of code, I have written the one below but get the error message :

"Linker Error undefined reference to WinMain@16
ld returned 1 exit status"

// This program demonstrates a block of code

#include <iostream>
using namespace std;

int main() {
double result, n, d;

cout << "Enter Value: ";
cin >> d;

// The target of this is the entire block.

if(d != 0) {
cout << "d does not equal zero so division is OK" << "\n";
result = n / d;
cout << n << " / " << d << " is " << result;
}

cin.ignore(1024, '\n');
cin.get();

return 0;

}

can anyone tell me where I am going wrong.

Thanks

John
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,473
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1478
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning
 
-7
  #2
Nov 2nd, 2009
You created a windows gui project, not a windows console project. Start again, but this time create the right kind of project.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 15
Reputation: discovery-power is an unknown quantity at this point 
Solved Threads: 0
discovery-power discovery-power is offline Offline
Newbie Poster

how did i do it??

 
0
  #3
Nov 3rd, 2009
Originally Posted by Ancient Dragon View Post
You created a windows gui project, not a windows console project. Start again, but this time create the right kind of project.
Thanks for the reply and this is going to sound like a daft question, but can you tell me which line of code made it a windows gui, because I just opened a new source project and entered the entire program myself, I didnt go to the open new project options and choose windows gui or console.

Thanks very much for your help.

John
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 47
Reputation: Fbody is an unknown quantity at this point 
Solved Threads: 6
Fbody Fbody is offline Offline
Light Poster
 
0
  #4
34 Days Ago
EDIT: nvm.......
Last edited by Fbody; 34 Days Ago at 2:32 pm.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC