Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » undefined reference to 'WinMain@16'

This thread is locked; no one can reply to it. rss feed Print
undefined reference to 'WinMain@16'
Shade
Member #1,152
April 2001
avatar

Somehow this code refuses to compile:

1#include <stdio.h>
2#include "allegro.h"
3 
4int main(int argc, char *argv[]){
5double demping;//getal tussen 0 en 1 => 0maximale,1minimale demping
6int x,y;
7int buffer1[101][101],buffer2[101][101],temp[101][101];
8 
9//begin loop
10while(!kbhit()){
11for (x=1;x<100;x++){
12 for (y=1;y<100;y++){
13 buffer2[x][y]=(buffer1[x-1][y]+buffer1[x+1][y]+buffer1[x][y+1]+buffer1[x][y-1])/2-buffer2[x][y];
14 buffer2[x][y]=buffer2[x][y]*demping;
15 }}//for
16 //display buffer2
17 printf("buffer2 \n");
18 //ipv de buffers te wisselen gaan we gewoon een 2e ronde doen met omgekeerde
19 for (x=1;x<100;x++){
20 for (y=1;y<100;y++){
21 buffer1[x][y]=(buffer2[x-1][y]+buffer2[x+1][y]+buffer2[x][y+1]+buffer2[x][y-1])/2-buffer1[x][y];
22 buffer1[x][y]=buffer1[x][y]*demping;
23 }}//for
24 //display buffer1
25 printf("buffer1 \n");
26}//end while
27}

I always get the same linker problem:

Quote:

C:\DEV-CPP\LIB/libmingw32.a(main.o)(.text+0x8d):main.c:undefined reference to 'WinMain@16'

No matter what I do as long as #include "allegro.h" or #include <allegro.h>
is used it refuses to compile properly.

Other projects using the allegro library are compiling just fine???

I checked the Dev-Cpp helpfiles but this says I forgot to put in a main() function,if not I should compile a second time(but even aftere the 10th time and the 4th restart of Dev-C it gives the same problem.)
I also made sure there is a link to the allegro library in the project options...

I have no clue what the problem could be.

Shade

23yrold3yrold
Member #1,134
March 2001
avatar

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Shade
Member #1,152
April 2001
avatar

:o

thank you very much,you saved my day.

It works...:o

Is this because I added the" #include allegro.h " I now need to use END_OF_MAIN???
(just curious)

Shade???

spellcaster
Member #1,493
September 2001
avatar

yes.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Shade
Member #1,152
April 2001
avatar

hmm...I better never forget this again:-[

Shade

DanielH
Member #934
January 2001
avatar

Evert
Member #794
November 2000
avatar

Let me guess: you've been using DJGPP up until this point, right? ;)

23yrold3yrold
Member #1,134
March 2001
avatar

See? One word posts can be helpful ;)

Shouldn't END_OF_MAIN() link to the docs like the other functions (I know; it's a macro ::)) ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Go to: