Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Missing Main In Allegro (http://www.programmingforums.org/showthread.php?t=15220)

lucifer Feb 20th, 2008 3:29 AM

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();
}


Cache Feb 20th, 2008 2:49 PM

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;
}


Wizard1988 Feb 20th, 2008 3:20 PM

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."


All times are GMT -5. The time now is 4:13 PM.

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