关于qt :: error: collect2: ld returned 1 exit status的解决方案
(2010-10-31 20:15:34)
标签:
qt学习总结it |
分类: QT学习之路 |
关于qt :: error: collect2: ld returned 1 exit status的解决方案
今天在调QJson库的时候,遇到一个问题。
编译的时候会遇到:qt :: error: collect2: ld returned 1 exit status这个错误
在网上搜索也有很多朋友遇到了这个问题,但是没有搜索到解决办法。
QT真的很棒,甚至大家在DEBUG中遇到的问题QT都希望改善一下。
大家看看QTest头文件。看看里面给大家提供了多少调试用的宏
摘取二个经常用到的宏
QVERIFY
//看看Assistant的官方解释
The QVERIFY() macro checks whether the condition is true or not. If it is true, execution continues. If not, a failure is
recorded in the test log and the test won't be executed further.
QCOMPARE
The QCOMPARE macro compares an actual value to an expected value using the equals operator. If actual and expected are identical,
execution continues. If not, a failure is recorded in the test log and the test won't be executed further.
因为QT太灵活了,有些时候解析得到的数据没有办法很好的输出。
那么怎么办,那就不输出。直接写死几个数据,用这些宏去比较。真的比较方便的说。
呃,是不是跑题了。说了半天没有说重点怎么解决上面的BUG。
呵呵,很简单。
在PRO文件中添加//testlib即可
QT
+= testlib
相当的郁闷吧。嘎嘎!!
本文由Mark15021@devdiv.net原创!
转载需注明出处!!
今天在调QJson库的时候,遇到一个问题。
编译的时候会遇到:qt :: error: collect2: ld returned 1 exit status这个错误
在网上搜索也有很多朋友遇到了这个问题,但是没有搜索到解决办法。
QT真的很棒,甚至大家在DEBUG中遇到的问题QT都希望改善一下。
大家看看QTest头文件。看看里面给大家提供了多少调试用的宏
摘取二个经常用到的宏
QVERIFY
//看看Assistant的官方解释
The QVERIFY() macro checks whether the condition is true or not. If it is true, execution continues. If not, a failure is
recorded in the test log and the test won't be executed further.
QCOMPARE
The QCOMPARE macro compares an actual value to an expected value using the equals operator. If actual and expected are identical,
execution continues. If not, a failure is recorded in the test log and the test won't be executed further.
因为QT太灵活了,有些时候解析得到的数据没有办法很好的输出。
那么怎么办,那就不输出。直接写死几个数据,用这些宏去比较。真的比较方便的说。
呃,是不是跑题了。说了半天没有说重点怎么解决上面的BUG。
呵呵,很简单。
在PRO文件中添加//testlib即可
QT
相当的郁闷吧。嘎嘎!!
本文由Mark15021@devdiv.net原创!
转载需注明出处!!