[solved] Qcad 3.16.3 can't run on Ubuntu server 16.04

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
dungle25895
Registered Member
Posts: 1
Joined: Thu Dec 29, 2016 4:06 am

[solved] Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by dungle25895 » Thu Dec 29, 2016 4:27 am

Hi everybody,

I've found the document how to run qcad on server here: viewtopic.php?t=3568

Then I try run qcad 3.16.3 on ubuntu server 16.04 with command:

Code: Select all

./dwg2pdf -f /tmp/sample.dxf
it throw error
3.16.3.png
3.16.3.png (8.78 KiB) Viewed 10262 times
Then I try with qcad 3.15.5, it work as well
3.15.5.png
3.15.5.png (9.26 KiB) Viewed 10262 times
I think problem from qt5. Anybody help me please

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by andrew » Thu Dec 29, 2016 5:24 pm

Thanks for your report. I can confirm that this has indeed changed with Qt 5.

Please save the appropriate attached "offscreen" plugin to the "platforms" directory of your QCAD installation and unpack it (gunzip libqoffscreen.so.gz). You might also have to make it executable (chmod a+x libqoffscreen.so).

You can then run dwg2pdf (and other command line utilities) with the command line switch -platform offscreen:

Code: Select all

./dwg2pdf -platform offscreen -o out.pdf in.dxf
If you are having problems with getting texts rendered, you might have to set the QT_QPA_FONTDIR environment variable to a path which contains the fonts you want to use.
Attachments
libqoffscreen.so.gz
64bit
(52.98 KiB) Downloaded 479 times
libqoffscreen.so.gz
32bit
(57 KiB) Downloaded 478 times

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by andrew » Wed Jan 04, 2017 2:08 pm

QCAD 3.16.4 is now available. The new Linux packages include the offscreen plugin as well as Qt fonts. Usage information also has been updated accordingly.

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by hungerburg » Wed Jan 25, 2017 2:15 pm

On my Xubuntu 16.04 I get this - run with 1) display, 2) without display, 3) without display offscreen; only 1) creates a PDF:

Code: Select all

$ /opt/qcad/dwg2pdf MY.dxf 
QCAD version  3.16.4
...
Converting
  from: /tmp/MY.dxf
  to  : /tmp/MY.pdf

Code: Select all

$ DISPLAY="" /opt/qcad/dwg2pdf MY.dxf 
QCAD version  3.16.4
Fatal:    QXcbConnection: Could not connect to display 
/opt/qcad/qcad: Zeile 8: 16180 Abgebrochen             (Speicherabzug geschrieben) LD_LIBRARY_PATH="$DIR" "$binary" "$@"

Code: Select all

$ DISPLAY="" /opt/qcad/dwg2pdf -platform offscreen MY.dxf 
QCAD version  3.16.4

(qcad-bin:16195): Gtk-WARNING **: cannot open display: 
The last should not fail; Curious as to why Gtk - Maybe some theme - but offscreen. Can you advise?

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by andrew » Thu Jan 26, 2017 8:30 am

hungerbug: can you try without the DISPLAY="" bit but with -platform offscreen?

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Qcad 3.16.4 can't run on headless Ubuntu 16.04

Post by hungerburg » Thu Jan 26, 2017 11:32 am

Hello Andrew, setting DISPLAY="" is the quickest way to test how it works on a headless system. I intend to do this so I took the time to make it run and some magic tools lead the way - This is the expanded command 3) from above with ltrace added:

Code: Select all

DISPLAY="" LD_LIBRARY_PATH="/opt/qcad" ltrace -CS -f -n2 /opt/qcad/qcad-bin -no-dock-icon -no-gui -allow-multiple-instances -platform offscreen -autostart "scripts/Pro/Tools/Dwg2Pdf/Dwg2Pdf.js" /opt/qcad/dwg2pdf -f /tmp/MY.dxf 2>/tmp/out.txt
It not only loads gtk, it even loads libvorbis e.a! A look at what it wants from those libs, its native Themeing. Voilà the working command:

Code: Select all

QT_STYLE_OVERRIDE="" QT_QPA_PLATFORM=offscreen QT_QPA_FONTDIR=/usr/share/fonts/ DISPLAY="" LD_LIBRARY_PATH="/opt/qcad" ltrace -CS -f -n2 /opt/qcad/qcad-bin -no-dock-icon -no-gui -allow-multiple-instances -autostart "scripts/Pro/Tools/Dwg2Pdf/Dwg2Pdf.js" /opt/qcad/dwg2pdf -f /tmp/MY.dxf 2>/tmp/out.txt
Remember that recently you dropped "-style plastique" from the starter batch? I did suggest that e_confused A consolidated patch for dwg2pdf soon to appear in flyspray…

Peter

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by andrew » Thu Jan 26, 2017 11:38 am

Thanks for looking into this. I can reproduce this here when using the arguments -style gtk explicitly.

I suppose this would also work then:

Code: Select all

./dwg2pdf -style "" -platform offscreen ...

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by hungerburg » Thu Jan 26, 2017 2:03 pm

Hello Andrew, the style="" flag here does not help from reaching out to GTK, when DISPLAY is not set; while setting QT_STYLE_OVERRIDE="" does. (Also -style="asdf" works!)

Your are right, that the tools should not set platform, all the fonts are gone then!

PS: From strace I learned, that qcad-bin looks into /home/andrew/opt/Qt/… Are these search paths hardcoded? I guess they should not be there.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Qcad 3.16.3 can't run on Ubuntu server 16.04

Post by andrew » Thu Jan 26, 2017 2:42 pm

hungerburg wrote:while setting QT_STYLE_OVERRIDE="" does. (Also -style="asdf" works!)
OK, thanks.
PS: From strace I learned, that qcad-bin looks into /home/andrew/opt/Qt/… Are these search paths hardcoded?
That's correct. Qt libraries / binaries all contain these hard-coded paths as far as I know.

Post Reply

Return to “QCAD Troubleshooting and Problems”