The C++ sample programs in the STEP Tools® software documentation are Visual Studio projects packed as zipfiles, one for each different version of Visual Studio and one with a Makefile-based project for MacOS, Linux, and UNIX platforms.

Save the package to local disk and then unzip. Most of the sample programs create a Console application that you can run from the command line.

Windows - Visual Studio

On Windows, open the project file with Visual Studio. The project usually has settings for 32bit/64bit and linking with static libraries or DLLs versions of the STEP Tools® software libraries. Open the Configuration Manager and select a combination that matches your setup:

Once you have set the configuration as shown below, compile the program by selecting "Build All". After you are finished with the sample programs, you can create and configure your own brand-new projects.

MacOS / Linux / Unix

On MacOS, Linux, and other Unix systems, the project directory contains a makefile that builds the sample program. Simply unzip the package and compile the program by typing make.

The makefile uses ROSE, ROSE_INCLUDE, and ROSE_LIB environment variables to find the STEP Tools® software libraries. After you are finished with the sample programs, you can use it as a template or configure a makefile from scratch.

anvil[27]: unzip geometry_unix.zip
Archive:  geometry_unix.zip
  inflating: geometry/context_utils.cxx
  inflating: geometry/context_utils.h
  inflating: geometry/geometry.cxx
  inflating: geometry/geometry_out.stp
  inflating: geometry/geometry_utils.cxx
  inflating: geometry/geometry_utils.h
  inflating: geometry/Makefile
  inflating: geometry/make_box.cxx
  inflating: geometry/make_const_box.cxx
  inflating: geometry/README.txt
  inflating: geometry/unit_utils.cxx
  inflating: geometry/unit_utils.h
anvil[28]: cd geometry
anvil[29]: make
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim geometry.cxx
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim make_box.cxx
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim make_const_box.cxx
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim geometry_utils.cxx
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim context_utils.cxx
gcc -c -O -I/usr/steptools_20/include -I/usr/steptools_20/include/stp_aim unit_utils.cxx
gcc   -L/usr/steptools_20/lib/linux_x64_gcc  -o geometry geometry.o \
   make_box.o make_const_box.o geometry_utils.o context_utils.o unit_utils.o \
   -lstp_aim -lrosemath -lrosexml -lrose -lpthread -lrt