distributing a app frozen by cx_freeze

F

Flavio

Hi,

After a good deal of tunig I managed to freeze my application.

I ended up with an executable, and a Bunch of .so files in the
install-dir.
It runs fine in the original machine.

I copied the install folder to another machine but the executable wont
run. Here's the traceback:

Traceback (most recent call last):
File
"/home/fccoelho/Downloads/cx_Freeze-3.0.2/initscripts/Console.py", line
26, in ?
File "epigrass.py", line 4, in ?
ImportError: /home/flavio/freeze/qt.so: undefined symbol:
_ZNK9QSGIStyle9classNameEv


It is looking for the Original cx_freeze installation!! Do I have to
distribute cxFreeze with my app? I don't think so. But in that case,
how do I remove this dependency?

any help is appreciated

Flávio
 
C

Carl Banks

Flavio said:
Traceback (most recent call last):
File
"/home/fccoelho/Downloads/cx_Freeze-3.0.2/initscripts/Console.py", line
26, in ?
File "epigrass.py", line 4, in ?
ImportError: /home/flavio/freeze/qt.so: undefined symbol:
_ZNK9QSGIStyle9classNameEv

It is looking for the Original cx_freeze installation!!

I doubt it is.

Do you have the QT installed on the second system? If you do, is it
the same version as on the original system? Are you sure you copied
all the files over? It looks like qt.so is trying to access a C++
symbol in another library (libqt.so perhaps?), but that other library
isn't installed.

cx_freeze probably only packages the Python module binding to the QT
library; not the library itself. If so, you'll need to install QT on
the other system, or get cx_freeze to bundle up the QT shared library
(if the license allows it, of course), or rebuild the qt.so with the
static QT libraries.


Carl Banks
 
F

Flavio

Thanks for the hint. I'll try to get cx_freeze to bundle up other
shared libraries it may not be bundling such as qtcanvas, qtext, qtui,
etc. and see if it works.

I'll post back the results to help other poor souls like me.

Thanks
 
F

Flavio

Well I managed to get rid of the undefined symbol message by copying
all qt libs to the freeze directory, the problem is that now the
package is huge (83MB)!

So my question is: is there a way to find out exactly which lib is
missing ?

Thanks
 
C

Carl Banks

Flavio said:
Well I managed to get rid of the undefined symbol message by copying
all qt libs to the freeze directory, the problem is that now the
package is huge (83MB)!

So my question is: is there a way to find out exactly which lib is
missing ?

You know, if you're doing this on Linux, it's not all that unreasonable
to require QT to be installed on the target system. Any reasonable
distribution has it nicely packaged.

But, if you must, "ldd qt.so" will list library dependencies of qt.so.


Carl Banks
 
F

Flavio

I know, but the whole point of cx_freeze is to generate standalone
executables, so asking for an installation of an specific version of Qt
is just a little better than asking the end user to install from
source...
 
E

Edward Elliott

Flavio said:
ImportError: /home/flavio/freeze/qt.so: undefined symbol:
_ZNK9QSGIStyle9classNameEv
So my question is: is there a way to find out exactly which lib is
missing ?

yes - find the one with that symbol. wash, rinse, repeat. ;)
 
S

Serge Orlov

Flavio said:
Well I managed to get rid of the undefined symbol message by copying
all qt libs to the freeze directory, the problem is that now the
package is huge (83MB)!

So my question is: is there a way to find out exactly which lib is
missing ?

I haven't done that myself, but I've had an idea of discovering
dependances for dynamic languages: run your test suite and register
which files are loaded (byte code, dlls, datafiles), then remove from
the list all files your know they were used only for testing, that's
it, now you know all the files that you need to run your application.

On linux you can find you which .so files are loaded by looking at file
/proc/self/maps at the end of running your test suite. To find out
which python bytecode files were loaded you can use -v option of
python, it will print all files that were loaded to stderr, to separate
its output from other stderr stuff, you can redirect sys.stderr to some
other file.

After you've done all that work, I'm not sure if you need cx_freeze.
You just need to write little startup script that will set
LD_LIBRARY_PATH, PYTHONPATH and start your main script.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top