Search code examples
c++dllcygwinmingw

How to install dxflib [a C++ library] on Windows 8.1?


So I want to install the dxflibn (it allows for the program to read and write .dxf files). You can find the files here. I found, on there site, this Programmer's guide. If you go to page 3, it says how to install the library. It says to use cygwin and MinGW32. I have not used this tools before so need some help.

From what I read (when I was researching these tools), the MinGW32 is used to install the compiler needed and the Cygwin can emulate the Unix system. I do have some experience with Unix command line but limited.

Back to the instruction on page 3, it says to run two commands. The first command is for executable but from the file I downloaded (the dxflib zip) there is no "configure" file to execute. While searching even more, I found the the .pro file that is in the folder of the library can produce a make file but not sure how.

Questions:

  1. What exactly do I need to do to install the dxflib?
  2. After I install it, for me to run it from my C++ code, what do I need to do? I read here that I need to: A) put the header files in a location which your compiler is aware of B) put the dll files in a location which your linker is aware of.

Any help would be amazing, tnx :)


Solution

  • I was able to find a solution after all.


    For question 1:

    I first went and installed qmake (from the Qt website).

    After that, I needed to include in my "system parameters" the qmake.exe so I can run it from the Command Prompt line (like it says here).

    And finally, I opened cmd, navigated to the library directory and run the command qmake -spec win32-g++ dxflib.pro (as suggested here). This created the make file.

    Now run the command MinGW32-make. This will create a "release" folder with with a static library (that will be needed a the next step) and come .o files.


    For question 2:

    I used the Dev-C++ IDE. After I had created a project, I went to "project>project options".

    Under "Directories>Include Directories" I added the path of the source code of the library (path_of_where_you_unziped_the_library\dxflib-3.7.5-src\src).

    Also, under "Parameters>Linker" I added the .a file that is under the "release" folder (path_of_where_you_unziped_the_library\dxflib-3.7.5-src\release)

    This worked for me :)