cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

How to create a snap with C SDK

RK_14053982
2-Explorer

How to create a snap with C SDK

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 2
Rocko
19-Tanzanite
(To:RK_14053982)

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

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


Vilia (my company) | GitHub | LinkedIn
Announcements


Top Tags