开发者

Using .dlls in my projects

Hello,

Specs: VS 2010 C++ professional edition.

I have a project with some statistical functions that I want to test. So I wrote a simple test console application which I added to the solution of the project with functions that I want to test. Here is the detailed layout of my project:

Project BASE, contains classes with functions that are used in my statistical application called ROC. And then there is roc_test, simple console application that I want to use for testing of some functions in ROC application. Now, ROC is linked to BASE and roc_test has ROC as referenced project. My problem is that when I try to compile my test project roc_test, the compiler throws an error saying that my roc_test project is missing a .dll file that belongs to project BASE. roc_test however, is not directly linked to BASE. I don't understand why it throws such a message and how I can fix it. For the sake of clarity let me try to show the relationship in a different way.

roc_test function calls rocfit(..) function, which is part of ROC.h开发者_如何学JAVA. ROC.h using functions that are written in DoubleMatrix.h, which is part of a BASE project. I hope I am being clear. P.S. There is no point in showing the code as the problem is not in the code but in the linker settings. Thanks for any help.

EDIT: My question is how do i get rid of the error? Do I also need to link my test project to the BASE? It's just doesn't make sense that I have to do it. It should be enough to link it to ROC. Am I right?


If it's not included in the same directory as the console app (or in the path), then you'll need to include BASE as the runtime can't resolve the dependancy on BASE by ROC.

Edit: Simply referencing ROC isn't enough; although there may be some build option that builds ROC and BASE and then links them into a single DLL; that could be worth investigating.

Also, instead of using a Console application, you might find it better in the long run at using unit tests. This msdn article explains how to use vs2010 test projects with C++:

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜