Modifying and Compiling UDFs
Windows

|
Requirement! Microsoft Visual Studio 2013 (or later) is installed.
|
To compile the three UDF files delivered with GeoDict, open AddiDictUDF.sln with Visual Studio 2013 (or later) and build the solution.
Alternatively, you can run compilex.bat from the Visual Studio command prompt (x64). This creates three runtime library files that can be used in AddiDict:
- UDFUserData.dll
- CollisionUDF-Count.dll
- CollisionUDF-Hamaker.dll
The simplest way to to create additional UDFs, add them as additional projects to your solution is to create a copy of an existing *.cpp and *.vcxproj file first. For example:
- Create MyParticleUDF.cpp as a copy of ParticleMotionUDF-Standard.cpp and MyParticleUDF.vcxproj as a copy of ParticleMotionUDF-Standard.vcxproj.
- Open the AddiDictUDF.sln solution in Visual Studio
- Add the existing project MyParticleUDF.vcxproj.
This project now still contains the old file UDFUserData.cpp. Therefore, remove this file from the project and, instead, add the existing item MyParticleUDF.cpp to the project. Then rebuild the project in Visual Studio or run compilex.bat to create the runtime library files.
|
Linux

|
Requirement! gcc-c++ compiler and libraries are installed.
|
The simplest way to work with UDFs is as follows:
- Change into the UDF directory with:
cd ./geodict2024/UDF
- Copy one of the sample files. For example:
cp ParticleMotionUDF-Standard.cpp MyParticleUDF.cpp
- Open MyParticleUDF.cpp in a text editor of your choice.
The code must be compiled after making all needed changes. For this, the compile.sh script can be used:
./compile.sh MyParticleUDF.cpp
This script creates the runtime library MyParticleUDF.so, that can be used by GeoDict.
|