Error LNK1120 only on this computer!

I'm making a program for my university coursework which is to make a 3 question, multiple choice quiz. I emailed my half finished code to myself and when I loaded it onto my laptop, error LNK1120 popped up. This was not an the other computer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <cstdlib>
#include"stdahx.h"
#include <iostream>
using namespace std;




int main(void)
{
int X = 0;
string questions[100]={};
string questionAnswers[100][100]={};

questions[0] = "What is the function of a binary Adder?";
questionAnswers[0][1] = "To add two binary number together.";
questionAnswers[0][2] = "To add two numbers together.";
questionAnswers[0][3] = "To add two denary numbers together.";
questionAnswers[0][4] = "Potato";

questions[1] = "What is the purpose of the stack?";
questionAnswers[1][1] = "A data structure that stores information about the active subroutines of a computer program.";
questionAnswers[1][2] = "A date structure.";
questionAnswers[1][3] = "A place where algorithms go.";
questionAnswers[1][4] = "A place where Potato's go.";

questions[2] = "What is the difference between DC and AC?";
questionAnswers[2][1] = "DC is a constant current while AC alternates from positive to negative";
questionAnswers[2][2] = "DC is the opposite to AC";
questionAnswers[2][3] = "DC is good electricity and AC is bad electricity.";
questionAnswers[2][4] = "One is made with Potato's, the other isn't.";


cout << "Welcome to the test!\n\n";
system("PAUSE");
cout << "\nAll questions are multiple choice,\nso answer each question with either 1, 2, 3 or 4.\n\n";
system("PAUSE");
cout << "\nCorrect answer is worth 2 marks, a mostly correct answer is worth 1 mark,\na wrong answer is worth 0 marks and a very wrong answer is worth -1 marks.\n\n";
system("PAUSE");
cout << "\nOk, lets go!\n\n";
system("PAUSE");
system("CLS");

while (X == 0)
{

X++;

cout << "Question " << X <<":\n";

X = X - 1;

cout << questions[X] << "\n";
cout << "1. " << questionAnswers[X][1] << "\n";
cout << "2. " << questionAnswers[X][2] << "\n";
cout << "3. " << questionAnswers[X][3] << "\n";
cout << "4. " << questionAnswers[X][4] << "\n";





X++;
}

system("PAUSE");
system("CLS");

cout << "WELL DONE FOR DOING GOOD.";

system("PAUSE");

return 0;


}


Please help! I've searched for fixes on the forum and none of them work!
stdahx.h

Does that even exist?
1
2
3
1
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\users\ben\documents\visual studio 2010\Projects\Assingment3\Debug\Assingment3.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


There is the error message, sorry about that.

Also, the stdahx.h was one of the fixes I added that I found when searching for a fix. It didn't work.
Did you make a console project or a Windows program? Instead, just choose "Empty project" then add your source files in there.
Yeah that worked. What a wierd problem.

Now I have this one if you want to help:

error C2451: conditional expression of type 'std::basic_string<_Elem,_Traits,_Ax>' is illegal

And this points to the line

if(questions[X] = "\0")

where X is a variable that increases in one every so often (This is something I found on the web to check whether a string array place is empty or not, so sorry if it's completely wrong)


Don't use = here, that is assignment. Use ==. Also, you want single quotes (' ') around that character, not " ", which denotes a C-string.
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion)

Did exactly what you said... I feel like I'm just being annoying...
try this:
1
2
if (questions[X]==0) //0 or NULL will work, you get a warning with NULL
//code here 
what do you want to do there?
1
2
3
std::string questions[100];
//if( questions[X] == "\0" )
if( questions[X].empty() ) //maybe this? 
Last edited on
Topic archived. No new replies allowed.