开发者

C++ - Testing Applications with QT in VS 2008

I have a scenario where I should test an application (exe) with QT Test library. I've read that it's not possible to test application (exe) because QT will hesitate in linking phase for unresolved symbols.

The solution is to set configur开发者_运维百科ation type to Static Library (.lib) [Again according what I've read]. However, is there a good technical way to test this kind of application projects, with QT if possible?

Thanks a lot people!

SOLUTION: A bit more of background: My project was composed with only one cpp (that have the logic and the main entry point.) I wanted to test it in my QT_Test_Project.

With this scenario I have to split in three files, one for just having the main entry point (.cpp), and the other ones that have the correspondent logic (.cpp and .h)

Now in my QT_Test_Project I included just the logic header, I could compile OK, but linking phase will fail since it couldn't resolved external symbols.

With this in mind, using Visual Studio 2008, I just have to include in my QT_Test_Project the .cpp logic file as an existing one (to avoid duplicating the code.), then compile and all went as expected.

I don't really know if there is an alternative way to test this kind of things.

Hope this could help anyone.

Regards.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜