|
11:19:00: Running steps for project HCI_VERSION_622...
11:19:00: Configuration unchanged, skipping qmake step.
Boilerplate startup. As noted, no changes detected, the "qmake" step has been skipped
11:19:00: Starting: "/usr/bin/make" -j4 starting /usr/bin/make with 4 jobs (-j4)
/home/qy/Qt/6.2.2/gcc_64/bin/qmake -o Makefile ../HCI_VERSION_622/HCI_VERSION_622.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug qmake constructs a Makefile
rm -f libHCI_VERSION_622.so.1.0.0 libHCI_VERSION_622.so libHCI_VERSION_622.so.1 libHCI_VERSION_622.so.1.0 remove (rm) outdated project target
g++ -Wl,-rpath,/home/qy/Qt/6.2.2/gcc_64/lib -Wl,-rpath-link,/home/qy/Qt/6.2.2/gcc_64/lib -shared -Wl,-soname,libHCI_VERSION_622.so.1 -o libHCI_VERSION_622.so.1.0.0 main.o mainwindow_hci_v_622.o moc_mainwindow_hci_v_622.o /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Widgets.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Gui.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Concurrent.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Core.so -lpthread -lGL I think that's all one command line : run g++ to create the target
ln -s libHCI_VERSION_622.so.1.0.0 libHCI_VERSION_622.so
ln -s libHCI_VERSION_622.so.1.0.0 libHCI_VERSION_622.so.1
ln -s libHCI_VERSION_622.so.1.0.0 libHCI_VERSION_622.so.1.0 create some soft links, presumably needed for link name resolution for other projects that might use this library
11:19:02: The process "/usr/bin/make" exited normally.
11:19:02: Elapsed time: 00:02. Boilerplate successful completion of project creation
Keep Calm and Carry On
|
|
|
|
|
Thanks
So this is where libraries folders are ?
g++ -Wl,-rpath,/home/qy/Qt/6.2.2/gcc_64/lib -Wl,-rpath-link,
my libraries of interest
/home/qy/Qt/6.2.2/gcc_64/lib
-shared -Wl,-soname,libHCI_VERSION_622.so.1 -o libHCI_VERSION_622.so.1.0.0 main.o mainwindow_hci_v_622.o moc_mainwindow_hci_v_622.o
other libraries
/home/qy/Qt/6.2.2/gcc_64/lib/libQt6Widgets.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Gui.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Concurrent.so /home/qy/Qt/6.2.2/gcc_64/lib/libQt6Core.so -lpthread -lGL
|
|
|
|
|
The -Wl,... arguments to g++ are passed on the the linker. For details of the rpath and rpath-link arguments see here: Using LD, the GNU linker - Options
Member 14968771 wrote: -shared -Wl,-soname,libHCI_VERSION_622.so.1 -o libHCI_VERSION_622.so.1.0.0 main.o mainwindow_hci_v_622.o moc_mainwindow_hci_v_622.o
-shared : create a shared runtime -necessary for producing a shared library (DLL in windows-speak)
-Wl,-soname,libHCI... : see above document re -soname linker option
The .o files are the object files to put in the shared library
You are correct about the other libraries. They get picked up by rpath and rpath-link, so that when you use then libHCI_VERSION_6622 library, you do not have to add them to the link command line
Keep Calm and Carry On
|
|
|
|
|
I need some general /generic advise how to tackle this problem.
It is in my C++ QT code and I cannot even start to debug at the beginning of the code.
I have a "main" wrapper app / project and bunch of subprojects.
I used to be able to set breakpoint at the start of the main project - not anymore.
I have no clue from where this error comes from and how it started on perfectly working code. .
I can disable all subprojects and still get this error.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
I am not asking for code, just some advise how to tackle this error.
|
|
|
|
|
First, make sure you're creating a debug build. Whatever IDE you're using should have a Build or Compile config section, so take a look and make sure that's set. Your IDE should have a built in link to the debugger, so just run the program in the debugger. When the error is thrown, the debugger should stop the program and allow you to examine the state of the program. If you need to use the command line, here's an example to help you get started:
$ cat bad_alloc.cpp
int main()
{
size_t lim = 2;
while(true)
{
int *arr = new int[lim];
delete[] arr;
lim *= 2;
}
return 0;
}
$
$
$ g++ -m32 -ggdb bad_alloc.cpp -o bad_alloc
$
$ gdb bad_alloc
Reading symbols from bad_alloc...
(gdb) run
Starting program: /home/ebacon/tmp/c++/bad_alloc
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
Program received signal SIGABRT, Aborted.
0xf7fce559 in __kernel_vsyscall ()
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.32-10.fc33.i686 libgcc-10.3.1-1.fc33.i686
(gdb)
(gdb) bt
(gdb)
(gdb)
(gdb) frame 8
8 int *arr = new int[lim];
(gdb)
(gdb)
(gdb) p lim
$1 = 536870912
(gdb) quit
A debugging session is active.
Inferior 1 [process 3076940] will be killed.
Quit anyway? (y or n) y
$
Hopefully, that's enough to get you started. If you need more, then Google is your friend.
Keep Calm and Carry On
|
|
|
|
|
Thanks very much.
Since my program is "under construction" it always runs in debug mode.
The error I am getting does not even get me to the first line of code to set brake point.
Since last major change I did was to change the entire project from QT version 5.12.12 to 6.2.2. - that is the prime suspect.
Since then I found out that I can "configure" individual project to specific version....
In theory - first project I tried it did not work...
I appreciate your post, but since my backup works I will try to find out why the "disable versions prior to xyz " does not work first.
I need only one of the subprojects to be of latest QT version.
Cheers
|
|
|
|
|
I think I need to withdrew this question.
After digesting more QT doc I realized that QProcess is NOT
starting a new thread , hence in my case of time consuming "scan" it is just
wrong to use it.
QT has a "concurrency" "feature" which does start multiple threads... ]
<pre>system("hcitool -i hci0 scan --flush ");
This "system call " works as expected - it finds nearby Bluetooth devices in allotted time - - up to 15 seconds. I use is instead of many "bluez" library derived function because it works CONSISTENTLY...
Because it blocks running thread for up to 15 seconds I like to utilize QT .
"QProcess" object.
I have it working using convoluted "bash" code
OProcess.start("/bin/sh", QStringList() << "-c" << "hcitool -i hci0 scan --flush >> /tmp/temp");
and like to utilize it WITHOUT
"bashing".
Something like this
QProcess::execute("system("hcitool -i hci0 scan --flush "));
of course it does not compile, hence I am here posting this.
Any "unbashed" suggestions would be appreciated - in C or C++ .
PS there are more options to be added to basic "hcitool" command.
modified 18-Jan-22 22:13pm.
|
|
|
|
|
The docs are pretty clear: QProcess Class | Qt Core 5.15.8 Try
QProcess::execute("hcitool", "-i chio scan --flush");
since hcitool is part of the bluez package, it almost certainly uses the bluez library to do its work. If you can get hold of the source code, you should be able to look through it and find out why they make it work the way you expect it to.
Keep Calm and Carry On
modified 18-Jan-22 17:58pm.
|
|
|
|
|
I did try "splitting " program and argument - it did not pass compiler.
Then I put all as a single parameter and it did not run at all.
<pre>OProcess.start("/bin/sh", QStringList() << "-c" << "hcitool -i hci0 scan --flush | tee >> /tmp/temp"); no tee ourput to console - not that important
qDebug() << OProcess.state(); returns "process starting" expected
qDebug() << OProcess.state(); returns "process starting" sort of expected
OProcess.waitForFinished();
qDebug() << OProcess.state(); return process not running expected
OProcess.execute("hcitool-i hci0 scan --flush >>/tmp/temp");
qDebug() << OProcess.state(); return process not running not surprised
OProcess.waitForFinished();
OProcess.state();
qDebug() << OProcess.state(); return process not running obvious
I am under the impression that "hci" was first - then "bluez" - based on "hci"
The QT implementation of bluez is missing the "--flush" option in "scan".
That keeps QT from actually scanning for devices and that is of no good....
|
|
|
|
|
I am using WebView2 for displaying html contents in my win32 application. I have parent.html in which I am providing reference of child.html like -
<frameset id="myFrmset">
<frame id="myFrm" name="frmContent" src="child.html"></frame>
</frameset>
In child.html :
<button id="samplebutton" onclick="postmessagetocode()">clickhere</button>
<script>
function postmessagetocode() {
window.chrome.webview.postmessage('clickSample');
}
</script>
In my c++ code I am loading parent.htm and want to get above message 'clickSample' in
m_webView->add_WebMessageReceived .
Issue that I am facing : by doing like above I am not getting this message in code. If I post any message from parent.html then I can get it. But if I do like from child.html then it never come to c++ code.
Is there the way to do so?
Is it something like I need to catch the message at parent.html first then post again to c++?
Thanks.
|
|
|
|
|
I have three controls in my Modal Dialog there are EDITTEXT and the Variables I am using are CString
After the modal Dialog Box comes in my OnOk I do an UpdateData(TRUE) the data I enter is 2E000 however when it is returned between every character there is a Null so it would be in hex 32004500300030
this happens with all the varaible
thanks
|
|
|
|
|
One word. UNICODE
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Have to change the settings in the VS property page ?
|
|
|
|
|
It depends what you are trying to do with the content of the string. The CString is using Unicode, so presumably, the entire application is also. And you cannot (easily) change one part of the application without affecting other elements.
|
|
|
|
|
|
Yes that will work fine, but you really need to consider why your application is using Unicode in the first place.
|
|
|
|
|
Richard
I have a lot of my pieces in place from my windows client debugger setting breakpoints stepping thru code I just created this project to finish off the last piece displaying modifying storage
As whenever I have to re-test in my development project I have to reinit my machine ( long story) don’t know how I unicode got set
Thanks for your help
|
|
|
|
|
ForNow wrote: don’t know how I unicode got set
It would appear that it is the default for new projects, at least in VS 2019.
|
|
|
|
|
I am trying to reference a member of Derived CDialog and am getting an intelligence error not defined it is #included in the file
when I copy the actual class and members to the source file it is able to reference them
seem like changes to my headers arent taking
thanks
|
|
|
|
|
It sounds like something is messed up in your project. Your source files should be dependent on all the associated headers, and if a header changes then the sources should be rebuilt. You need to look at the project settings for all the source files.
|
|
|
|
|
Richard you are right I copied a .cpp and .h from another project instead of instead of going to Add --> exiting item I guess I should delete and recopy ? I mean copy a copy to another directory and then delete and then do add -> resource item
thanks again
|
|
|
|
|
NO need to delete! Just Add the existing (file that you have already copied!)
|
|
|
|
|
that updates the project file thanks maybe I can try that for resource.h as well ?
|
|
|
|
|
Yes, you should ensure that all files are in the Project tree that is displayed in Visual Studio. If they are not included in the actual Project then Visual Studio will not be aware of them.
|
|
|
|
|
I think I’m going to do add—> existing items (.cpp and .h) in all my files that should update the project settings
Thanks
|
|
|
|