[Problem][semi-solved] with linking libvlc to qt
-
I pasted the path to the PATH in the run tab, and even tried with the system PATH, but it changes nothing- program stops as soon as it starts and gives me the mentioned errors.
When i try this:
@#include <QCoreApplication>
#include <iostream>
#include <vlc/vlc.h>int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
std::cout<<"szatan";
libvlc_instance_t * inst = libvlc_new(argc, argv);
std::cout<<"szatan";
return a.exec();
}@
it displays nothing.
thanks for your help, do you, or anyone else have any suggestions? -
Just saw something strange, are you really using Qt for MSVC 2010 and trying to compile stuff with MinGW ?
-
hmm, that is weird, though everything else compiles nicely:P
It only says "Qt 5.2.1 (MSVC 2010, 32 bit)" in the Help->About Qt creator window, in my Project tab the qt version is QT 5.2.1 MinGw 32 bit. So i guess thats not the problem here... -
That's the Qt version used to build Qt Creator. It's not relevant in this case. What is important is the Qt Version from your Kit which is currently indeed the MinGW build.
Do you know what compiler was used to build the VLC sdk ?
-
MinGW, i think (its the native method, at least thats what their wiki says, also its in the pkgconfig files next to the .lib files). i know that libraries should be compiled with the same compiler that im using, I just hope that does'nt have to be the same version of compiler.
-
IIRC, MinGW 4.6 is not compatible with 4.8
-
Ok, so I have discovered, that libvlc is compatible only with qt4.6 7 and 8. In order to run it with qt5, you need to recompile it. I failed at that on windows, but on ubuntu (and for ubuntu- my cross compile attempt also failed miserably) I managed to compile and run it :)
links to relevant things in the internet:
http://ubuntuforums.org/showthread.php?t=2141949
https://forum.videolan.org/viewtopic.php?f=32&t=119194
https://forum.videolan.org/viewtopic.php?f=32&t=119141But now i have a Qt (even without using libvlc) problem- i have downloaded Qt 4.8, installed it, but when i try to build with it, i get GDB error
"The gdb process terminated unexpectedly (code 0)". I made a new kit in build&run menu, and my settings are:
Compiler- MinGW 4.8 32 bit (same as in working Qt5.2.1 kit)
Debugger- extracted from Kit desktop Qt5.2.1 (the working one)
Qt version 4.8.6
Is the debugger the source of my problem? Should I download a newer version of gdb?
I am not sure that the debugger is the source of my problem - if I build and then run program without debug, or just plain remove debugger from kit, the program just doesn't do anything -
@int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
std::cout<<"test";
int e = 0;
std::cin>>e;return a.exec();
}@
does nothing. (since this is a qt issue, should i post about that elsewhere?) -
Just to rule out the obvious, you installed the 4.8.6 MinGW version ?
-
Yep;)
-
How many versions of Qt do you have installed ? Also which version of Qt Creator do you currently use ?
-
I have Qt Creator 3.1.0, and my qt versions are: 4.8.6 and 5.2.1
And sorry, i missed one thing- i don't just get one error when trying to debug my program, i get three:
“The gdb process terminated unexpectedly (code 0)”
"Cannot continue debugged process:
The program is not being run." and
"During startup program exited with code 0xc0000139."
If I just run it without debug, it exits without doing anything. -
That means it can't find one or more dll at startup. Are you sure you have all paths set in your PATH environment variable ?
-
Well, the only difference between the paths from the two kits( 5.2.1 and 4.8.6) are the locations of the qt libraries themselves... should there be any other differences? can these two kits use the same compiler (mingw that came with qt 5.2.1)?
-
Then you need to add the path to the vlc lib dlls so they can be found at startup
-
Well, I'm having a Qt issue now, because i was talking about simple emtpy program. So I'll say that this topic is answered, and start a new one in approporiate place:) Thanks for your help!