"cannot find -ljscore" while I am trying to build Qt 4.7.1 static library
I tried to build static Qt library from the latest source, but got the f开发者_运维问答ollowing error:
/usr/bin/ld: cannot find -ljscore
collect2: ld returned 1 exit status
How to solve this problem?
That's a bug in Qt's build system existing since 4.7.0 and not fixed in 4.7.1. After the failing make call, you have to copy libjscore.a and libjscore.prl (don't know their exact locations, search the Qt build tree to find them, somewhere in webkit) to the lib/ folder and rerun make.
I had the exact same problem a couple of weeks ago, and I asked Nokia's support team about it (I hold a commercial licence). Their response basically is that they don't support the use of a statically linked QtWebKit, and have no intention of fixing it :
I'm afraid that building Qt with webkit statically is not supported. We don't support this configure option combination and we don't test it.
However the compile problem is not difficult to resolve. As I tried, you just have to modify the searching path for libjscore.a to let it find the lib file.
As Frank Osterfeld said, simply copying libjscore.a and libjscore.prl to a place where ld can find it will fix it.
精彩评论