Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 20th, 2008, 3:29 AM   #1
lucifer
Programmer
 
lucifer's Avatar
 
Join Date: Oct 2005
Posts: 84
Rep Power: 4 lucifer is on a distinguished road
Missing Main In Allegro

Hi
I am learning allegro API but whenever i include "allegro.h" in mine code i get the following error
Quote:
template error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
I m using VS2005 but i get same type of message from DevC++ n code::blocks also
here is mine code
#include <iostream>
#include <string>
#include <limits>
#include <vector>
#include <allegro.h>
using namespace std;

template< typename X > 
 X add(X t1,X t2)
 {
	 return t1+t2;
 }

int main()
{
	string str1 = "umesh";
	string str2 =" Rocks";
	cout<<add(4,5)<<endl;
	cout<<add(93.5,6.99)<<endl;
	cout<<add(str1,str2)<<endl;
	getchar();
	cout<<endl;
	cout<<endl;
	int x =10;
	return 0;
	getchar();
}
__________________
"You're good... but me, I'm magic"

Last edited by big_k105; Feb 20th, 2008 at 10:57 AM. Reason: Changed Code tags
lucifer is offline   Reply With Quote
Old Feb 20th, 2008, 2:49 PM   #2
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 261
Rep Power: 4 Cache is on a distinguished road
Re: Missing Main In Allegro

Read the Allegro documentation. Some libraries require that 'main' have a specific signature. You may also be required to set the entry point.

If you just want to fumble about try:
int main(int argc, char* argv[])
{
    return 0;
}
Cache is offline   Reply With Quote
Old Feb 20th, 2008, 3:20 PM   #3
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 4 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
Re: Missing Main In Allegro

http://www.loomsoft.net/resources/al...ut_lesson1.htm

"END_OF_MAIN() // This must be called right after the closing bracket of your MAIN function.
// It is Allegro specific."
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Return type - main() / ISO C standard sharadpro C 2 Mar 14th, 2007 6:02 AM
C# corruption!!! Kilo C++ 32 May 21st, 2006 8:44 PM
OOT Program Examples Sane Other Scripting Languages 4 Nov 25th, 2005 12:06 AM
noob questions about main() format linuxpimp20 C 16 Jul 11th, 2005 7:48 AM
Returning a value from a variable to the main function colt C 3 Apr 28th, 2005 7:56 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:38 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC