![]() |
| | #1 |
| Guest
Posts: n/a
| Linking 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) 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 |
|
| | #2 |
| Registered User Join Date: Dec 2001
Posts: 70
| int __cdecl main () or go to settings menu and set __cdecl as default calling convetion. enjoy. |
| golem is offline | |
| | #3 |
| Guest
Posts: n/a
| 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 |
|
| | #4 |
| Registered User Join Date: Nov 2001
Posts: 343
| Code: #include "iostream.h" Code: #include <iostream> using namespace std; |
| foniks munkee is offline | |
| | #5 |
| Registered User Join Date: Sep 2002
Posts: 1,640
| You forgot END_OF_MAIN(); at the end of main Code: int main()
{
return 0;
}
END_OF_MAIN();
|
| Travis Dane is offline | |
| | #6 | |
| Registered User Join Date: Dec 2001
Posts: 70
| Quote:
| |
| golem is offline | |
| | #7 |
| Guest
Posts: n/a
| 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) |
|
| | #8 |
| Registered User Join Date: Sep 2002
Posts: 1,640
| Could you post you're entire code please? |
| Travis Dane is offline | |
| | #9 |
| Guest
Posts: n/a
| 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 |
|
| | #10 |
| Registered User Join Date: Sep 2002
Posts: 1,640
| 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();
|
| Travis Dane is offline | |
| | #11 |
| Guest
Posts: n/a
| 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 |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beginner Needs help in Dev-C++ | Korrupt Lawz | C++ Programming | 18 | 05-02-2009 12:27 PM |
| Post... | maxorator | C++ Programming | 12 | 10-11-2005 08:39 AM |
| pointer to array of objects of struct | undisputed007 | C++ Programming | 12 | 03-02-2004 04:49 AM |
| Stupid compiler errors | ChrisEacrett | C++ Programming | 9 | 11-30-2003 05:44 PM |
| Couple C questions :) | Divx | C Programming | 5 | 01-28-2003 01:10 AM |