aws / aws-greengrass-core-sdk-c

SDK to use with functions running on Greengrass Core using C
https://aws.github.io/aws-greengrass-core-sdk-c/
Apache License 2.0
27 stars 13 forks source link

unable to build lambda function locally #8

Open kunalfleethawks opened 3 years ago

kunalfleethawks commented 3 years ago

Hi Team,

I have followed instruction as per readme.md. I was able to build sdk using CMAKE provided by cross compiler. But When I try to build lambda function using simple hello_world.c it fails with following error:

image

Additional Information :

I have set following environment variable:

export CMAKE_PREFIX_PATH=/home/kunal/Documents/github/aws-greengrass-core-sdk-c/build/aws-greengrass-core-sdk-c

CMAKE File:

# minimal CMakeLists.txt for the AWS Greengrass SDK for C
cmake_minimum_required(VERSION 2.8)
# "my_gg_native_function" is just an example value.
project(my_gg_native_function)
# Locate the AWS Greengras SDK for C package.
# Requires that you build with:
#   -Daws-greengrass-core-sdk-c_DIR=/path/to/sdk_build
# or export/set:
#CMAKE_PREFIX_PATH=/home/kunal/Documents/github/aws-greengrass-core-sdk-c/build
find_package(aws-greengrass-core-sdk-c REQUIRED)

add_executable(hello_world_example hello_world.c)
target_link_libraries(hello_world_example aws-greengrass-core-sdk-c)
target_compile_options(hello_world_example PRIVATE -Werror -Wall -Wextra -pedantic -std=c99 -Wc++-compat)

Steps which i did:

export CMAKE_PREFIX_PATH=/home/kunal/Documents/github/aws-greengrass-core-sdk-c/build/aws-greengrass-core-sdk-c```
cd my_gg_native_function
mkdir build
cd build
make .. 
// Above error is displayed