Compiling DSFLib 0.1 with gcc on LinuxDSFLib 0.1NOTE: this version of DSFLib, which I am calling "0.1", has been replaced with a new version that I am calling "0.2". Please see the page DSFTool for gcc. Although there are no "official" tools for editing X-Plane scenery, a C/C++ library called DSFLib has been made available as Free Software for developers to create their own tools. Since I am primarily a Linux user and DSF2Text is available only for Windows, I compiled DSFLib using gcc under Linux. Apparently I was the first one to do so successfully, since modifications had to be made for the library to compile. I have not yet used the library beyond a simple test application. DownloadBuilding the LibraryAfter unzipping the archive, the directory called DSFLib contains two subdirectories. Library contains the library code, and test contains the code for examples and test cases. To compile the library: g++ -fpic -g -c *.cpp
gcc -fpic -g -c md5.c
To link the library: g++ -shared -Wl,-export-dynamic -o libDSF.so *.o
Building the ExamplesCopy libDSF.so to the test directory. The two test codes included with the original DSFlib are called DSFLib_Print.cpp and DSFLib_TestGen.cpp. Note that they lack a main function so they will not run as stand-alone programs. I modified DSFLib_Print.cpp to run as a stand-alone program, which is called print.cpp. To build my test program with the example .DSF file: g++ -g -c print.cpp
g++ -L. -lDSF -o print -Wl,-rpath,. print.o
To run my test program: ./print +33-120.dsf test.txt
Explanation of Compiling Options
Explanation of Linking OptionsI chose to build DSFLib as a shared library. It would also make sense to link it statically--in that case, adjust the options accordingly.
|