tags:

views:

332

answers:

1

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 component. 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.

+1  A: 

Hi ReDAeR,

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:

kemiisto
I did all steps again and now i get an error. Translated it says: Can't find entry point of procedure _Z11qUncompressPKhi in DLL-file QtCore4.dll. I also created a dummy project which just init QScintilla and set it as main widget and if i run that project i get a similar error, it can't find _Z5qFreePv in QtCore4.dll.
ReDAeR
It seems that your app is linked against one set of Qt libraries, but there is another set in your path. When you run your app it uses that another set. Do you use MinGW or VC++? Which Qt do you use - binary distribution or compiled on your machine from source code? Can you post your path variable?
kemiisto
I downloaded the binary distrubuted Qt 2009.05 (4.60)Path variable: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Bazaar;C:\Program Files\TortoiseSVN\bin;C:\Qt\2009.05\mingw\bin;C:\Qt\2009.05\bin;C:\Qt\2009.05\qt\binNormally i use VC++ for my C++ projects but i'm not sure in Qt, i guess MinGW ( That's what i've used to compile QScintilla )
ReDAeR
ReDAeR, I have some ideas. Please read my edited message.
kemiisto
Thank you i deleted the (../lib) path and used the MinGW's and it works! Thank you really.
ReDAeR