Почему выпадает ошибка в такой записи:
QList<QString> list;
list << "AAAA" << "BBBB" << "CCCC";
QListIterator<QString> it(list);
while(it.hasNext())
{
QDebug() << "Element: " << it.next();
}
error: invalid use of incomplete type ‘struct QDebug’
forward declaration of ‘struct QDebug’
cy6erGn0m
19.6k1 золотой знак31 серебряный знак37 бронзовых знаков
задан 28 июн 2011 в 19:28
Думаю, вы не подключили QDebug.
#include <QDebug>
ответ дан 28 июн 2011 в 19:30
cy6erGn0mcy6erGn0m
19.6k1 золотой знак31 серебряный знак37 бронзовых знаков
1
|
solmaxa 17 / 8 / 2 Регистрация: 06.01.2013 Сообщений: 163 |
||||
|
1 |
||||
|
08.01.2013, 21:29. Показов 10894. Ответов 2 Метки нет (Все метки)
В первой строке ошибки нет (vec3d — структура Opencv), во второй редактор выдает:
ошибка: invalid use of incomplete type ‘class QDebug’
__________________
0 |
|
NoMasters Псевдослучайный 1946 / 1145 / 98 Регистрация: 13.09.2011 Сообщений: 3,215 |
||||
|
08.01.2013, 22:40 |
2 |
|||
|
А что это вы с ним такое пытаетесь сделать? Подозреваю, что подразумевалось нечто вроде
1 |
|
solmaxa 17 / 8 / 2 Регистрация: 06.01.2013 Сообщений: 163 |
||||
|
09.01.2013, 20:45 [ТС] |
3 |
|||
|
))))
0 |
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
balogic opened this issue
Mar 22, 2017
· 11 comments
Comments
I got this issue while trying to build tensor in my Ubuntu machine

OS — Ubuntu
Version — 16.04
It seems that ConnectionData doesn’t include <QDebug> though it has to — this is actually the libqmatrixclient code, used by Tensor and Quaternion. I wonder which version of Qt you have and which compiler you’re building with — I haven’t seen this error message before. Anyway, thanks for reporting.
Looking further into your case, I see that <QDebug> might actually be not included from the depths of Qt header files in case when QT_NO_DEBUG_STREAM is defined. But in that case, I’m afraid, you’ll get more unrecoverable errors even if you just throw #include <QDebug> into connectiondata.cpp.
@balogic , qmake is a separate tool that has its own versioning. Did you install Qt from PPA or do you use the stock Qt (5.5?) version installed with 16.04?
So far I cannot even reproduce the build problem that you have. It builds fine on my Ubuntu VM.
@KitsuneRal I haven’t installed Qt5 explicitly but I have all the build
tools needed. Doesn’t Ubuntu comes with Qt by default? Does missing
Qt5 is actually the issue?
To be on the safe side, please do the following:
sudo apt-get install git cmake qtdeclarative5-dev qtdeclarative5-qtquick2-plugin qtdeclarative5-controls-plugin
This should install all dependencies you may need.
@KitsuneRal I’ve installed it all. But still the same error persists.
I’m out of ideas. Anyway, since in all fairness we actually use qDebug() in this file, I’m adding a commit with #include <QDebug> to libqmatrixclient now. Can you please do the same (add #include <QDebug> to other #includes in the file connectiondata.cpp), to see that this resolves your problem?
Now the error changes to QtCore/QJsonObject No such file or directory

I just noticed — does it try to compile against Qt 4 instead of Qt 5? Do you actually need Qt 4 on your system?
I just got bitten by this, apparently Ubuntu changed the qmake default from qt5 to qt4 at some point… :/
sudo apt install qt5-default fixes it
|
|
#41 | Link |
|
Registered User
Join Date: Jun 2007 Posts: 401 |
Quote:
Originally Posted by lansing I don’t know anything about compiling. From the error, maybe your compiler didn’t understand Qt library? Is there any other similar error about conversion? Sorry, should have included more details, using clang 11.0.3 in macOS Catalina with Qt 5.12.6 (also tried 5.15.0). I may try on Sierra with Qt 5.6 which was the version of Qt I had to use for a while due to newer versions breaking stuff in some releases of the original vsedit, but they would usually still compile… Edit: Sierra isn’t liking a few of the uses of qDebug and is erroring out sooner…fun!
Last edited by l33tmeatwad; 7th August 2020 at 18:24.
|
|
|
|
|
|
#42 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by Myrsloik I’m no python expert but I think a simple vs.get_output() after exec() should do since the output clip is actually stored inside the vapoursynth module’s global state. I passed in the script text from the editor to eval(), log showing that the script did pasted into eval() but I got the syntax error Code: eval(import vapoursynth as vs ^ SyntaxError: invalid syntax |
|
|
|
|
|
#43 | Link |
|
Registered User
Join Date: Jun 2007 Posts: 401 |
Just an update, looks like Ubuntu 20.04 is failing the same as Sierra. Code: ../../common-src/vapoursynth/vapoursynth_script_processor.cpp:959:12: error: invalid use of incomplete type ‘class QDebug’
959 | qDebug() << message;
| ^
|
|
|
|
|
|
#44 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by l33tmeatwad Just an update, looks like Ubuntu 20.04 is failing the same as Sierra. Code: ../../common-src/vapoursynth/vapoursynth_script_processor.cpp:959:12: error: invalid use of incomplete type �class QDebug�
959 | qDebug() << message;
| ^
Have you try compiling it inside Qt Creator? |
|
|
|
|
|
#45 | Link |
|
Registered User
Join Date: Jun 2007 Posts: 401 |
Quote:
Originally Posted by lansing Have you try compiling it inside Qt Creator? Considering it uses the same compiling tools it wouldn’t really matter, but to be thorough I went ahead and ran it just to confirm, and it does give the same error… Code: calling 'debug' with incomplete return type 'QDebug' |
|
|
|
|
|
#46 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by lansing I passed in the script text from the editor to eval(), log showing that the script did pasted into eval() but I got the syntax error Code: eval(import vapoursynth as vs ^ SyntaxError: invalid syntax Okay I figured it out, I should be passing the «clip.set_output()» into eval(), not the entire script. Code: # paste in script from editor
eval("clip.set_output")
new_clip = vs.get_output()
# do stuff
new_clip .set_output()
This IS a lot easier than the import method, no need to save the script to a temporary location and struggle to get the right path just to retrieve it. |
|
|
|
|
|
#47 | Link |
|
Registered User Join Date: May 2011 Posts: 267 |
Quote:
Originally Posted by lansing This IS a lot easier than the import method, no need to save the script to a temporary location and struggle to get the right path just to retrieve it. Because of using vsedit, that introduces that path problem, otherwise having py in the same dir imports scripts just fine. |
|
|
|
|
|
#48 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
A test build here for a new preview filters feature. The idea is to take advantage of vs script and turn some utility functions into button click to assist preview, such as a one click switch between YUV channels (not sure if they’re called Y’CrCb or YUV). It is very useful for people doing denoising. Right now it only has one script in the chain, but more can be added. For example the UV channels are very hard to see because of low contrast, to combat this we can chain another «auto contrast» script after it to make it more visible. I have a few questions though to make sure I didn’t mess up. Are they YUV channels or Y’CrCb channel? And what about the planes? I know plane 0 is Y channel, but what is plane 1 and 2? Code: clip_yuv16 = core.resize.Bicubic(clip, format=vs.YUV444P16) u_clip = core.std.ShufflePlanes(clip_yuv16, planes=1, colorfamily=vs.GRAY) And right now I am reading the script right from the text files and it needs to be in the folder to work. How do I store the text content inside a c++ file instead? |
|
|
|
|
|
#49 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
I found a memory leak that was dated from the original version. If you load a script->preview->close->preview->close, the memory will slowly goes up by 10MB without dropping. It wasn’t noticeable until the use of preview filters, where you’ll do preview-close actions much more often. Is there a proper method to track down the leak? Because I was looking all over the place and it’s going to take a very long time. |
|
|
|
|
|
#50 | Link |
|
Registered User Join Date: Jan 2019 Location: Canada Posts: 540 |
As far as I know, it’s the behavior of all the vsscript previewers. The memory usage goes up to the max cache size, if it was set in the script. Otherwise it feels like there is no garbage collection in VS, and everything is cached indefinitely. |
|
|
|
|
|
#51 | Link |
|
Registered User Join Date: May 2011 Posts: 267 |
yes plane 1 is U as in your example, Quote: And right now I am reading the script right from the text files and it needs to be in the folder to work. How do I store the text content inside a c++ file instead? Not sure exactly what it suppose to be, but if in Python, you can import a module (a script in our case) right from text (a string type) or built in text editor for example and then using it because it is imported. So if coding in Python that handles some text editor, it can run that script from within. Script does not have to be physically on disc or a directory/folder. Not sure how it should be implemented to C++ or if it is possible. In Python you can do: Code: import vapoursynth as main_vs
import importlib.util
script = 'import vapoursynth as vsnclip=vs.core.std.BlankClip()nclip.set_output()' #you fetch this from text editor etc.
main_vs.clear_outputs()
spec = importlib.util.spec_from_loader('my_module_name', loader=None)
vs_module = importlib.util.module_from_spec(spec)
exec(script, vs_module.__dict__)
imported_clip = main_vs.get_output()
imported_clip.set_output()
so basically, you import that created module from text and having that clip available within code where you created that text.
Last edited by _Al_; 10th August 2020 at 06:51.
|
|
|
|
|
|
#52 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Update to r1.5 changelog: All problem solved, now the preview filters feature should be fully functional and no script needs to be loaded at runtime. The program will read the «xyz.set_output()» from the script in the editor and append the preview filters to it. The combined script will be run to produce the filtered effect. Right now I have added the YUV channel split script to display YUV channel separately, well I’m not sure what the correct term for it, YUV or Y’CbCr? And are they called plane or channel or component?
Last edited by lansing; 10th August 2020 at 11:32.
|
|
|
|
|
|
#53 | Link |
|
Registered User Join Date: Dec 2005 Location: Germany Posts: 1,745 |
I get this error SyntaxError: invalid syntax -> clip.set_output()eval(«clip.set_output()») if I click on Y in [PF]. Clicking on off does not seem to turn it off, the error msg is still shown. My script Code: clip = core.lsmas.LWLibavSource(source=r"E:ep1_1.vob") clip.set_output() |
|
|
|
|
|
#54 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by ChaosKing I get this error SyntaxError: invalid syntax -> clip.set_output()eval(«clip.set_output()») if I click on Y in [PF]. Clicking on off does not seem to turn it off, the error msg is still shown. My script Code: clip = core.lsmas.LWLibavSource(source=r"E:ep1_1.vob") clip.set_output() That because there’s no new line between the set_output and eval function. Just put a new line after set_output for now. I’ll fix it in next version. |
|
|
|
|
|
#55 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by quietvoid As far as I know, it’s the behavior of all the vsscript previewers. The memory usage goes up to the max cache size, if it was set in the script. Otherwise it feels like there is no garbage collection in VS, and everything is cached indefinitely. um…looks like the leak can be traced back 7 years ago: Quote: Notes Now it’s 10 MB instead of 1 for every reload. I’ll report it. |
|
|
|
|
|
#56 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
r1.6 up, fixed all reported issues changelog: |
|
|
|
|
|
#57 | Link |
|
Registered User Join Date: Dec 2005 Location: Germany Posts: 1,745 |
Thx! Edit |
|
|
|
|
|
#58 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by ChaosKing Thx! It’s probably from the vs memory leak. It will leak a little every time you run preview script, which is what switching between YCbCr planes is doing. I just tested it, I spammed the buttons until around 1.5G ram and the program crashed. Quote: Can we get right click on tab and close? You can close with middle click. I’ll add it to right click just for the sake of it. |
|
|
|
|
|
#59 | Link |
|
Registered User Join Date: Jun 2010 Posts: 91 |
1 — Is it possible to add short cut keys to switch between tabs and/or use the mouse scroll button? (Feature available in Avspmod2. Tabs can be accessed with ctrl+1, ctrl+2 and so on. Same with the mouse scroll button). Kind Regards!
Last edited by fAy01; 11th August 2020 at 00:44.
|
|
|
|
|
|
#60 | Link |
|
Registered User Join Date: Sep 2006 Posts: 1,643 |
Quote:
Originally Posted by fAy01 1 — Is it possible to add short cut keys to switch between tabs and/or use the mouse scroll button? (Feature available in Avspmod2. Tabs can be accessed with ctrl+1, ctrl+2 and so on. Same with the mouse scroll button). Yeah I’ll add those shortcuts, I have been told to use the number button for switching. Quote: 2 — Double clicking the video region to maximize the window and enter full screen for comparison between two sources. (Feature available in Avspmod2). I will have to think about that. Quote: 3 — At the moment the script window can only be positioned on the left hand side. Is it possible to have it at the top, bottom, and/or right? Or have the option to hide it similar to the script evaluation window in the script window. I’m not changing the layout because I think this is the most suitable layout for video script editor. Every space in the ui have served a purpose with minimum waste. Positioning the script window to the top or bottom is a terrible design. Just look at Avspmod, maximize its window and you’ll have more than half of your screen filled with empty white space. I can make it closable and be restored from the Window menu but that’s about it Quote: 4 — Could the bookmark feature be used to generate chapters (txt or xml) with custom configurable presets for chapter names? E.g. Preset 1 [OP, Main, ED, Preview], Preset 2 [Prologue, Opening, Part A, Eyecatch, Part B, Ending, Preview] The bookmark manager can generate chapter text file from bookmarked frame with chaptername and that’s the farthest I would go. You’ll have to use some better chapter specific programs for those features. Quote: 5 — Using the bookmarked frames to generate a qpfile for x264? I don’t know what qpfile is and there’s no more room to dock the bookmark manager. |
|
|
|
To see lggoing output you need to:
- Configure your project to have a console
- Make sure qDebug() isn’t disabled by defining QT_NO_DEBUG at build time
(switch to a debug build). - Make sure logging isn’t disable by system/usr configuration files.
- If joining an existing project, check if a
qInstallMessageHandler()has been called, in which caset he output may be being redirected somewhere. - If joining an existing project, make sure logging isn’t suppressed by calls to
setSeverity(not an issue in a fresh Qt Creator project).
Step 1: To configure a console for you application, add
CONFIG += console
to your .pro file, then rerun qmake and rebuild. Alternatively
enable «run with a console» in the run configuration gui provided by Qt Creator.
Step 2: switch from a «release» to a «debug» build
For this, you can use Qt Creator’s gui on the lower left. This switches CONFIG from «release» to «debug» in the .proj file. Which, among other things, tells qmake not to generate a makefile which calls the compiler with -DQT_NO_DEBUG. Since that would disable qDebug-level logging.
Alternatively, edit the .pro file yourself and rerun qmake, then recompile.
Step 3: Check logging configuration files
Since qInfo() doesn’t work either on your system, this step probably isn’t the problem in your particular case, but it generally can be an issue.
logging can be selectively enabled or disabled via rules set in a system and/or logging configruration file. Since 2015, qDebug() level has been disabled by default on major linux distros (ubuntu, fedora22+) via a system-wide qtlogging.ini which is included in the distro’s Qt5 packages.
on my system that means I have a /usr/share/qt5/qtlogging.ini:
$ cat /usr/share/qt5/qtlogging.ini
[Rules]
*.debug=false
To manually override this on the command line, you can set an environment
variable from the command line:
$ export QT_LOGGING_RULES='*.debug=true'
$ ./my_program
You can also edit the «build environment» in Qt Creator, if you ant to keep debug output disabled globally, but see it when running in Qt Creator.
I recommended you read QLoggingCategory — Logging Rules for how this can be configured. See also this fedora ticket about the change to disable by default.
To see lggoing output you need to:
- Configure your project to have a console
- Make sure qDebug() isn’t disabled by defining QT_NO_DEBUG at build time
(switch to a debug build). - Make sure logging isn’t disable by system/usr configuration files.
- If joining an existing project, check if a
qInstallMessageHandler()has been called, in which caset he output may be being redirected somewhere. - If joining an existing project, make sure logging isn’t suppressed by calls to
setSeverity(not an issue in a fresh Qt Creator project).
Step 1: To configure a console for you application, add
CONFIG += console
to your .pro file, then rerun qmake and rebuild. Alternatively
enable «run with a console» in the run configuration gui provided by Qt Creator.
Step 2: switch from a «release» to a «debug» build
For this, you can use Qt Creator’s gui on the lower left. This switches CONFIG from «release» to «debug» in the .proj file. Which, among other things, tells qmake not to generate a makefile which calls the compiler with -DQT_NO_DEBUG. Since that would disable qDebug-level logging.
Alternatively, edit the .pro file yourself and rerun qmake, then recompile.
Step 3: Check logging configuration files
Since qInfo() doesn’t work either on your system, this step probably isn’t the problem in your particular case, but it generally can be an issue.
logging can be selectively enabled or disabled via rules set in a system and/or logging configruration file. Since 2015, qDebug() level has been disabled by default on major linux distros (ubuntu, fedora22+) via a system-wide qtlogging.ini which is included in the distro’s Qt5 packages.
on my system that means I have a /usr/share/qt5/qtlogging.ini:
$ cat /usr/share/qt5/qtlogging.ini
[Rules]
*.debug=false
To manually override this on the command line, you can set an environment
variable from the command line:
$ export QT_LOGGING_RULES='*.debug=true'
$ ./my_program
You can also edit the «build environment» in Qt Creator, if you ant to keep debug output disabled globally, but see it when running in Qt Creator.
I recommended you read QLoggingCategory — Logging Rules for how this can be configured. See also this fedora ticket about the change to disable by default.
