Error calling a qt executable in Matlab - qt

I have a Matlab file when I get a qt compiled executable to run using the unix(), but I'm getting an error.
the code:
unix('/home/matt/Desktop/PlaneVolumeFinal/PlaneVolumeGui');
the error:
/home/matt/Desktop/PlaneVolumeFinal/PlaneVolumeGui: symbol lookup error: /home/matt/Desktop
/PlaneVolumeFinal/PlaneVolumeGui: undefined symbol: _ZN9QListData7detach3Ev

The dynamically linked libraries are linked when the application is started, the error is saying that the OS cannot find the library that contains the stuff for QList, that library is QtCore.
Make sure Qt's runtime libraries are somewhere where the OS can find them - usually /usr/lib(64). My guess is that you do not have the runtimes but are using Qt's SDK, so QtCreator uses those for compiling - but they are not on your OS's path for when it is ran outside of that.

Related

Cannot find -lQt5Guid and -lQt5Cored

I am currently trying to compile a Qt application that I downloaded from github on my windows machine. I did not have any trouble compiling this on Ubuntu so I was hoping someone could help shed some light on my problem.
I am using Qt-Creator to compile the program.
The exact error messages are:
:-1: error: cannot find -lQt5Guid
:-1: error: cannot find -lQt5Cored
collect2.exe:-1: error: error: ld returned 1 exit status
My first idea when reading those messages was that the windows PATH variable does not include the locations of the libraries. But when I checked, my PATH contained the following:
C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin;C:\Qt\Qt5.1.0\Tools\mingw48_32\bin;...
Which exists and contains what looks like the correct Dlls.
I am using MingGW rather than the visual studio compiler (although i have it available if needs be).
How can I fix this error and what could be causing it?
EDIT: When I run qmake there does not seem to be any problem. The errors come up when I try to build the project.
Cored is a fundimental part of Qt so it looks like the linker can't see any of the Qt libraries.
Did you install Qt 5.1.0 SDK?
A few things to check:
Do you have a line like this in your .pro file?:
QT += core
You mentioned "Projects section my path" are you talking about the windows PATH variable? these paths should also be in that. You can check with dos command:
echo %PATH%
If these paths are not there, for a test, add them in if this works then something has gone wrong with the local PATH setup (i.e. when running qt creator - if you are using qt creator?)
Finally just check that the debug version of the Qt5Cored.dll exists in that folder (C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin) because it looks like you are building a debug build (which is why your program is looking for 'd' post-fixed name Qt5Cored and not Qt5Core).

Qt apps break after build on MinGW

When I build Qt 4.8.2 it builds successfuly. But when I run any Qt pre-built apps (qtdemo.exe, designer.exe etc) it throws a procedure entry point error.
This is what it says:
I just can't get it to work!
I have build debug and release DLLs, without Phonon, Script, Qt3support, or webkit.
I opened the app in Dependency Walker and this is what it said in bold red text:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with
different CPU types were found.
Warning: At least one delay-load
dependency module was not found. Warning: At least one module has an
unresolved import due to a missing export function in a delay-load
dependent module.
The problem occurs when there is another version of the QtCore4.dll in you system PATH. You can get around this by copying the newly compiled dll's into the same directory as the executable, so that it finds the correct version.
You could search your system for QtCore4.dll to see which program(s) installed the conflicting files.

QtGui4.dll entry point not found

I'm trying to write Qt3D application in windows. I'm getting an error when i trying to compile the program and run it. the error's message is : 'The procedure entry point ??4QImage##AEAAV0#$$QAV0##Z could not be found in the dynamic link library QtGui4.dll'.
my compiler is Microsoft Visual C++ 9.0 and Qt version is 4.8.1.
is there any solution for this?
Do you face the problem in both running from the IDE and standalone exe, and both in debug and release mode. IF some of these work, make sure proper QtGui4.dll is copied to the same path where your executable is getting generated.

Compiling InterBase support in Qt

I have followed the instructions on http://doc.qt.nokia.com/stable/sql-driver.html#qibase for compiling Interbase support into Qt, and made sure all of my libraries are in the right place. qmake runs successfully, but when I run nmake, I get a series of undefined reference errors in qsql_ibase.cpp. If I open up the .pro in Qt Creator and hover over one of the functions that is throwing the undefined reference errors and follow the symbol (F2), it takes me to the ibase.h file where it is declared. Is it throwing the undefined reference errors because there is no function definition? If that is the case, why isn't it giving me any errors about a missing library?
Output example:
Creating library file: debug\libqsqlibased4.a
debug/qsql_ibase.o: In function getIBaseError':
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:80: undefined reference toisc_sqlcode'
C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../../sql/drivers/ibase
/qsql_ibase.cpp:85: undefined reference to isc_interprete'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:406: undefined reference toisc_dsql_free_st
atement'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:421: undefined reference to isc_create_blob2
'
debug/qsql_ibase.o:C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\ibase/../../.
./sql/drivers/ibase/qsql_ibase.cpp:427: undefined reference toisc_put_segment'
This continues for many more errors, all undefined references.
That really sounds like the first issue mentioned under the "Troubleshooting" section of the page to which you link above:
You should always use client libraries that have been compiled with
the same compiler as you are using for your project. If you cannot get
a source distibution to compile the client libraries yourself, you
must make sure that the pre-compiled library is compatible with your
compiler, otherwise you will get a lot of "undefined symbols" errors.
Some compilers have tools to convert libraries, e.g. Borland ships the
tool COFF2OMF.EXE to convert libraries that have been generated with
Microsoft Visual C++.
Which compiler are you using to compile Qt, and where did you get the Interbase libraries? You also need to make sure those libraries can be found at link time. If you look at the output of your compiler, it should show you all the link directories in which it is searching (in addition to any globally defined, like PATH in Windows.) If the folder with your Interbase library is listed, it is probably that the compiler versions aren't matching.
Sorry for raising so old theme, but I found a solution and want to share with it. The problem is that macro ISC_EXPORT was not defined in Interbase's SDK due to conditional compilation defines. See details here - Howto build Interbase plugin for Qt by MinGW

Qt4Dotnet on Mac OS X

I'm using Qt4Dotnet project in order to port application originally written in C# on Linux and Mac. Port to Linux hasn't taken much efforts and works fine. But Mac (10.4 Tiger) is a bit more stubborn.
The problem is: when I try to start my application it throws an exception. Exception states that com.trolltech.qt.QtJambi_LibraryInitializer is unable to find all necessary ibraries. QtJambi library initializer uses java.library.path VM environment variable. This variable includes current working directory. I put all necessary libraries in a working directory. When I try to run the application from MonoDevelop IDE, initializer is able to load one library, but the other libraries are 'missing':
An exception was thrown by the type initializer for com.trolltech.qt.QtJambi_LibraryInitializer ---> java.lang.RuntimeException: Loading library failed, progress so far:
No 'qtjambi-deployment.xml' found in classpath, loading libraries via 'java.library.path'
Loading library: 'libQtCore.4.dylib'...
- using 'java.library.path'
- ok, path was: /Users/chin/test/bin/Debug/libQtCore.4.dylib
Loading library: 'libqtjambi.jnilib'...
- using 'java.library.path'
Both libQtCore.4.dylib and libqtjambi.jnilib are in the same directory. When I try to run it from the command prompt, the initializer is unable to load even libQtCore.4.dylib.
I'm using Qt4Dotnet v4.5.0 (currently the latest) with QtJambi v4.5.2 libraries. This might be the source of the problem, but I'm neither able to compile Qt4Dotnet v4.5.2 by myself nor to find QtJambi v4.5.0 libraries. Project's page states that some sort of patch should be applied to QtJambi's source code in order to be compatible with Mono framework, but this patch hasn't been released yet. Without this patch application crashes in a strange manner (other than library seek fault).
I must note that original QtJambi loads all necessary libraries perfectly, so it might be issues of IKVM compiler used to translate QtJambi into .Net library.
Any suggestions how can I overcome this problem?
I think I ran into the same problem earlier today. As soon as I copied libikvm-native.dylib from my current Mono to my project's exe directory, it worked. Frank reminded me to do that on the list here.

Resources