LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2020, 01:24 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,910

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318

no, I do not want it for myself, but you can use ldd to check the used libraries and find the reason.
you can use ldd on *.so files too.
and you can use nm -D <file> | grep symbol to check a symbol (U means it is required, but undefined).
 
Old 12-10-2020, 01:52 PM   #17
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
Code:
nm -D libstdc++.so.6.0.25 | grep __cxa_throw_bad_array_new_length
0000000000091ad0 T __cxa_throw_bad_array_new_length
I compiled the backups of my project and tested them one by one. Previous versions run fine. I think it is when I introduced a resource file into Qt Creator that things broke down.
I'm not sure since I did not do extensive testing.
It is time to stop and try something new.

As for GTK+ or gtkmm, is it possible to have resource files and to have image files in the EXE?
I need an API that can read the resource file and make it the app icon, just like we do in MFC.
I also need to place images on buttons, images on other things.

~~~~vmelkon
 
Old 12-30-2020, 03:22 PM   #18
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
After many tests and recompiles, etc. It looks like the problem comes from one of my free functions that has the form.

Code:
int MyFunction(sint *thing)
{
char **ppp;
ppp=new char*[*thing];
return 1;
}
But my code has been working fine for ages when I compile with VC++6, on Windows.
If I change it to
ppp=new char*[100];

it works fine when I try to run the EXE on a fresh install of Kubuntu.

~~~~vmelkon
 
Old 12-31-2020, 01:13 AM   #19
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
You seem to have a g++/libstdc++ incompatibility. Those two should come from the same source.
 
Old 12-31-2020, 03:37 AM   #20
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,910

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
what is sint ?
Whould be nice to post a full example (which can be compiled and tested by anyone).
 
Old 12-31-2020, 09:01 AM   #21
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by pan64 View Post
what is sint ?
Whould be nice to post a full example (which can be compiled and tested by anyone).
Sorry, I tried to clean it up for you guys but I missed that one.
sint is my own int.
I also have uchar which is really unsigned char.
.....and so on. That stuff is defined in my
global.h file.

The problem functions are in file
MemoryTracker.h
MemoryTracker.cpp

It is odd.
These 2 functions don't cause any problems.
schar* newschar(sint amount, schar *(&mypointer), const schar *description);
uchar* newuchar(sint amount, uchar *(&mypointer), const schar *description);

as soon as I add one of these
tbool* newtbool(sint amount, tbool *(&mypointer), const schar *description);
sshort* newsshort(sint amount, sshort *(&mypointer), const schar *description);
ushort* newushort(sint amount, ushort *(&mypointer), const schar *description);
and maybe the others, BOOM.

The project page is at
https://sourceforge.net/projects/chemicala

Download the file
ChemicalADlg-v1.7.2_Linux_64_bit_testversion06.zip
Open it with your QT Creator and just compile
or open
folder Lin64 and the EXE is there.

Note: I will soon try to fix the problem. It will take a while since I am tired right now.
I don't even know if I will succeed in fixing the problem
 
Old 12-31-2020, 12:32 PM   #22
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,910

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
please try to create/prepare a minimal [but working] example, which will fit into a single cpp. Looks like it is no Qt related at all.
 
Old 12-31-2020, 02:01 PM   #23
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by pan64 View Post
please try to create/prepare a minimal [but working] example, which will fit into a single cpp. Looks like it is no Qt related at all.
It might be related to QT Creator. I don't know.
Anyway, I made this project.
The main file is just
and the same problem is present.

Code:
#include <iostream>
#include "MemoryTracker.h"



using namespace std;

int main(int argc, char **argv)
{
	cout << "Hello world.\n\n";
	return 0;
}

https://sourceforge.net/projects/chemicala
Download cmdline.zip

~~~~vmelkon
 
Old 01-01-2021, 01:21 AM   #24
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
Code:
./ChemicalADlg: relocation error: ./ChemicalADlg: 
   symbol __cxa_throw_bad_array_new_length version Qt_5
   not defined in file libQt5Gui.so.5 with link time reference
Well, I still think this symbol should come from libstdc++.so:

Code:
$ nm --with-symbol-versions -D /usr/local/lib64/libstdc++.so |
grep __cxa_throw_bad_array_new_length
0000000000099163 T __cxa_throw_bad_array_new_length@@CXXABI_1.3.8@@CXXABI_1.3.8
But maybe this libQt5Gui.so somehow also exports this __cxa_throw_bad_array_new_length symbol (in some version).
 
Old 01-01-2021, 09:08 AM   #25
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
This "version Qt_5 not defined in file libQt5Gui.so.5" certainly makes it sound like a QT5 version issue. The fact that yuor test program with include gives you the same error and it very much seems that is the issue.
 
Old 01-01-2021, 09:17 AM   #26
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by SoftSprocket View Post
This "version Qt_5 not defined in file libQt5Gui.so.5" certainly makes it sound like a QT5 version issue. The fact that your test program with include gives you the same error and it very much seems that is the issue.
If that were true, then no other Qt based application would run. For example, VLC uses Qt.
The Qt .so files comes with your OS.

Quote:
Originally Posted by SoftSprocket View Post
But maybe this libQt5Gui.so somehow also exports this __cxa_throw_bad_array_new_length symbol (in some version).
Possibly. I don't know. I'm a noob and all this looks like magic to me.
All I know is how to compile and get a EXE file. Then, I give the EXE to my buddies and everything is suppose to work.

~~~~vmelkon
 
Old 01-01-2021, 09:21 AM   #27
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
Quote:
Originally Posted by vmelkon View Post
If that were true, then no other Qt based application would run. For example, VLC uses Qt.
The Qt .so files comes with your OS.

~~~~vmelkon
???? What on earth makes you think that? Did you compile VLC on your machine using the version of QT you compiled against and then move it to the machine in question?

Try compiling your application on a machine where you get the error and see if the error goes away.
 
Old 01-01-2021, 01:43 PM   #28
vmelkon
Member
 
Registered: Feb 2007
Location: Canada
Distribution: Kubuntu 22.04
Posts: 549

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by SoftSprocket View Post
???? What on earth makes you think that? Did you compile VLC on your machine using the version of QT you compiled against and then move it to the machine in question?
No but the VLC page says that they use Qt4
https://www.videolan.org/developers/vlc.html

Quote:
Originally Posted by SoftSprocket View Post
Try compiling your application on a machine where you get the error and see if the error goes away.
Why?

~~~~vmelkon
 
Old 01-02-2021, 08:17 AM   #29
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
Yes, well, if you had built against the version of QT used by VLC you would then know you would find there is a good chance you could install on any machine where it was installed (though the possibility still exists you might find a issue), but why confuse your self with reality when willful ignorance seems to be working so well for you?

If you want a download to work on other machines you either use a package system, a static build or have your end users build it following a recipe you provide. What ever magic bullet you are looking for probably doesn't exist. If you continue to conflate your ignorance with others you will find Linux a difficult system to use. It would seem it requires you to learn some things you have not yet learned.
 
Old 01-02-2021, 09:30 AM   #30
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
ToDo's

1. find this libQt5Gui.so.5


2. check is it exports this symbol:
Code:
nm --with-symbol-versions -D libQt5Gui.so.5 |
grep __cxa_throw_bad_array_new_length
3. if it does export it, find out if it accidental or intentional. (This will be the hard part.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysterious NETWORK nonfunctionality - Redhat 8.0 Bungo2000 Linux - Networking 13 12-11-2002 06:53 PM
Mysterious Hop Problem magebeast Linux - Networking 2 05-24-2002 12:48 PM
Mysterious hostname change phil1076 Linux - General 5 12-20-2001 03:06 PM
Mysterious Problem Solved jupiter-eight Linux - General 0 12-07-2001 10:24 PM
Diald and mysterious packed daja58 Linux - Networking 0 12-02-2000 05:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration