How to Setup the FindSurface SDK

This page describes how to get started to create FindSurface SDK applications.

How to Setup the FindSurface SDK in Visaul Studio

Prerequisites

Step1: Create Win32 Project

  1. Open Visual Studio

  2. Select File > New > Project... menu.

  3. In the New Project dialog,

    • under 2017 : choose the Win32 Console Application on Win32 category.

    • above 2017 : choose the Windows Desktop Wizard on Windows Desktop category.

  4. Be sure followings for this tutorial.

    • Application type is Console Application
    • Uncheck Precompiled header check box
    • Check Empty project check box

    > under 2017

    > above 2017

Step2: Set up your environment

After creating project, you need to set your SDK path. In this tutorial, we assume that the install path of the FindSurface SDK is C:\CurvSurf_SDK\.

  1. Go to Project > Properties.

  2. In the Property Pages dialog, choose the VC++ Directories.

  3. Select Include Directories, and click <Edit...>.

  4. In the Include Directories dialog, add include path of FindSurface SDK. For example, C:\CurvSurf_SDK\include.

  5. Set the Library Directories in the same way.

  6. (option) In the Property Pages dialog, choose the Debugging. And set the Environment field like below.

    PATH=%PATH%;path-to-findsurface-dll
    

    For example, C:\CurvSurf_SDK\lib\x86 or C:\CurvSurf_SDK\lib\x64

  7. In the Property Pages dialog, choose the Linker > Input.

  8. Add FindSurface.lib to Additional Dependencies.

Step3: Build and run a sample code

Add a new file named main.c or main.cpp to your project. Type the below code, compile and run the sample code.

#include <FindSurface.h>
#include <stdio.h>

int main(void)
{
    FIND_SURFACE_CONTEXT ctx;
    int ret;

    ret = createFindSurface(&ctx);
    if (ret == FS_NO_ERROR) {
        printf("Hello FindSurface\n");
        releaseFindSurface(ctx);
    }

    return 0;
}

Next steps

In this page, you learned how to set up development environment for FindSurface SDK. Proceed to the following link to learn how to use FindSurface SDK.

How to Setup the FindSurface SDK with GCC

Prerequisites

Note: FindSurface SDK uses different .so files for build and runtime. Read install guide for more detail.

Build and run a sample code

Create a new file named main.c or main.cpp. Type the below code, compile and run the sample code with following command.

Note: In this example, we assume that dummy .so file exists on /home/CurvSurf/libFindSurface/lib_import/x86_64.
Use your dummy .so file path that specified on install step.

#include <FindSurface.h>
#include <stdio.h>

int main(void)
{
    FIND_SURFACE_CONTEXT ctx;
    int ret;

    ret = createFindSurface(&ctx);
    if (ret == FS_NO_ERROR) {
        printf("Hello FindSurface\n");
        releaseFindSurface(ctx);
    }

    return 0;
}
$ gcc -o HelloFindSurface main.c -L/home/CurvSurf/libFindSurface/lib_import/x86_64 -lFindSurface
(Run demo) $ ./HelloFindSurface

Next steps

In this page, you learned how to set up development environment for FindSurface SDK. Proceed to the following link to learn how to use FindSurface SDK.