QCad 2.0.5 on Intel Mac OS X


Looking for a program to view and edit .dxf files on the Mac I stumbled upon QCad from Ribbonsoft. This allows you to view and edit Autocad DXF files.

Compiling QCad

Although the QCad source is under GPL, only demo versions are availabale as binary. So, compiled QCad from source. Follows the list and some links I used to get QCad compiled under OS X 10.4.11 with gcc-4.0 (and using a MacPorts QT3 installation, present from previous MacPort installed sw)

### install the QT3 package with MacPorts.
### You are expected to be familiar with MacPorts
### and have it installed
$ ssh -l yourAdminUser localhost
## this is used to logon as admin from within an
## ordinary user terminal session
$ sudo port selfupdate
$ sudo port install qt3
### compile QCad
$ cd /opt/local
$ sudo mkdir qcad
$ sudo cp /Users/yourUserId/Desktop/QCad/qcad- .
$ tar xfz qcad-
$ rm qcad-
### to prevent "qmacstyle_mac.h: No such file or directory" error,
### applied patch manually (as patch raised errors) by commenting
### out (with vi) in src/main.cpp:
//#ifdef __APPLE__
//#ifdef __APPLE__
// QApplication::setStyle(new QMacStyle());
$ export QTDIR=/opt/local/lib/qt3 ## MacPorts QT3 location
$ export QMAKESPEC=/opt/local/lib/qt3/mkspecs/macx-g++
$ cd scripts
$ ./build_qcad.sh notrans

Running QCad

Doubleclik QCad.app or start from terminal window:

$ open /opt/local/qcad/qcad-

Compile QCad under OS X 10.5.8

$ cd /opt/local/qcad/qcad-
$ sudo vi build_qcad.sh # set Qt vars in build script (setting environment vars didn't work for me)
export QTDIR=/opt/local/lib/qt3
export QMAKESPEC="/opt/local/lib/qt3/mkspecs/macx-g++"
export PATH=$QTDIR/bin:$PATH
$ sudo vi ../qcadlib/src/engine/rs_entity.cpp # edit or apply this <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288190">Debian patch</a>
- os &lt;&lt; " layer address: " &lt;&lt; (int)(e.layer) &lt;&lt; " ";
+ os &lt;&lt; " layer address: " &lt;&lt; (long)(e.layer) &lt;&lt; " ";
$ sudo vi ../qcadlib/src/engine/rs_layer.cpp # same
- &lt;&lt; " address: " &lt;&lt; (int)(&amp;l)
+ &lt;&lt; " address: " &lt;&lt; (long)(&amp;l)
$ sudo vi ../qcad/src/qc_applicationwindow.cpp # fix Help info (Qt assistant is in /opt/local/bin/qt3 which is part of the $PATH set)
- assistant = new QAssistantClient(RS_SYSTEM-&gt;getAppDir()+"/bin", this);
+ assistant = new QAssistantClient("", this);
$ sudo rm ../dxflib/src/*.o; # clean .app and all object files
$ sudo rm ../fparser/src/*.o;
$ sudo rm ../qcad/src/obj/*.o;
$ sudo rm ../qcadactions/src/obj/*.o;
$ sudo rm ../qcadcmd/src/obj/*.o;
$ sudo rm ../qcadguiqt/src/obj/*.o;
$ sudo rm ../qcadlib/src/obj/*.o;
$ sudo rm -R ../qcad/QCad.app;
$ sudo ./build_qcad.sh notrans # build QCad

One Reply to “QCad 2.0.5 on Intel Mac OS X”

  1. (august 25 2010) update
    I am working hard to get QCAd compiling fine on OSX, WIndows and Linux with qt4. No more messing around with qt3!
    The software is still alpha, but tat really doesn’t mean it doesn’t work… There are just still some issues to iron out. But you can already draw like in QCad CE, load and save files etc…
    here is the project : https://sourceforge.net/projects/caduntu

Comments are closed.