Undefined reference to '_WinMain@16'?

closed account (jwC5fSEw)
Here's my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
using namespace std;

struct intStruct{
    int num;
};

void change(intStruct* test, int input){
    test->num = input;
}

void display(intStruct* test){
    cout << "The number is " << test->num;
}


It took me a while to get this working properly, and once I pruned all the errors out a new one popped up:

undefined reference to '_WinMain@16'

It doesn't reference a line, and I have no idea what it means. Any help here?
Do you have a main function?
closed account (jwC5fSEw)
Huh. I didn't realize a program needed a main function to compile. Thanks for the assistance!
It needs a main function to be able to link to an executable. (You are getting a linker error, not
a compile error).
you need a main() function where you use your functions.something like

int main()
{
int Number;
struct intStruct Test;

cout << "Enter a number\n"
cin >> Number;
change(Test,Number);
display(Test);
return 0;
}
Topic archived. No new replies allowed.