last day (15 days later) » 

5:55 PM
Does any one have experience with QT? I am having a problem on it
@Borgleader , I think it's a well asked question but I don't understand part of it. I guess chat room is the best way to go so here I am (am I wrong?)
Here it's goes. I get the "warning: Exception at 0x7ffcce80c0b4, code: 0xc0000135: DLL not found, flags=0x1 (execution cannot be continued) (first chance)" error message on qt. Is there any way to figure out which DLL (I mean dll name) was not found
Its also show some asm code in the windows
6:23 PM
@nwp, I try dependency walker on the ".a" file but it doesn't show anything. I am getting the lib from "https://mpv.srsfckn.biz/"
@nwp, There is no ".exe" yet since I cannot build the source code. The lib file provided in the zip does not have a ".exe"
@nwp, Doesn't process monitor require ".exe" to be run
?
@nwp, Sorry, I didn't make myself clear. I want to use the lib provided by https://mpv.srsfckn.biz/ to write a program. I have added
"
LIBS += -L$$PWD/mpv-dev/lib/mpv-1.dll
LIBS += $$PWD/mpv-dev/lib/libmpv.dll.a
"

and it show me https://postimg.org/image/gesi42r9d/
@nwp, When I remove the "-L" argument, it show "error: LNK1107: invalid or corrupt file: cannot read at 0x3E0"
6:55 PM
@nwp, My end result : wanted to use the lib in (http://mpv.srsfckn.biz) in QT (Windows).

Method tested : try with various "LIBS" argument and various argument in ".pro" file

Current situation : Don't know head or tail of what I should try next. In need of serious help. Have been trying for more than 1 day.
hello
nwp
nwp
there are a couple of things wrong there
nwp
nwp
first: are you using gcc or VS?
nwp
nwp
ok
so "LIBS += " adds libraries
dll's are not libraries in that sense
so LIBS += some.dll doesn't work
6:59 PM
I see
nwp
nwp
you probably need to keep the LIBS += something.a
LIBS += $$PWD/mpv-dev/lib/libmpv.dll.a
nwp
nwp
the .dll needs to go in the executable directory
since your are using Qt Creator you should be able to press CTRL+B to build your stuff
does it print an error after building?
:-1: error: Exception at 0x7ffc91ebc6e8, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)
nwp
nwp
that is weird... this looks like an exception that happens when a program is run, not when you build a program
there should be a "compile output" window somewhere, what does it say?
7:03 PM
01:33:18: Running steps for project MPCPort...
01:33:18: Configuration unchanged, skipping qmake step.
01:33:18: Starting: "C:\Qt\Qt5.5.0\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.5.0\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
C:\Qt\Qt5.5.0\5.5\msvc2013_64\bin\uic.exe ..\MPCPort\mainwindow.ui -o ui_mainwindow.h
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\MPCPort.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\MPCPort -I. -I..\MPCPort\mpv-dev\include -I..\..\Qt\Qt5.5.0\5.5\msvc2013_64\include -I..\..\Qt\Qt5.5.0\5.5\msvc
nwp
nwp
so it correctly built an executable
nwp
nwp
did you find the folder where it put the MPCPort.exe into?
nwp
nwp
did you copy the .dll into there?
7:06 PM
I copy all the QT dll + mpv-1.dll and libmpv.dll.a
nwp
nwp
the .a doesn't help, libmpv.dll should do it
after you copy the dll in there and it still doesn't work you can open the MPCPort.exe with dependency walker and it should tell you what you are missing
This is the dll I am provided
nwp
nwp
ok, when you just try to start the MPCPort.exe, what does it say?
It crash
The dependency walker show error
nwp
nwp
@SunMaungOo got to scroll around to find which dll is missing
7:13 PM
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
IESHIMS.DLL
nwp
nwp
none of these look relevant
unfortunately dependency walker shows some false positives
I also thought it is not relevant
are you on Windows system?
nwp
nwp
no, but you can run dependency walker on some random other executable, like dependency walker itself and it will show these same dlls missing
they are not really missing, dependency walker is just bad
Could you help me compile? I can give you the lib file
nwp
nwp
anyways, you can try going with the process monitor route to find out which dll your exe wants
the lib file is VS only, VS doesn't work under linux
7:17 PM
Oh, you are on linux
nwp
nwp
I've had similar issues at work with VS
another thing that could be the issue is that the library was made with another version of VS than what you are using
what am I looking at Process Monitor?
nwp
nwp
there should be a files tab that shows which files are accessed and the success status
I don't know which tab do you mean?
nwp
nwp
the selected symbols are like registry, files, network, something
we are only interested in files
then you click some other icon to start monitoring and it should spam a lot of activities
then you need to filter it down a bit, for example only display file open that failed
then you clean all events, run the exe, stop monitoring and filter by program name probably
then you should find which dll it tried and failed to open
7:27 PM
Ok, I have filter down to the process
I filter it down
nwp
nwp
well, it should be the last one, but it doesn't seem to be related to mpv
are you doing something bcrypt-related?
No
#-------------------------------------------------
#
# Project created by QtCreator 2016-07-08T23:06:23
#
#-------------------------------------------------

QT += core gui


INCLUDEPATH += $$PWD/mpv-dev/include
CONFIG += c++11
CONFIG += debug

LIBS += $$PWD/mpv-dev/lib/libmpv.dll.a


greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MPCPort
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
mpvwidget.cpp

HEADERS += mainwindow.h \
mpvwidget.h

FORMS += mainwindow.ui
mpvwidget.h
#ifndef MPVWIDGET_H
#define MPVWIDGET_H

#include <mpv/client.h>
#include <mpv/opengl_cb.h>
#include <mpv/qthelper.hpp>

class MpvWidget
{
public:
MpvWidget();

~MpvWidget();

private:
\
void init();

mpv_opengl_cb_context* context;
};

#endif // MPVWIDGET_H
mpvwidget.cpp
#include "mpvwidget.h"

MpvWidget::MpvWidget()
{
init();
}

MpvWidget::~MpvWidget()
{

mpv_opengl_cb_uninit_gl(context);

}

static void* on_frame_ready(void *ctx, const char *name)
{
void *res;

return res;
}

void MpvWidget::init()
{

if(mpv_opengl_cb_init_gl(context,NULL,on_frame_ready,NULL)<0)
{
throw std::runtime_error("[MpvWidget] cb init gl failed.");
}

}
That is my whole source code since I am trying to compile it first
nwp
nwp
well it compiled already
void *res;
return res;
this would probably crash
maybe it is not actually a dll issue
technically, it compile but the error show up
when running it
nwp
nwp
ok this is starting to make sense
the error message says the program tried to read address 0, which it cannot
7:42 PM
I am new to C++ so I have no experience solving pointer and memory access error
I used to program C#
nwp
nwp
in the line where it crashed you are passing NULL twice, plus I think you never instantiated context
do you have documentation for the mpv_*-functions?
nwp
nwp
it should say what you can and cannot pass to mpv_opengl_init, you probably passed NULL or context to something that you were not supposed to
I will paste the doc please wait
client.h
nwp
nwp
@SunMaungOo that file doesn't seem to contain the function mpv_opengl_cb_init_gl
7:49 PM
Sorry, I upload a wrong file
this is the correct file
opengl_cb.h
nwp
nwp
I have a hunch: change mpv_opengl_cb_context* context; to mpv_opengl_cb_context context; and mpv_opengl_cb_init_gl(context, ... to mpv_opengl_cb_init_gl(&context, ...
C:\QT Test\MPCPort\mpvwidget.h:19: error: C2079: 'MpvWidget::context' uses undefined struct 'mpv_opengl_cb_context'
C:\QT Test\MPCPort\mpvwidget.cpp:66: error: C2664: 'int mpv_opengl_cb_init_gl(mpv_opengl_cb_context *,const char *,mpv_opengl_cb_get_proc_address_fn,void *)' : cannot convert argument 1 from 'int *' to 'mpv_opengl_cb_context *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\QT Test\MPCPort\mpvwidget.h:19: error: C2079: 'MpvWidget::context' uses undefined struct 'mpv_opengl_cb_context'
nwp
nwp
also be careful with returning pointers to local variables: in on_frame_ready char c; is created, then you return a pointer to c, then c disappears. If someone uses that pointer the program crashes or behaves weird.
@SunMaungOo ok, seems like my hunch was wrong
@nwp, well your hunch is better than mine since I am beginner on C++ stuff
nwp
nwp
> mpv_opengl_cb_context: Opaque context, returned by mpv_get_sub_api(MPV_SUB_API_OPENGL_CB)
8:02 PM
which mean?
nwp
nwp
looks like you need to get a valid context from mpv_get_sub_api before you can pass context to mpv_opengl_cb_init_gl
currently you are passing an invalid context. As far as I can see you never set it to anything.
8:19 PM
I think I know now where the error it
Is there any way to +rep you since you really help me a lot
nwp
nwp
no, its ok
no, I insist
I am going to logout now
bye and thank for all your help
nwp
nwp
well you can't SO doesn't allow it
cya
 
1 hour later…
9:37 PM
@SunMaungOo what the hell is that site name. I'm not at all sure you're not actually (purposely or not) spreading malware here.
Posting links to binaries is rarely a very good idea and anyone who downloads from there without some form of authentication/outside trust is not very smart in my book.
1 message moved from Lounge<C++>
1 message moved from Lounge<C++>
11 messages moved from Lounge<C++>
9:52 PM
@sehe, Thank for your advice.
I am not spreading a malware here.
If I look like I am spreading a malware, I apologize.
The binary (library) are the used for video playback.
The link to the library can easily are searchable by"Google".
I think the author (not me) of the library will not care if his library is known.
I usually password protected if I need to share something privately (thank for the advice anyway)
The link I provided can be find by tracing it back by github (github.com/cmdrkotori/mpc-qt) (if you have any doubt that it is a malware)
It is a hyper link (mpv windows release page)
10:17 PM
In case it wasn't clear, I don't care whether it /is/ malware. I'm telling you it's questionable conduct to come into a room as a stranger and post links like that. (And pointed out why). Peace
@SunMaungOo Thanks for explaining though. I didn't report you or anything. :)
@Se
@sehe , I will be more careful
have a good night or morning

last day (15 days later) »