| | |
Error message "Linker error"????
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 15
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Oct 2009
Posts: 15
Reputation:
Solved Threads: 0
•
•
•
•
You created a windows gui project, not a windows console project. Start again, but this time create the right kind of project.
Thanks very much for your help.
John
![]() |
Similar Threads
- Please find and correct the error in my c++ program. "Linker Error: Undefined symbol (C++)
- "run time error 53" file not found (Visual Basic 4 / 5 / 6)
- Disk Utility says, "unknown error -20" (Storage)
- "Unable to change Browser Settings" Error Message. (Windows NT / 2000 / XP)
- "Error message when installing w2k pro" (Windows NT / 2000 / XP)
- "Error message when starting Microsoft Word" (Viruses, Spyware and other Nasties)
- "Run a DLL as an APP" error message on startup (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: hash table /independent rehaching
- Next Thread: Need help with FOR repitition with Switch
| Thread Tools | Search this Thread |
api application array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






