I’m just about to start code a project using otb’s C++ API.
My system: Windows11 Version of the OTB: 9.0
When I was following the steps in C++ API tutorials, I stuck at the step to cmake the helloworld program. Below are the errors in my terminal, and I’m not sure what to do with this.
1.Target “HelloWorldOTB” links to: Boost::filesystem
but the target was not found.
2. The link interface of target “OTBCurlAdapters” contains: CURL::libcurl
but the target was not found.
3. The link interface of target “OTBSupervised” contains: Boost::serialization
but the target was not found.
I guess I might have set OTB_DIR correctly as below:
set (OTB_DIR “C:\Users\67006\Desktop\OTB-9.0.0-Win64\lib\cmake\OTB-9.0”)
set (ITK_DIR “C:\Users\67006\Desktop\OTB-9.0.0-Win64\lib\cmake\ITK-4.13”)
The support on windows platform is not at the same level as on Linux but maybe I can help.
Can you provide the full CMake command that you call ?
It guess you are trying to compile it directly from the official package? You don’t build from source?
Can you also provide the command line to build helloworldOTB ?
It looks like it is missing a find_package(Boost REQUIRED COMPONENTS filesystem serialization)
the Boost_LIBRARY_DIR is not right as the libs are in OTB-9.0.0-Win64\lib, but i don’t know why it can’t find Boost, can you try : cmake . -DCMAKE_PREFIX_PATH=/PathTo/OTB-9.0.0-win64/lib/cmake or even without lib/cmake at the end ?