开发者

QScintilla, example project doesn't work

开发者 https://www.devze.com 2022-12-16 20:47 出处:网络
I wanted to try QScintilla out. So i downloaded and installed it, no problems. When i ran the example project it said I was missing QtCored4.dll, so i copied it into the directory, then it said it nee

I wanted to try QScintilla out. So i downloaded and installed it, no problems. When i ran the example project it said I was missing QtCored4.dll, so i copied it into the directory, then it said it needed other dll's aswell so copied them too.

At the end it gives me a Visual C++ Runtime error. It just says it terminated in an unusual way.

I know this is vague, but this is just what is states, no additional error messages. The code is from the website, i didn't modify it.

Anyone has any clues about this?

Now that i have this problem, i thought maybe i should extend the standard Qt text compo开发者_JS百科nent. And try to make my own component like QScintilla.

How hard can it be, to write a component like QScintilla? (Without looking at its source)


Update: So i loaded the example project under Qt Creator. Set the default config to release mode and let it run. And it worked. (very weird). If i switch to debug mode Qt Creator says:

Invalid parameter passed to C runtime function.

If i go to the directory in the file system ( not in Qt Creator ) and run the program (release mode), i get the strange errors i told you about in the comment. While if i run it from Qt Creator it works.


I have no problems with QScintilla. I have Qt 4.6 compiled from sources with VC++ 2008. After downloading QScintilla-gpl-2.4.1 and unpacking I compiled it with:

cd Qt4
qmake qscintilla.pro
nmake

and finally installed with

nmake install
copy %QTDIR%\lib\qscintilla2.dll %QTDIR%\bin

And while compiling and running example I have no problems.

So, first check you environment variables (My Computer, Right Click, Properties -> Advanced tab -> Environment Variables button). Check Path in System Variables section. I have %QTDIR%\bin (c:\Qt\qt-4.6.0\bin) in this variable.

Secondly I'm wondering about letter "d" in your message:

QtCored4.dll

If you made all steps described in documentation you will get release version of libraries and release version of example application linked against release version of Qt libraries. And not debug.

Finally may be QTextEdit & QSyntaxHighlighter is enough for your tasks. Check out Syntax Highlighter Example.


Response to comments.

It's some sort of well known problem (may be). So, as you can see you have 2 different folders with Qt libs

C:\Qt\2009.05\bin;C:\Qt\2009.05\qt\bin 

in your path. Libraries in the first folder (...\bin) compiled with VS2008 and libraries in the second one (...\qt\bin) compiled with MinGW. The items in path variable are looked up when your application starts. Suddenly the folder with "wrong" libraries exists before the folder with correct item in your path variable. What you can do is to copy QtCore4.dll, QtGui4.dll and other libraries that you need to folder with your application executable. Hope this helps.

Some links about this problem:

  • @qtforum.org
  • @some blog post (in Russian =))
0

精彩评论

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