Re: [Interest] 32bits builds on 64bits Linux platform

2017-08-27 Thread Jean-Michaël Celerier
> eg, issue with hard-coded path to binaries, ...

A good solution for this (on linux!) is to ship your app as :

app/myApp
app/myApp.sh
app/libs/libQt5Whatever.so ...

and in myApp.sh have

#!/bin/sh
LD_LIBRARY_PATH="$(dirname $0)/libs" ./myApp

This way you don't have any doubt on whether your app will run: it will
always look for the libs there first. The more "common" stuff you put in
the "libs" folder, the more linux distros it will run in (up to libc and
libstdc++ if you really want to be on the safe side; eg build on ubuntu
17.04 and run on centos 6).


Best,
---
Jean-Michaël Celerier
http://www.jcelerier.name

On Sun, Aug 27, 2017 at 3:02 AM, Christian Gagneraud 
wrote:

> On 27 August 2017 at 01:06, Jean-Michaël Celerier
>  wrote:
> > I'd say that the simplest is to spin up a 32-bit docker image
> corresponding
> > to your OS and do the build on it.
>
> I didn't consider docker, but i did consider a 32 bits chroot and a 32
> bits VM.
> The reason i didn't go this way is that i was afraid that I might
> build Qt successfully on such a setup, but the resulting binaries
> might not run on a 32/64 bits environment. eg, issue with hard-coded
> path to binaries, ...
>
> I don't know if might concerns are right thought.
>
> My rational for choosing to build a 32 bits Qt on the 64bits machine
> was that if i can successfully build Qt and successfully run its test
> suites, then there would be no reason why my 32 bits apps would fail
> to build/run (if i ignore extra dependencies)...
>
> Chris
>
> >
> >
> >
> > ---
> > Jean-Michaël Celerier
> > http://www.jcelerier.name
> >
> > On Sat, Aug 26, 2017 at 10:03 AM, Christian Gagneraud 
> > wrote:
> >>
> >> On 26 August 2017 at 14:27, Oliver Niebuhr
> >>  wrote:
> >> > Am 26.08.2017 um 03:26 schrieb Christian Gagneraud:
> >> >> Hi there,
> >> >>
> >> >> I have an application that requires a 32 bits version of Qt-5.6 and
> >> >> fixing the 32 vs 64 bits issues of this app is not option at this
> >> >> stage.
> >> >>
> >> >> So I need to build Qt-6.6 in 32 bits mode on a 64 bits Linux
> platfrom,
> >> >> and then i need to build and run my 32 bits app on the same 64 bits
> >> >> Linux platform against this 32 bits Qt-5.6.
> >> >>
> >> >> Is it possible to to build 32 bits Qt on 64 bits platform? Has anyone
> >> >> manage to do that? Any advice, tips or tricks to share?
> >> >>
> >> >> Thanks in advance,
> >> >> Chris
> >> >> ___
> >> >> Interest mailing list
> >> >> Interest@qt-project.org
> >> >> http://lists.qt-project.org/mailman/listinfo/interest
> >> >>
> >> >
> >> > Good Morning.
> >>
> >> Good evening,
> >>
> >> > Yes it is possible. To build 32-Bit Binaries and Libs on a 64-Bit OS,
> >> > you must install the "Multilib" Version of the Compiler and the used
> >> > Dev-Packages. So in example for the GCC Compiler (G++): Remove the
> "GCC"
> >> > Package and replace it with "GCC-Multilib" (at least this is the Name
> >> > under Antergos Linux (Arch based). Not sure about other Distros. My
> main
> >> > OS is still Windows so I am still kind-a noob when it comes to Linux
> >> > Development :)
> >> >
> >> > Some 32-Bit Libraries (or Package Names to be more precise) are named
> >> > like "lib32-example1". Others like "example2-multilib". Depending on
> the
> >> > Library itself and your Distribution.
> >> >
> >> > You propably need to activate the Multilib Repository for your
> >> > Distribution first, if you dont have any 32-Bit Stuff installed yet.
> >> >
> >> > Qt Configure Parameter for the GCC / G++ Compiler:
> >> > The important Configure Parameter for you (so that Qt tells the
> >> > Compiler to build 32-Bit Binaries etc.) is:
> >> > "/your/qt56/sourcefolder/configure -platform linux-g++-32"
> >> >
> >> > No Idea about other Distros or Compiler like LLVM/Clang.
> >>
> >> Thanks for sharing, i'm running Ubuntu, so it's a bit different. But
> >> yes, one need the multilib stuff and then intall the Qt dependencies
> >> in 32 mode
> >>
> >> Chris
> >>
> >> >
> >> > Good Luck :)
> >> >
> >> > Greetings
> >> > Oliver
> >> > ___
> >> > Interest mailing list
> >> > Interest@qt-project.org
> >> > http://lists.qt-project.org/mailman/listinfo/interest
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >
> >
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Code using QNetworkAccessManager::post() working on Linux but not on Mac

2017-08-27 Thread René J . V . Bertin
Thiago Macieira wrote:

>> I have no idea. I just note that the data with the current call is different
>> from what QUrlQuery gives; I didn't try the QUrlQuery result because I have
>> no idea of the potential implications of those differences.
> 
> Can you elaborate what comes out differently?

QUrl::toPercentEncoding() encodes anything that doesn't look like isalnum

unencoded data: "a=update&s=2.0&p=passphras/r=(Fake^Password)&v=2.1.1.0&d=0"
QUrl::toPercentEncoding(dataToEncode, "&=") : 
"a=update&s=2.0&p=passphras%2Fr=%28Fake%5EPassword%29&v=2.1.1.0&d=0"
QUrlQuery::toString() : 
"a=update&s=2.0&p=passphras/r%3D(Fake%5EPassword)&v=2.1.1.0&d=0"
QUrlQuery::query() : 
"a=update&s=2.0&p=passphras/r%3D(Fake%5EPassword)&v=2.1.1.0&d=0"

But again, even if those are exchangeable, why is QUrlQuery better? As far as I 
can tell I'd be using that class or QUrl to construct something that's not an 
URL. Something that could be done directly by 
{QString,QByteArray}::toPercentEncoding() if such a method existed. And at best 
I'd be replacing 2 calls to construct that data buffer with 2 different calls. 
Or else 2 lines with 7.

Maintainability is maybe a bit better with the API where each key/value pair is 
added individually. But this is not a case where anything is likely to change 
(or be refactored) often except possibly for the things that are already 
defined 
in macros.

R.



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Link error while building Qt/32 on Linux 64 bits

2017-08-27 Thread Thiago Macieira
On Saturday, 26 August 2017 22:42:49 PDT Christian Gagneraud wrote:
> On 27 August 2017 at 16:08, Thiago Macieira  
wrote:
> > On Saturday, 26 August 2017 18:25:16 PDT Christian Gagneraud wrote:
> >> /usr/bin/ld.gold: warning: skipping incompatible
> >> //usr/lib/x86_64-linux-gnu/libSM.so while searching for SM
> >> /usr/bin/ld.gold: error: cannot find -lSM
> >> /usr/bin/ld.gold: warning: skipping incompatible
> >> //usr/lib/x86_64-linux-gnu/libICE.so while searching for ICE
> >> /usr/bin/ld.gold: error: cannot find -lICE
> >> .obj/qxcbsessionmanager.o:qxcbsessionmanager.cpp:function
> >> QXcbSessionManager::~QXcbSessionManager(): error: undefined reference
> >> to 'SmcCloseConnection'
> > 
> > The undefined reference is caused by the libraries listed right before it
> > not being found.
> 
> Not sure to get what you mean.
> 
> Given this:
> -lxcb-xinerama -L/home/krys/Projects/qt5/qtbase/lib
> -lQt5ServiceSupport -lQt5ThemeSupport -lQt5EventDispatcherSupport
> -lQt5FontDatabaseSupport -lfontconfig -lfreetype
> -lQt5LinuxAccessibilitySupport -lQt5AccessibilitySupport -lGL -lQt5Gui
> -lQt5DBus -lQt5Core -lpthread -lX11 -lX11-xcb -lXi -lSM -lICE
> -lxcb-xkb -lxcb-render-util -lxcb-render -lxcb -lxcb-shm -lxcb-sync
> -lxcb-xfixes -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm
> -lxcb-shape -lGL
> 
> Should I focus at the libs on the right or on the left of "-lSM -lICE"?
> My understanding of ld tells me to look on the right (reverse dependency
> order).

The left, centre and right of -lSM -lICE. You need ALL of them.

> I think I have installed all these libraries. 

You have not:. You showed you have libSM.so.6. You need libSM.so.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Code using QNetworkAccessManager::post() working on Linux but not on Mac

2017-08-27 Thread Thiago Macieira
On Sunday, 27 August 2017 01:47:49 PDT René J. V. Bertin wrote:
> Thiago Macieira wrote:
> >> I have no idea. I just note that the data with the current call is
> >> different from what QUrlQuery gives; I didn't try the QUrlQuery result
> >> because I have no idea of the potential implications of those
> >> differences.
> > 
> > Can you elaborate what comes out differently?
> 
> QUrl::toPercentEncoding() encodes anything that doesn't look like isalnum
> 
> unencoded data: "a=update&s=2.0&p=passphras/r=(Fake^Password)&v=2.1.1.0&d=0"
> QUrl::toPercentEncoding(dataToEncode, "&=") :
> "a=update&s=2.0&p=passphras%2Fr=%28Fake%5EPassword%29&v=2.1.1.0&d=0"
> QUrlQuery::toString() :
> "a=update&s=2.0&p=passphras/r%3D(Fake%5EPassword)&v=2.1.1.0&d=0"
> QUrlQuery::query() :
> "a=update&s=2.0&p=passphras/r%3D(Fake%5EPassword)&v=2.1.1.0&d=0"
> 
> But again, even if those are exchangeable, why is QUrlQuery better? As far
> as I can tell I'd be using that class or QUrl to construct something that's
> not an URL. 

Because you're encoding something that is part of a URL's query. It's the same 
encoding.

The difference is that the RFC allows certain characters to appear either 
encoded or unencoded (the case of the parentheses), while some others must 
always be encoded (the "^") and others must always be unencoded (alphabetic, 
numbers, etc.). QUrlQuery knows about that and leaves those characters alone, 
but QUrl::toPercentEncoding doesn't know any better and will encode them. 
Sometimes that encoding changes meaning.

The only thing that looks weird there is that QUrlQuery encoded the '=' in the 
value of "p" parameter. It needs to encode the '=' if it is in the key, but 
not the value.

> Something that could be done directly by
> {QString,QByteArray}::toPercentEncoding() if such a method existed. And at
> best I'd be replacing 2 calls to construct that data buffer with 2
> different calls. Or else 2 lines with 7.

Yes, but they are much more understandable 7 lines, rather tha one cryptic 
string. Not to mention that you need to get your encoding right manually, 
whereas QUrlQuery will do the right job for you.

> Maintainability is maybe a bit better with the API where each key/value pair
> is added individually. But this is not a case where anything is likely to
> change (or be refactored) often except possibly for the things that are
> already defined in macros.

Ok, now try setting a password that contains "&p=".

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] 32bits builds on 64bits Linux platform

2017-08-27 Thread Thiago Macieira
On Sunday, 27 August 2017 01:44:43 PDT Jean-Michaël Celerier wrote:
> LD_LIBRARY_PATH="$(dirname $0)/libs" ./myApp

LD_LIBRARY_PATH="$(dirname $0)/libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ...

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Code using QNetworkAccessManager::post() working on Linux but not on Mac

2017-08-27 Thread René J . V . Bertin
Thiago Macieira wrote:

>> But again, even if those are exchangeable, why is QUrlQuery better? As far
>> as I can tell I'd be using that class or QUrl to construct something that's
>> not an URL.
> 
> Because you're encoding something that is part of a URL's query. It's the same
> encoding.

I was indeed thinking that there'd be an advantage if one could put the URL and 
the POST data in a single QUrlQuery instance, which could then be handed to 
QNAM::post().

Those 7 lines are evidently more readable, but maybe that argument is moot if 
you have to configure the server with an equivalent (or the same) cryptic 
string 
(don't know, never had anything to do with that kind of thing).

> Ok, now try setting a password that contains "&p=".

I can't, not my server (but I think I get your point) :)

R.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Link error while building Qt/32 on Linux 64 bits

2017-08-27 Thread Christian Gagneraud
On 28 August 2017 at 04:46, Thiago Macieira  wrote:
> On Saturday, 26 August 2017 22:42:49 PDT Christian Gagneraud wrote:
>> On 27 August 2017 at 16:08, Thiago Macieira 
> wrote:
>> > On Saturday, 26 August 2017 18:25:16 PDT Christian Gagneraud wrote:
>> >> /usr/bin/ld.gold: warning: skipping incompatible
>> >> //usr/lib/x86_64-linux-gnu/libSM.so while searching for SM
>> >> /usr/bin/ld.gold: error: cannot find -lSM
>> >> /usr/bin/ld.gold: warning: skipping incompatible
>> >> //usr/lib/x86_64-linux-gnu/libICE.so while searching for ICE
>> >> /usr/bin/ld.gold: error: cannot find -lICE
>> >> .obj/qxcbsessionmanager.o:qxcbsessionmanager.cpp:function
>> >> QXcbSessionManager::~QXcbSessionManager(): error: undefined reference
>> >> to 'SmcCloseConnection'
>> >
>> > The undefined reference is caused by the libraries listed right before it
>> > not being found.
>>
>> Not sure to get what you mean.
>>
>> Given this:
>> -lxcb-xinerama -L/home/krys/Projects/qt5/qtbase/lib
>> -lQt5ServiceSupport -lQt5ThemeSupport -lQt5EventDispatcherSupport
>> -lQt5FontDatabaseSupport -lfontconfig -lfreetype
>> -lQt5LinuxAccessibilitySupport -lQt5AccessibilitySupport -lGL -lQt5Gui
>> -lQt5DBus -lQt5Core -lpthread -lX11 -lX11-xcb -lXi -lSM -lICE
>> -lxcb-xkb -lxcb-render-util -lxcb-render -lxcb -lxcb-shm -lxcb-sync
>> -lxcb-xfixes -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm
>> -lxcb-shape -lGL
>>
>> Should I focus at the libs on the right or on the left of "-lSM -lICE"?
>> My understanding of ld tells me to look on the right (reverse dependency
>> order).
>
> The left, centre and right of -lSM -lICE. You need ALL of them.
>
>> I think I have installed all these libraries.
>
> You have not:. You showed you have libSM.so.6. You need libSM.so.

Hi Thiago,

Thanks for pointing that out.
I don't have access to this computer right now, i'm running Fedora 22
here, and this machine has libSM.so (64 bits only machine, and i don't
want to mess up that one)
[developer@chris-g-vm1 ~]$ ldconfig -p | grep libSM
libSM.so.6 (libc6,x86-64) => /lib64/libSM.so.6
libSM.so.6 (libc6) => /lib/libSM.so.6
libSM.so (libc6,x86-64) => /lib64/libSM.so

But according to packages.ubuntu.com [1], I need to install
libsm-dev:i386 to get libSM.so, libSM.so.6 is provided by the package
libsm:i386 [2]

I have installed (I think) all the libfoo:i386, but when i try to
install some libfoo-dev:i386, it forces me to specify dependencies as
well and ends up removing the x86_64 versions of these packages...
>From memory, here is the scenario:
$ apt-get install libfoo-dev:i386
cannot install libfoo-dev:i386, needs libbar-dev:i386 and
libbar-dev:i386 is not to be installed
$ apt-get install libfoo-dev:i386 libbar-dev:i386
About to remove: 
About to install: libfoo-dev:i386, libbar-dev:i386

At which stage, i just cancel the command because the list of packages
to be removed is really long and scary.

I need to spend more time on this, so far it's all about Linux distro
issues, nothing wrong with Qt itself.

Chris

[1] 
https://packages.ubuntu.com/search?searchon=contents&keywords=libSM.so&mode=exactfilename&suite=zesty&arch=any
[2] 
https://packages.ubuntu.com/search?searchon=contents&keywords=libSM.so.6&mode=exactfilename&suite=zesty&arch=any

>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Link error while building Qt/32 on Linux 64 bits

2017-08-27 Thread Thiago Macieira
On Sunday, 27 August 2017 15:29:24 PDT Christian Gagneraud wrote:
> Thanks for pointing that out.
> I don't have access to this computer right now, i'm running Fedora 22
> here, and this machine has libSM.so (64 bits only machine, and i don't
> want to mess up that one)
> [developer@chris-g-vm1 ~]$ ldconfig -p | grep libSM
> libSM.so.6 (libc6,x86-64) => /lib64/libSM.so.6
> libSM.so.6 (libc6) => /lib/libSM.so.6
> libSM.so (libc6,x86-64) => /lib64/libSM.so

Multilib shouldn't mess up at all. Just install on your Fedora.

And upgrade your Fedora. The minimum supported version by upstream is 24. You 
should not connect a machine running Fedora 22 to the Internet, since it's not 
getting security upgrades.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] debug helper Q

2017-08-27 Thread David M. Cotter
i got my debug helper sorta working, but have a Q about how they work

how do i show a field within the class/struct as “the value” i want to see?

details: steps i took were this:

go to folder that contains Qt Creator.app
right click "Qt Creator"->show package contents (obviously, right?)
go into Contents->Resources->debugger
edit the file "personaltypes.py "
at the bottom, enter the SIMPLEST POSSIBLE function, like this:
def qdump__YOUR_CLASS(d, value):
d.putValue("i see the light!")
d.putNumChild(0)
substitute your actual class name, above, for "YOUR_CLASS"
now run
you SHOULD see "i see the light!" in the debugger, next to any var of type 
YOUR_CLASS
so far so good?

copy the file "personaltypes.py " into your own dev 
tree, wherever you want to keep your python code
revert the changes to the original one (so they do not conflict)
in Qt Creator 4.3, go to preferences->debuggers->gdb (note: in 4.4 or later, go 
to "preferences->debuggers->locals & expressions")
in that panel, in "Extra Debugging Helpers", put the path to your version of 
the "personaltypes.py " script
run your app again. you should still see "i see the light!". if not, check your 
steps
note that if ANYTHING unexpected is in your python file, it will fail silently, 
no message in the debug log. this is a large part of why i could not figure 
this whole thing out in the first place.

now that you have your script actually RUNNING, you can fiddle with it to make 
it do what you need.

so my last question is this:
If I have a class:

class foo {
type1   var1;
type2   var2;
type3   var3;
};
and say var2 and var3 are implementation details and all i care about is just 
seeing var1 WITHOUT having to click the little "disclosure triangle" (twirly 
arrow), i thought i could just have my helper say this:

def qdump__foo(d, value):
d.putValue(value["var1"])
d.putNumChild(0)
but then all i get is TYPEINFO about "type1", i do not get the VALUE of type1. 
what do i do to see the value?___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Link error while building Qt/32 on Linux 64 bits

2017-08-27 Thread Christian Gagneraud
On 27/08/2017 6:01 pm, "Henry Skoglund"  wrote:

On 2017-08-27 07:42, Christian Gagneraud wrote:

> On 27 August 2017 at 16:08, Thiago Macieira 
> wrote:
>
>> On Saturday, 26 August 2017 18:25:16 PDT Christian Gagneraud wrote:
>>
>>> /usr/bin/ld.gold: warning: skipping incompatible
>>> //usr/lib/x86_64-linux-gnu/libSM.so while searching for SM
>>> /usr/bin/ld.gold: error: cannot find -lSM
>>> /usr/bin/ld.gold: warning: skipping incompatible
>>> //usr/lib/x86_64-linux-gnu/libICE.so while searching for ICE
>>> /usr/bin/ld.gold: error: cannot find -lICE
>>> .obj/qxcbsessionmanager.o:qxcbsessionmanager.cpp:function
>>> QXcbSessionManager::~QXcbSessionManager(): error: undefined reference
>>> to 'SmcCloseConnection'
>>>
>>
>> The undefined reference is caused by the libraries listed right before it
>> not
>> being found.
>>
>
> Not sure to get what you mean.
>
> Given this:
> -lxcb-xinerama -L/home/krys/Projects/qt5/qtbase/lib
> -lQt5ServiceSupport -lQt5ThemeSupport -lQt5EventDispatcherSupport
> -lQt5FontDatabaseSupport -lfontconfig -lfreetype
> -lQt5LinuxAccessibilitySupport -lQt5AccessibilitySupport -lGL -lQt5Gui
> -lQt5DBus -lQt5Core -lpthread -lX11 -lX11-xcb -lXi -lSM -lICE
> -lxcb-xkb -lxcb-render-util -lxcb-render -lxcb -lxcb-shm -lxcb-sync
> -lxcb-xfixes -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm
> -lxcb-shape -lGL
>
> Should I focus at the libs on the right or on the left of "-lSM -lICE"?
> My understanding of ld tells me to look on the right (reverse dependency
> order).
>
> I think I have installed all these libraries. The only weird thing i
> can see comes from my libGL:
> krys@krys-pc:~/Projects/qt5$ ldconfig -p | grep libGL.so
>  libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-375/libGL.so.1
>  libGL.so.1 (libc6) => /usr/lib32/nvidia-375/libGL.so.1
>  libGL.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGL.so
>  libGL.so (libc6,x86-64) => /usr/lib/nvidia-375/libGL.so
>  libGL.so (libc6) => /usr/lib/i386-linux-gnu/libGL.so
>  libGL.so (libc6) => /usr/lib32/nvidia-375/libGL.so
>
> And apt-get always complaining with:
> /sbin/ldconfig.real: /usr/lib/nvidia-375/libEGL.so.1 is not a symbolic
> link
> /sbin/ldconfig.real: /usr/lib32/nvidia-375/libEGL.so.1 is not a symbolic
> link
>

Those nvidia errors I also had for a long time, but upgrading Nvidia driver
solved it (for example to 'nvidia-384') by adding this ppa:
sudo add-apt-repository ppa:graphics-drivers/ppa


Thanks a lot for the tips, I'll look into that.

Chris.

PS: sorry for html answer, on my googALL, seesALL phone right now.


Rgrds Henry


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest