Using xcode to compile command/developer/platforms/iphonesimulator. Platform/developer/usr/bin/g ++-4.2 failed with exit code 1
I have been searching online for a long time to explain various reasons, but most of them refer to redefinition of variables or static variable names. If you cannot find a redefined location for this project, it is likely to be the same as my personal problem,
I personally summarized the reasons.
1. the header file of the defined global variables is included in multiple files, which is also my problem.
Solution:
You can use the getdocument function in MFC to obtain the corresponding pointer.
Threadpool* Getthreadpool (IntMaxthreads)
{
Static Threadpool* Threadpool =Null;
If(Threadpool =Null)
{
Threadpool = new threadpool (maxthreads );
Return Threadpool;
}
ReturnThreadpool;
}
2. Duplicate static variables
3. Duplicate global variables