aws / aws-iot-device-sdk-cpp

SDK for connecting to AWS IoT from a device using C++
http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com
Apache License 2.0
122 stars 111 forks source link

pthread.h not found #119

Closed jbarrena closed 4 years ago

jbarrena commented 6 years ago

Hi,

I am trying to compile the SDK for Windows 10 x64 using cmake & msbuild. I cloned the repository by master branch, and tryed cmake -G "Visual Studio 14 2015 Win64" ../.

The following error appeared on CMakeError.log: CheckIncludeFile.cxx(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory.

Do we know why cmake is looking for pthread.h when I am compiling it for Windows??

Thanks for the help,

Julen.

ColdenCullen commented 6 years ago

Can you please paste the command line output you got when running CMake? I'm curious to see what part of that failed.

jbarrena commented 6 years ago

Hi,

The problem was with Git. It was not properly configured. Once I corrected the issue, everything went well. Thanks for your interest. Really appreciated.

Julen.

jbarrena commented 6 years ago

Hi again,

I am now trying to cross-compile the libraries for a Linux Embedded platform. I modified ToolchainFile.cmake and try to cross-compile the libraries. Similar errors appeared during compilation.

Attached the CMakeOutput.log and CMakeError.log

Any help would be really appreciatted.

Thanks and kind regards,

Julen.

CMakeError.log

CMakeOutput.log

ColdenCullen commented 6 years ago
CMakeFiles/cmTC_2dca4.dir/CheckSymbolExists.cxx.o: In function 'main':
CheckSymbolExists.cxx:(.text+0x16): undefined reference to 'pthread_create'

This isn't a compile error, but a link error. Did you add -lpthread to your link flags somewhere? The most common way to do this is via target_link_libraries.

jbarrena commented 6 years ago

Hi,

I managed to find pthread libraries, but errors are continuing to block the compilation. This is something strange, as the compilation stops but no CMakeError.log is generated. Only CMakeOutput.log and a few messages on Terminal:

-- Found Threads: TRUE
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found version "1.0.2g") Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.5/Modules/FindOpenSSL.cmake:360 (find_package_handle_standard_args) network/CMakeLists.txt.in:66 (find_package) cli/CMakeLists.txt:83 (include)

-- Configuring incomplete, errors occurred! See also "/home/ues/prj/AWS/build/CMakeFiles/CMakeOutput.log".

Attached also the output log.

Thanks again for your help.

Regards, Julen.

CMakeOutput.log

ColdenCullen commented 6 years ago

Do you have a version of OpenSSL built for the platform you're targeting installed? CMake cannot find it. Try passing -DOPENSSL_ROOT_DIR=C:/Path/To/OpenSSL/ to CMake to force it to look in the correct location.

jbarrena commented 6 years ago

I passed OPEN_SSL_ROOTDIR as -DOPENSSL_ROOT_DIR=/usr/local/oecore-x8664/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/bin (which is the location where cross-compiled openssl executable is) but nothing changes. Same error.

Thanks for your reply.

Julen.

ColdenCullen commented 6 years ago

CMake wants the path to the libraries, not the executables. Try using lib instead of bin.

jbarrena commented 6 years ago

No way to find OPENSSL package. I pass the lib directory from command line, and also modified the CMakeLists file to define the paths, but no library found. I also tried to specify the file name in OPENSSL_LIBRARIES but no change on the result?

Any ideas??

github-actions[bot] commented 4 years ago

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.