-
Linking error
This compiles OK but the linking generates the following errors : -
--------------------Configuration: One - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/One.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
One.exe - 2 error(s), 0 warning(s)
Code :
#include "iostream.h"
#include "allegro.h"
int main()
{
allegro_init();
install_keyboard();
//set_gfx_mode(GFX_VGA,320,200,0,0); //Remove "//" if want to use resolution: 320x200 instead of 640x480.
set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
set_pallete(desktop_pallete);
textout_centre(screen, font, "Hello, World!", SCREEN_W/2, SCREEN_H/2, 255);
readkey();
return 0;
}
Any help?
Thanks
-
int __cdecl main ()
or go to settings menu and set __cdecl as default
calling convetion.
enjoy.
-
Linking
The first suggestion does not seem to work.
Still get the same error message.
Not sure where to add your second suggestion (which menu).
Forgot to mention I'm a newbee and am using VC++6
Thanks
Andy
-
Code:
#include "iostream.h"
should be..
Code:
#include <iostream>
using namespace std;
-
You forgot END_OF_MAIN(); at the end of main
Code:
int main()
{
return 0;
}
END_OF_MAIN();
-
-
Now I'm getting loads of compile errors in the gfx.h header file of Allegro !!!
Oh dear !!
ompiling...
One.cpp
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\draw.h(50) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\draw.h(50) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\draw.h(51) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\draw.h(51) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(168) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(180) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(192) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(192) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(204) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(204) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(213) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(222) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(231) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(231) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(240) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\draw.inl(240) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(29) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(29) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(30) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(30) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(30) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(31) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(31) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(32) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(32) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(32) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(34) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(35) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\fmaths.h(36) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(113 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(113 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(113 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(135 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(135 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(135 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(157 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(157 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(157 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(187 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(187 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(187 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(230 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\platform\al386vc.h(246 ) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(46) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(52) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(148) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(154) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(160) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(160) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(166) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(166) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(172) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(183) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(183) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(194) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\inline\fmaths.inl(194) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(32) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(33) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(47) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(47) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(47) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(50) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(50) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(50) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(53) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(56) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(59) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(62) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(62) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(62) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(65) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(65) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(65) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(65) : error C2872: 'fixed' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(65) : error C2872: 'fixed' : ambiguous symbol
etc
:\program files\microsoft visual studio\vc98\include\allegro\matrix.h(74) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.
One.exe - 102 error(s), 0 warning(s)
-
Could you post you're entire code please?
-
This is the One.CPP file : -
#include <iostream>
using namespace std;
//#include "iostream.h"
#include "allegro.h"
int main()
//int __cdecl main ()
{
allegro_init();
install_keyboard();
//set_gfx_mode(GFX_VGA,320,200,0,0); //Remove "//" if want to use resolution: 320x200 instead of 640x480.
set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
set_pallete(desktop_pallete);
textout_centre(screen, font, "Hello, World!", SCREEN_W/2, SCREEN_H/2, 255);
readkey();
return 0;
}
END_OF_MAIN();
Any help will be great. I will check the board later when I get home.
Thanks
-
Code:
int main()
{
allegro_init();
install_keyboard();
set_gfx_mode(GFX_AUTODETECT,640,480,0,0);
set_pallete(desktop_pallete);
textout_centre(screen, font, "Hello, World!", SCREEN_W/2, SCREEN_H/2, 255);
readkey();
return 0;
}
END_OF_MAIN();
Try compiling this
-
I added this at the front of your code : -
#include <allegro.h>
It then compiles ok but when linking gives the following error :-
--------------------Configuration: One - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/One.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
One.exe - 2 error(s), 0 warning(s)
Any ideas here as until this is sorted I cannot do any graphics!
I assume it must be some setting in my project or VC++6 that is missing.
Thanks
Andy