开发者

Building DLLs that use other DLLs in Visual Studio 2005

I'm trying to parallelize our build process in Visual Studio 2005 to take advantage of our multi-core hardware. Simplifying things a bit, I've got two DLLs and an application. DLL A has no dependencies. DLL B uses certain functions defined in DLL A. The application uses functions defined in both.

I thought I should be able to build A and B in parallel, because you shouldn't need to resolve symbols until you link the application. However, when I remove DLL B's project dependency on A, I get errors like the following:

YFindReplaceWidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: 开发者_JAVA百科virtual unsigned long __thiscall CORBBaseComponent::GetRefCount(void)const " (__imp_?GetRefCount@CORBBaseComponent@@UBEKXZ)

Is there a way to resolve these errors so I can build these DLLs in parallel?


That's... a really weird thought pattern. DLL's are nothing but EXE's with a different extensions, they need full linking information to be built.

As long as your build is a chain like that (app->b->a), they can't be built in parallel.


Microsoft officially introduced a multiprocessor built option in VS2008. It will allow the build to start multiple compilers for the same project. The easy solution is just upgrade to the latest version of Visual Studio.

If you are stuck on VS2005, then it is actually available there as well, but not officially supported. Just add /MP as an additional compiler option.

http://blog.280z28.org/archives/2007/10/17/ (Advices you NOT to use it on your buildserver)

http://msdn.microsoft.com/en-us/library/bb385193.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜