Windows: building test_package fails
Summary
After fixing #101 (closed), conan create still fails when trying to build the test_package:
linkahead/0.3.0-dev (test package): Running CMake.build()
linkahead/0.3.0-dev (test package): RUN: cmake --build "C:\Code\caosdb\src\caosdb-cpplib\test_package\build\msvc-194-x86_64-17-release" --config Release
MSBuild version 17.11.9+a69bbaaf5 for .NET Framework
1>Checking Build System
Building Custom Rule C:/Code/caosdb/src/caosdb-cpplib/test_package/CMakeLists.txt
The vcpkg manifest was disabled, but we found a manifest file in C:\Code\caosdb\src\caosdb-cpplib\. You may want to enable vcpkg manifests in your properties page or pass /p:VcpkgEnableManifest=true to the msbuild invocation.
test_info.cpp
test_info.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl caosdb::info::v1::VersionInfo::~VersionInfo(void)" (??1VersionInfo@v1@info@caosdb@@UEAA@XZ) referenced in function "private: virtual void __cdecl linkahead::info::test_info_create_info_from_proto_info_Test::TestBody(void)" (?TestBody@test_info_create_info_from_proto_info_Test@info@linkahead@@EEAAXXZ) [C:\Code\caosdb\src\caosdb-cpplib\test_p
ackage\build\msvc-194-x86_64-17-release\test_info.vcxproj]
test_info.obj : error LNK2019: unresolved external symbol "protected: __cdecl caosdb::info::v1::VersionInfo::VersionInfo(class google::protobuf::Arena *,bool)" (??0VersionInfo@v1@info@caosdb@@IEAA@PEAVArena@protobuf@google@@_N@Z) referenced in function "private: virtual void __cdecl linkahead::info::test_info_create_info_from_proto_info_Test::TestBody(void)" (?TestBody@test_info_create_info_from_proto_info_Test@info@linka
head@@EEAAXXZ) [C:\Code\caosdb\src\caosdb-cpplib\test_package\build\msvc-194-x86_64-17-release\test_info.vcxproj]
test_info.obj : error LNK2019: unresolved external symbol "const caosdb::info::v1::VersionInfo::`vftable'" (??_7VersionInfo@v1@info@caosdb@@6B@) referenced in function "private: virtual void __cdecl linkahead::info::test_info_create_info_from_proto_info_Test::TestBody(void)" (?TestBody@test_info_create_info_from_proto_info_Test@info@linkahead@@EEAAXXZ) [C:\Code\caosdb\src\caosdb-cpplib\test_package\build\msvc-194-x86_64-1
7-release\test_info.vcxproj]
C:\Code\caosdb\src\caosdb-cpplib\test_package\build\msvc-194-x86_64-17-release\Release\test_info.exe : fatal error LNK1120: 3 unresolved externals [C:\Code\caosdb\src\caosdb-cpplib\test_package\build\msvc-194-x86_64-17-release\test_info.vcxproj]
ERROR: linkahead/0.3.0-dev (test package): Error in build() method, line 30
cmake.build()
ConanException: Error 1 while executing
Expected Behavior
What did you expect how the software should behave?
Actual Behavior
What did the software actually do?
Steps to Reproduce the Problem
Please describe, step by step, how others can reproduce the problem. Please try these steps for yourself on a clean system.
conan create .
Specifications
- Version: 0.3-dev
- Platform: Windows 11
Possible fixes
- Adding
linkahead::caosdb_grpc
to CMakeLists.txt of test_package? Maybe we first have to export it as well
CMake Error at CMakeLists.txt:28 (target_link_libraries):
Target "test_info" links to:
linkahead::caosdb_grpc
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Maybe we have to declare components for linkahead::clinkahead
and linkahead::caosdb_grpc
, i.e.
...
self.cpp_info.libs = ["linkahead", "clinkahead", "caosdb_grpc" ]
self.cpp_info.requires = ["boost::headers", "grpc::grpc", "protobuf::protobuf"]
self.cpp_info.components["linkahead"].libs = ["linkahead"]
self.cpp_info.components["linkahead"].set_property("cmake_target_name", "linkahead")
self.cpp_info.components["clinkahead"].libs = ["clinkahead"]
self.cpp_info.components["clinkahead"].set_property("cmake_target_name", "clinkahead")
self.cpp_info.components["caosdb_grpc"].libs = ["caosdb_grpc"]
self.cpp_info.components["caosdb_grpc"].set_property("cmake_target_name", "caosdb_grpc")
Edited by Joscha Schmiedt