开发者

Eclipse CDT Build Configs - Testing a DLL with CPP Unit

I'm making a DLL (and probably a Linux port at some later date) in C++ using eclipse. The situation is as follows: I am trying to make two separate build configurations, one that will build a DLL and one that will build an executable CppUnit test. Currently I have all of the DLL build working, and I can make a separate project to test the DLL with; however, I was wondering if there was any way to do this all in one project.

Help on this matter would be greatly ap开发者_开发技巧preciated!

Thanks, Chris


Well, I found out how to do it, so if anyone else stumbles across this...

If you go into "Project->Properties->C/C++ Build->Settings", then select a debug configuration (or create a new one). Go to the "Build Artifact" tab, and change the "Artifact Type" to executable.

Now to avoid having all of your source code compiled into all Build Configurations (such as your main() being built into a DLL, which doesn't make much sense), go to "Project->Properties->C/C++ General->Paths and Symbols". Select your build configuration and go to the "Source Location" tab. Here you can add new source folders/remove source folders that already exist.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜