I tried to include curl, a third party library into a Visual Studio C/C++ application project with the target Colibri IMX6DL
I created an C/C++ Torizon embedded project in VS2019 following the steps in Build and Run your First C Application. It built and ran alright.
With the same project, I did the following steps mimicking steps in C/C++ Development and Debugging on Torizon Using Visual Studio | Toradex Developer Center.
Step 1: in Project > Properties-> Configuration Properties > C/C++ > General->Additional Include Directories, it has got “%(ClCompile.AdditionalIncludeDirectories)” (the default)
Step 2: Set the C++ language to v11. (the default; same as C”
Step 3: In Configuration Properties > Linker > Input-> Library Dependencies, it has got “curl”.
Step 4: In Torizon C/C++ application->Configuration->.\appconfig_0->->devpckages, it has got “libcurl4-openssl-dev:armhf”
Step 5: likewise, n Torizon C/C++ application->Configuration->.\appconfig_0->->extra pages, it has got “libcurl4”
When I did rebuild, I obtained the following display On the Output pane -
1>------ Build started: Project: TorizonApp8, Configuration: Debug_debian_arm32v7_bullseye x64 ------
1>Torizon Container Build
1>Containers are up to date.
1>Validating sources
1>Copying sources remotely to ‘127.0.0.1’
1>Validating architecture
1>Validating architecture
1>Starting remote build
1>Compiling sources:
1>main.cpp
1>Linking objects
1>/usr/lib/gcc-cross/arm-linux-gnueabihf/10/…/…/…/…/arm-linux-gnueabihf/bin/ld : error : cannot find -lcurl
1>collect2 : error : ld returned 1 exit status
1>Done building project “TorizonApp8.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Question:
- What step(s) have I missed? (I did see curl in /usr/bin directory.)
- If I should invoke curl API in my source code, will compiler able to find curl.h if I do
- #include <curl.h>
Thanks,