Custom Functions > To Compile the cmplxsum Sample Custom Function
To Compile the cmplxsum Sample Custom Function
1. Open a Visual Studio Command Prompt.
2. Navigate to the PTC Mathcad Prime installation folder.
3. At the prompt, enter the following commands to navigate to the cmplxsum folder and view its content:
Command
Description
cd Custom Functions/cmplxsum
Changes the directory to the cmplxsum folder.
dir
Lists the files in the current folder.
Ensure that CMPLXSUM.C is listed.
4. Ensure the presence of the include and library files in the Custom Functions folder:
Command
Description
dir ..
Lists the files in the Custom Functions folder.
Ensure that MCADINCL.H and mcaduser.lib are listed.
5. To compile and link the sample function, enter the following commands:
Command
Description
cl /I../ cmplxsum.C /LD /link /out:../cmplxsum.dll /entry:"DllEntryPoint" ../MCADUSER.LIB
Generates the cmplxsum.dll file in the Custom Functions folder.
Additional Information
The sample extension sub-folder cmplxsum contains a single CMPLXSUM.C source file, and the compilation and linking process produces the cmplxsum.dll file.
CMPLXSUM.C shows that FUNCTIONINFO is defined as cmplxsum and accepts two complex arguments (a,b).
Function name cmplxsum is part of the produced cmplxsum.dll file name. To use this custom function in your worksheet, close and reopen PTC Mathcad Prime and then evaluate cmplxsum(a,b).
Was this helpful?