Problems with setting up an ace development environment in Windows

Source: Internet
Author: User

 

Recently, the ace environment was set up in Windows 7 + vs 2008 and encountered a number of problems. Here we will list and provide corresponding solutions (of course, Google is the main one ).

Refer to the following documents: Ace Installation Guide and sample steps.

 

The first problem encountered during the compilation of ACE project files is similar to the following error:

 

1> E:/vrmarinemy/scene3d. H (91): Error c2146: syntax error: Missing ";" (before the identifier "m_treemanager)
1> E:/vrmarinemy/scene3d. H (91): Error c4430: The type descriptor is missing-it is assumed to be Int. Note: C ++ does not support default int
1> E:/vrmarinemy/scene3d. H (91): Error c4430: The type descriptor is missing-it is assumed to be Int. Note: C ++ does not support default int

 

I checked on the Internet and found that the problem had been solved for a long time. I began to suspect that it was an operating system problem (I used Windows 7), or a different problem with the tool vs 2008, I even suspected that there was a problem in the ace source file.

At last, we found that one step in the installation process is to create a config. h file. Add a sentence # include "config-win32.h ".

The source code ace_wrappers/ace directory already has such a file config. h, so I took it for granted to add the # include "config-win32.h" in the file; but this is actually the cause of the first problem. I deleted the existing config. h In the directory, re-created the file, and added the contained header file information. The first problem was solved.

 

 

The second problem is

An error occurred while compiling the ace source file: Error c2471: Unable to update the program database

The solution obtained by searching on the Internet is to refer to this article:

{

Http://blog.csdn.net/zhuangshn/archive/2010/04/23/5520324.aspx

When the program under vs2005 is moved to vs2008, error c2471 occurs: The program database "D:/work/project/fbreader/debug/vc90.pdb" cannot be updated"

Fatal error c1083: Unable to open the program database file: "D:/work/project/fbreader/debug/vc90.pdb": no such file or directory ..

 

Solution: Modify the project properties and right-click the project --> "properties"

1. Set "C/C ++" --> "general" --> "debugging information format" to "C7 compatibility (/z7 )"

2. "C/C ++" --> "code generation" --> "enable string pool" is set to "Yes (/GF )"

3. "linker" --> "debugging" --> "generate debugging information" is set to "Yes (/debug )"

}

 

After compilation, compile your own project to test whether the generated ace library file can be used by your application,

Create a project named acetest1. The source code is as follows:

# Include "stdafx. H "<br/> # include <ACE/OS. h> <br/> # include <ACE/task. h> <br/> class ha_commandhandler: Public ace_task_base <br/>{< br/> Public: <br/> virtual int SVC (void) <br/>{< br/> ace_debug (lm_debug, <br/> ace_text ("(% t) handler thread running/N "))); <br/> ace_ OS: Sleep (4); <br/> return 0; <br/>}< br/> }; <br/> // int _ tmain (INT argc, _ tchar * argv []) <br/> int ace_tmain (INT argc, ace_tchar * []) <br/>{< br/> ace_debug (lm_debug, <br/> ace_text ("(% t) main thread running/N "))); <br/> ha_commandhandler handler; <br/> int result = handler. activate (); <br/> ace_assert (result = 0); <br/> handler. wait (); <br/> return 0; <br/>} 

You must configure

 

Right-click the project-properties, configure properties-> linker-> General-> additional library directory "C:/1 work/allocs/source code/ace_wrappers/lib"

Configure properties-> linker-> input-> Add dependencies to aced. Lib

 

 

During the compilation of the ACE library, you should note that (Windows 7 system + vs2008 may be used. Remember to find a system bug ): right-click ACE project-properties, configure properties-> linker-> General-> enable incremental link, and set it to no (/Incremental: no ). Note: This setting is only required when compiling ace and other library projects, but does not need to be set for self-built project projects.

Otherwise, an error will be reported during the link process:

1> link... <br/> 1> link: C:/1 work/allocs/source code/ace_wrappers/ACE/debug/acetest1.exe is not found or is not generated by the previous incremental link; executing full link <br/> 1> acetest1.obj: Error lnk2019: external symbol that cannot be parsed "_ declspec (dllimport) Public: int _ thiscall ace_main_base: Run (INT, char ** const) "(_ imp _? Run @ ace_main_base @ qaehhqapad @ Z), which is referenced in function _ main <br/> 1> acetest1.obj: Error lnk2019: the external symbol "_ declspec (dllimport) Public: _ thiscall ace_main_base: ace_main_base (void)" (_ imp _?? 0ace_main_base @ Qae @ xz). This symbol is used in the function "public: _ thiscall ace_main: ace_main (void )"(?? 0 ace_main @ Qae @ xz) referenced <br/> 1> acetest1.obj: Error lnk2019: the external symbol that cannot be parsed "_ declspec (dllimport) public: virtual _ thiscall ace_main_base ::~ Ace_main_base (void) "(_ imp _?? 1ace_main_base @ UAE @ xz). This symbol is used in the function "public: Virtual _ thiscall ace_main ::~ Ace_main (void )"(?? 1ace_main @ UAE @ xz) is referenced 

 

Otherwise, an error similar to the following may occur:

Link: C:/Documents and Settings/ztne/My Documents ents/Visual Studio 2005/projects/directxstudy/debug/draw not found. DLL or the previous incremental link does not generate it; a full link is being executed

 

In addition, you need to set project dependencies before generating the project, right-click acetest1-Project dependencies, and project acetest1 depends on Project ace.

 

Right-click the project and complete the project generation.

 

However, when running the project, the following error occurs: unable to start the program because the computer lost aced. dll. Try to reinstall this program to solve this problem.

 

At that time, no solution was found. However, it is the cause of environment variables that copies the generated acetest1.exe to the directory that generates aced. dll.

No problem with setting environment variables,

1. Add a system environment variable named ace_root to the operating system. The value is the source file path C:/1 work/allocs/source code/ace_wrappers of the ace.

2. Add the system path environment variable with the value % ace_root %/lib to ensure that the system can find the dynamic Connection Library generated by Ace.

 

However, after compilation, the above errors always occur.

 

The next day, after restarting, I found that there was no problem when the program was compiled and generated and run. It turned out that the system environment variable was set after vs2008 was enabled. Only after vs2008 was restarted, the configured system environment variables take effect.

 

So far, the ace environment has finally been set up.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.