A small problem in the ACE debugging

Beginner ace did not take long, encountered a small problem today.

Specifically: After I finished writing code, compile always a error.

prompt:

ACE_TEST1.obj: error LNK2019: unresolved external symbol "int __cdecl ace_main_i (int, char * * const)" (? Ace_main_i @@ YAHHQAPAD @ Z), the symbol in the function "private: virtual int __thiscall ACE_Main :: run_i ( cited int, char * * const) "(? run_i @ ACE_Main @@ EAEHHQAPAD @ Z) in

 

Check the Internet now have some information, was said to be caused by the addition of ACEd.lib or ACE.lib, but I checked my project settings found has joined ACEd.lib. Later found out that my main function declarations in question.

The original main ACE defined as a macro that first, prior to entry function declaration: ace_main_i (int, char * []);

 Next ACE_Main defined class that implements run_i ACE_Main_Base pure virtual function in the base class, function call ace_main_i in ACE_Main :: run_i. Then he again defines ACE_MAIN function, and ACE_MAIN is a macro: "# define ACE_MAIN main", that is to say, ACE_MAIN here really define the main function.

 

So the main statements should be int main (int argc, char ** argv) of this form.

 

After solving the problem modified.

Reference from: HTTP: //blog.163.com/henan_lujun/blog/static/19538333200912054920370/
---------------------
Author: Hewlett
Source: CSDN
original: https: //blog.csdn.net/lwhans/article/details/3980651
copyright: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin blog.csdn.net/wojiuguowei/article/details/90402403