Ошибка линкера с использованием библиотеки MSBuild, VCPKG и PocoC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Ошибка линкера с использованием библиотеки MSBuild, VCPKG и Poco

Сообщение Anonymous »

Я пытался настроить VCPKG, чтобы предоставить мои библиотеки Poco в течение нескольких дней, и я в конце меня. Вот ошибка: < /p>
Build FAILED.

"C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj" (default target) (1) ->
(Link target) ->
LoggerSetup.obj : error LNK2001: unresolved external symbol "public: void __cdecl Poco::Logger::setChannel(class Poco::Channel *)" (?setChannel@Logger@Poco@@QEAAXPEAVChannel@2@@Z) [C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj]
LoggerSetup.obj : error LNK2001: unresolved external symbol "public: __cdecl Poco::FormattingChannel::FormattingChannel(class Poco::Formatter *,class Poco::Channel *)" (??0FormattingChannel@Poco@@QEAA@PEAVFormatter@1@PEAVChannel@1@@Z) [C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj]
NetworkStatus.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string const Poco::Net::HTTPMessage::HTTP_1_1" (?HTTP_1_1@HTTPMessage@Net@Poco@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)
[C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj]
NetworkStatus.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string const Poco::Net::HTTPRequest::HTTP_GET" (?HTTP_GET@HTTPRequest@Net@Poco@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)
[C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj]
C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.exe : fatal error LNK1120: 4 unresolved externals [C:\Users\lorne\Documents\source\darian\TcpRedirector.vcxproj]

0 Warning(s)
5 Error(s)

Time Elapsed 00:05:34.42
< /code>

Это в Windows < /li>
Я использую VCPKG в режиме манифеста, и я нацелен на последнюю сборку POCO 1.14.1#2 < /li>
Я пробовал более старые сборки Poco < /li>
I Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Im Us Msbuild. /> Я использую статическое связывание. (Думаю, это так, потому что он не поддерживает cmake) < /li>
Я отбил свою основную папку VCPKG, а также специфический проект, который слишком часто считает, и начал со свежего клона GIT, поскольку документы описывают < /li>
Я чистил свой годичный проект. %Localappdata %< /li>
У меня есть еще один тестовый проект Barebones только с библиотеками Poco, которые работают так, как это должно.PS C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-windows-static\lib> ls

Directory: C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-windows-static\lib

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/23/2025 4:23 PM pkgconfig
-a---- 5/16/2025 9:00 AM 187072 boost_atomic-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:59 AM 2606828 boost_chrono-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:59 AM 845616 boost_container-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:59 AM 202996 boost_context-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:59 AM 721702 boost_coroutine-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:59 AM 9126 boost_date_time-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:00 AM 5577758 boost_json-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:02 AM 858358 boost_random-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:01 AM 33337330 boost_serialization-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 8:57 AM 7078 boost_system-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:00 AM 3503296 boost_thread-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:01 AM 26560138 boost_wserialization-vc143-mt-x64-1_88.lib
-a---- 5/16/2025 9:07 AM 61312066 libcrypto.lib
-a---- 5/16/2025 9:09 AM 1040268 libexpatMT.lib
-a---- 5/16/2025 9:07 AM 13067030 libssl.lib
-a---- 5/16/2025 9:08 AM 2361430 pcre2-16.lib
-a---- 5/16/2025 9:09 AM 2316186 pcre2-32.lib
-a---- 5/16/2025 9:08 AM 2450152 pcre2-8.lib
-a---- 5/16/2025 9:08 AM 29238 pcre2-posix.lib
-a---- 5/22/2025 6:08 AM 15722092 PocoCryptomt.lib
-a---- 5/22/2025 6:06 AM 107059592 PocoFoundationmt.lib
-a---- 5/22/2025 6:07 AM 24460926 PocoJSONmt.lib
-a---- 5/22/2025 6:08 AM 81039660 PocoNetmt.lib
-a---- 5/22/2025 6:08 AM 31510816 PocoUtilmt.lib
-a---- 5/22/2025 6:07 AM 30072322 PocoXMLmt.lib
-a---- 5/16/2025 9:07 AM 409940 utf8proc_static.lib
-a---- 5/16/2025 9:07 AM 460160 zlib.lib
< /code>
Это мой vcpkg.json: < /p>
{
"dependencies": [
{
"name": "poco",
"features": [
"net",
"util",
"crypto"
]
},
"boost-asio",
"boost-json",
"boost-property-tree",
"boost-random",
"jwt-cpp",
"nlohmann-json",
"websocketpp"
],
"overrides": [
{
"name": "boost-asio",
"version": "1.78.0"
}
]
}
< /code>
Мне нужно использовать более старую версию Boost, чтобы избежать конфликтов с WebSocketpp. < /p>
Это мой vcpkg-configuration.json < /p>
{
"default-registry": {
"kind": "git",
"baseline": "d43918b9143e24ffb56917daacd9126ad03014d6",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-c ... s/main.zip",
"name": "microsoft"
}
],
"overlay-ports": [
"../vcpkg-overlay"
]
}

vcpkg install-triplet = x64-windows-static команда работает нормально. Вот часть вывода. < /P>
VcpkgInstallManifestDependencies:
Installing vcpkg dependencies to C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-windows-static\
"C:\Users\lorne\Documents\source\vcpkg\vcpkg.exe" install --x-wait-for-lock --triplet "x64-windows-static" --vcpkg-root "C:\Users\lorne\Documents\source\vcpkg\\" "--x-manifest-root=C:\Users\lorne\Documents\source\darian\\" "--x-install-root=C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-wind
ows-static\\"
"C:\Users\lorne\Documents\source\vcpkg\vcpkg.exe" install --x-wait-for-lock --triplet "x64-windows-static" --vcpkg-root "C:\Users\lorne\Documents\source\vcpkg\\" "--x-manifest-root=C:\Users\lorne\Documents\source\darian\\" "--x-install-root=C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-wind
ows-static\\"
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
Detecting compiler hash for triplet x64-windows-static...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
The following packages will be built and installed:
* boost-algorithm:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@ad43 ... 53cb2da963
* boost-align:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@4924 ... 9481695e2b
* boost-any:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@d58b ... 239656d4e4
* boost-array:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@ac9d ... 03cb133e6d
boost-asio:x64-windows-static@1.78.0 -- git+https://github.com/microsoft/vcpkg@2fcf ... fdf88672b6
* boost-assert:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@d6e2 ... 279a6059a3
* boost-atomic:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@9b2f ... bcd986208f
* boost-bind:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@a15c ... dc9d4c358d
* boost-chrono:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@bb43 ... 03a97c5233
* boost-cmake:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@1a36 ... a5181b37b1
* boost-concept-check:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@c0ca ... 793984c51f
* boost-config:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@0822 ... 45db90b6e0
* boost-container:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@718d ... 63f171c735
* boost-container-hash:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@ea17 ... 7501121b22
* boost-context:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@8d20 ... fec0c906d6
* boost-conversion:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@c426 ... faf1a7dedd
* boost-core:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@4c65 ... 493fbc3c17
* boost-coroutine:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@c842 ... 800e6f8b68
* boost-date-time:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@27fa ... 2e22204ce1
* boost-describe:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@c8f7 ... 10e46a62a2
* boost-detail:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@98a3 ... d6541a363a
* boost-dynamic-bitset:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@d4c9 ... 6426bcb44c
* boost-endian:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@8f0d ... 08fb5d2715
* boost-exception:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@a9ea ... 09772b8856
* boost-function:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@dd9a ... 83a5e7d3a6
* boost-function-types:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@8935 ... 9399beb1a4
* boost-functional:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@2ff2 ... be73db31d4
* boost-fusion:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@bd40 ... bdc2a9b6ab
* boost-headers:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@89fc ... 6c2db7b3e1
* boost-integer:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@74fc ... 6a75403e3d
* boost-intrusive:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@0e55 ... f4b15e9801
* boost-io:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@bf00 ... 4e69226ff4
* boost-iterator:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@8c9d ... 4a8a2f8f70
boost-json:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@7d2d ... 70bdb78182
* boost-lexical-cast:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@c363 ... ae14464f79
* boost-move:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@3664 ... ee41da8197
* boost-mp11:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@2f04 ... e09c5cab8c
* boost-mpl:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@6cdd ... ca24a99013
* boost-multi-index:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@5d8d ... 39e83b211f
* boost-numeric-conversion:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@79af ... c090450bae
* boost-optional:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@1c8c ... 91f415b489
* boost-phoenix:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@4fbe ... 5a603a86d4
* boost-pool:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@f608 ... d9d3c0bf1e
* boost-predef:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@9800 ... 36eb818c68
* boost-preprocessor:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@499a ... ed3972bf9d
boost-property-tree:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@d72f ... 3b0059f0ea
* boost-proto:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@347c ... ac86d1f10a
boost-random:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@b2aa ... 52d0f21600
* boost-range:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@81d6 ... ab7c0f5659
* boost-ratio:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@ad5b ... 297ab16aa8
* boost-regex:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@dd6a ... 1d813674ec
* boost-serialization:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@f36d ... 7a5ed58382
* boost-smart-ptr:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@e65d ... 0d65ae964e
* boost-spirit:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@67ea ... d0ab0a764a
* boost-static-assert:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@2cb9 ... ac1f4800b6
* boost-system:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@737c ... 503b4a0cce
* boost-thread:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@f83f ... 6788a3089b
* boost-throw-exception:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@cce0 ... 45720cf104
* boost-tokenizer:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@2212 ... e9b5140b33
* boost-tuple:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@55ab ... 93914bd691
* boost-type-index:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@1c20 ... f23ab62261
* boost-type-traits:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@5c25 ... b32fd020a6
* boost-typeof:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@75c8 ... d59081d026
* boost-uninstall:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@3b2f ... 8c25bcadcc
* boost-unordered:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@0c41 ... a4100fc0de
* boost-utility:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@9600 ... f4ee1d1be5
* boost-variant:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@ce04 ... 932ba6eb63
* boost-variant2:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@caf0 ... acaf0baac0
* boost-vcpkg-helpers:x64-windows-static@1.84.0 -- git+https://github.com/microsoft/vcpkg@5ec9 ... ad6cc9cc08
* boost-winapi:x64-windows-static@1.88.0 -- git+https://github.com/microsoft/vcpkg@8b3a ... 1c5b8a2e72
* expat:x64-windows-static@2.7.1 -- git+https://github.com/microsoft/vcpkg@3770 ... 811b7e1d7c
jwt-cpp:x64-windows-static@0.7.0#1 -- git+https://github.com/microsoft/vcpkg@b089 ... 2dd432a6d8
nlohmann-json:x64-windows-static@3.12.0 -- git+https://github.com/microsoft/vcpkg@060c ... 31c61e3b67
* openssl:x64-windows-static@3.5.0#1 -- git+https://github.com/microsoft/vcpkg@6819 ... e3fc271933
* pcre2[core,jit,platform-default-features]:x64-windows-static@10.45 -- git+https://github.com/microsoft/vcpkg@c3bb ... af65fc0bee
* picojson:x64-windows-static@1.3.0#3 -- git+https://github.com/microsoft/vcpkg@38eb ... 441bbc51e3
poco[core,crypto,json,net,util,xml]:x64-windows-static@1.14.1#2 -- git+https://github.com/microsoft/vcpkg@1b7c ... 3ac105801c
* utf8proc:x64-windows-static@2.10.0 -- git+https://github.com/microsoft/vcpkg@f905 ... 12fb7081de
* vcpkg-boost:x64-windows@2025-03-29 -- git+https://github.com/microsoft/vcpkg@858b ... 05542d7ceb
* vcpkg-cmake:x64-windows@2024-04-23 -- git+https://github.com/microsoft/vcpkg@e74a ... df420eb840
* vcpkg-cmake-config:x64-windows@2024-05-23 -- git+https://github.com/microsoft/vcpkg@97a6 ... 4b561a7841
* vcpkg-cmake-get-vars:x64-windows@2024-09-22 -- git+https://github.com/microsoft/vcpkg@f231 ... 31beb25acf
websocketpp:x64-windows-static@0.8.2 -- C:\Users\lorne\Documents\source\darian\../vcpkg-overlay\websocketpp
* zlib:x64-windows-static@1.3.1 -- git+https://github.com/microsoft/vcpkg@3f05 ... cdb711f0c9
Additional packages (*) will be modified to complete this operation.
< /code>
Вот командная строка Linker: < /p>
Link:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:lib\Release\x64 /LIBPATH:"C:\Users\lorne\Documents\source\darian\vcpkg_ins
talled\x64-windows-static\x64-windows-static\lib" /LIBPATH:"C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-windows-static\x64-windows-static\lib\manual-link" iphlpapi.lib nfapi.lib ws2_32.lib dnsparser.lib Version.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib sh
ell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "C:\Users\lorne\Documents\source\darian\vcpkg_installed\x64-windows-static\x64-windows-static\lib\*.lib" /DEBUG /PDB:"C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental
/LTCGOUT:"Core\bin\x64\Release\Core.iobj" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.lib" /MACHINE:X64 Core\bin\x64\Release\BackgroundService.obj
Core\bin\x64\Release\CentrifugoMessages.obj
Core\bin\x64\Release\Config.obj
Core\bin\x64\Release\LoggerSetup.obj
Core\bin\x64\Release\NetworkStatus.obj
Core\bin\x64\Release\PipeData.obj
Core\bin\x64\Release\PipeServer.obj
Core\bin\x64\Release\ProcessExceptionsManager.obj
Core\bin\x64\Release\ServiceManager.obj
Core\bin\x64\Release\ServiceProtector.obj
Core\bin\x64\Release\stdafx.obj
Core\bin\x64\Release\Main.obj
Core\bin\x64\Release\WebSocketClient.obj
Core\bin\x64\Release\WebSocketClientWrapper.obj
Creating library C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.lib and object C:\Users\lorne\Documents\source\darian\\bin\x64\Release\Core.exp


Подробнее здесь: https://stackoverflow.com/questions/796 ... -libraries
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»