Skip to main content
1-Visitor
November 24, 2025
Question

How to create a snap with C SDK

  • November 24, 2025
  • 2 replies
  • 212 views

Hi,

 

I have this code I can compile with C-SDK I want to make a .snap from.

I'm using the version 3.2.0.3436.

I used cmake and everything worked fine between thingworx and the agent I coded.

The architecture is as such :

 

> c-sdk

     > build

     > examples

          > my code

     > lib

     > src

     > test

 

cmake is done in c-sdk>build

 

The thing is, I now need to make a snap from this project and I don't really know where to start. If I make my snap from my project, I have the same errors I used to have before I did cmake in c-sdk>build (twApi.h: No such file or directory).

 

I even tried to correct it by adding this in my CMakeLists.txt :

 

include_directories(
    ${TW_SDK_PATH}/include
    include
    ${TW_SDK_PATH}/src
    ${TW_SDK_PATH}/src/api
    ${TW_SDK_PATH}/src/config
    ${TW_SDK_PATH}/src/fileTransfer
....)
 
But then I was met with these errors : "unknown type name 'DATETIME'" and many others.
 
Can anyone help me build that project correctly ? I am lacking a lot and still learning. I've never coded in C or Thingworx before so everything is new to me.
 
The finale result would be to have a snap. Is it even possible at this point ?
 
Thank you to anyone who could help !

2 replies

19-Tanzanite
November 25, 2025

This is more a snap question than a CSDK or ThingWorx question, I suggest you try a snap forum.

18-Opal
November 27, 2025

Hello,

 

Check Snapcraft docs: https://documentation.ubuntu.com/snapcraft/stable/how-to/integrations/craft-a-c-or-cpp-app/

 

Use "plugin: cmake" in snapcraft.yaml, here's a minimal example: https://github.com/snapcraft-docs/cmake-classic-example

 

Snap enables Network interface by default, so you shouldn't need to set any extra permissions.

 

Just out of curiosity -- why a snap? The best thing about snaps is that they can be published to snapcraft.io, which is probably not what you plan to do. Otherwise AppImage sounds like a more obvious, cross-platform, dependency-free packaging mechanism, and they are easier to create...

 

/ Constantine