We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug on Windows Server 2022 & visual studio 2022, apache httpd build breaks when referencing vcpkg installed apr-util.
Environment
To Reproduce Steps to reproduce the behavior:
./vcpkg install apr-util:x64-windows apr-util builds successfully as a dynamic library.
build apache httpd, referencing vcpkg installed lib. link fails due to apr-util related unresolved external symbols.
Expected behavior link succeeds.
Failure logs LINK: command "C:\PROGRA2\MICROS2\2022\BUILDT1\VC\Tools\MSVC\14321.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\libhttpd.dir\objects1.rsp /out:libhttpd.dll /implib:libhttpd.lib /pdb:C:\Users\integration\Sandbox\apache-httpd\build\httpd\libhttpd.pdb /dll /version:0.0 /base:@C:/Users/integration/Sandbox/apache-httpd/build/httpd/BaseAddr.ref,libhttpd.dll /machine:x64 /INCREMENTAL:NO C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\libapr-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\libaprutil-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\apr_ldap-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\pcre2-8.lib ws2_32.lib mswsock.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:libhttpd.dll.manifest" failed (exit code 1120) with the following output: Creating library libhttpd.lib and object libhttpd.exp util_xml.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos request.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos util.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos util_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos util_script.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos byterange_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos chunk_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos http_filters.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos protocol.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos chunk_filter.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_flush referenced in function ap_http_chunk_filter core_filters.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_flush protocol.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_flush ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool util_filter.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool log.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool request.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool config.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool connection.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool core.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled log.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled request.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled config.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled connection.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled core.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current log.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current request.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current config.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current connection.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current core.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_file referenced in function ap_core_output_filter core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_heap referenced in function is_in_memory_bucket core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_pool referenced in function is_in_memory_bucket core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_immortal referenced in function is_in_memory_bucket core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_transient referenced in function is_in_memory_bucket libhttpd.dll : fatal error LNK1120: 10 unresolved externals
Additional context The root cause is that the portfile.cmake file contains the following lines:
file(READ ${CURRENT_PACKAGES_DIR}/include/apu.h APU_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) string(REPLACE "defined(APU_DECLARE_EXPORT)" "1" APU_H "${APU_H}") else() string(REPLACE "defined(APU_DECLARE_STATIC)" "1" APU_H "${APU_H}") endif() file(WRITE ${CURRENT_PACKAGES_DIR}/include/apu.h "${APU_H}")
The above code results in the installed apu.h header containing the following logic :
#define APU_DECLARE_DATA #elif defined(APU_DECLARE_STATIC) #define APU_DECLARE(type) type __stdcall #define APU_DECLARE_NONSTD(type) type __cdecl #define APU_DECLARE_DATA #elif 1 #define APU_DECLARE(type) __declspec(dllexport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APU_DECLARE_DATA __declspec(dllexport) #else #define APU_DECLARE(type) __declspec(dllimport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APU_DECLARE_DATA __declspec(dllimport) #endif
which prevents the dllimport section (which is needed when referencing the dynamic library symbol from another build) from being reachable.
Removing the portfile.cmake questionable lines fixes the problem.
The text was updated successfully, but these errors were encountered:
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) string(REPLACE "defined(APU_DECLARE_EXPORT)" "1" APU_H "${APU_H}") else() string(REPLACE "defined(APU_DECLARE_STATIC)" "1" APU_H "${APU_H}") endif()
should be
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) string(REPLACE "defined(APU_DECLARE_STATIC)" "0" APU_H "${APU_H}") else() string(REPLACE "defined(APU_DECLARE_STATIC)" "1" APU_H "${APU_H}") endif()
Sorry, something went wrong.
@d6p Could you test the PR #27456 fix your issue? Thanks Neumann's help.
Just did that, httpd builds OK with it. Looks good to me, thanks !
LilyWangLL
Successfully merging a pull request may close this issue.
Describe the bug
on Windows Server 2022 & visual studio 2022, apache httpd build breaks when referencing vcpkg installed apr-util.
Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install apr-util:x64-windows
apr-util builds successfully as a dynamic library.
build apache httpd, referencing vcpkg installed lib.
link fails due to apr-util related unresolved external symbols.
Expected behavior
link succeeds.
Failure logs
LINK: command "C:\PROGRA
2\MICROS2\2022\BUILDT1\VC\Tools\MSVC\14321.313\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\libhttpd.dir\objects1.rsp /out:libhttpd.dll /implib:libhttpd.lib /pdb:C:\Users\integration\Sandbox\apache-httpd\build\httpd\libhttpd.pdb /dll /version:0.0 /base:@C:/Users/integration/Sandbox/apache-httpd/build/httpd/BaseAddr.ref,libhttpd.dll /machine:x64 /INCREMENTAL:NO C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\libapr-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\libaprutil-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\apr_ldap-1.lib C:\Users\integration\Sandbox\vcpkg\installed\x64-windows\lib\pcre2-8.lib ws2_32.lib mswsock.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:libhttpd.dll.manifest" failed (exit code 1120) with the following output:Creating library libhttpd.lib and object libhttpd.exp
util_xml.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
request.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
util.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
util_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
util_script.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
byterange_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
chunk_filter.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
http_filters.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
protocol.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_eos
chunk_filter.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_flush referenced in function ap_http_chunk_filter
core_filters.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_flush
protocol.c.obj : error LNK2001: unresolved external symbol apr_bucket_type_flush
ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
util_filter.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
log.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
request.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
config.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
connection.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
core.c.obj : error LNK2001: unresolved external symbol apr_hook_global_pool
ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
log.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
request.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
config.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
connection.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
core.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_enabled
ssl.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
scoreboard.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
util_expr_eval.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
log.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
mpm_common.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
request.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
http_protocol.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
config.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
connection.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
core.c.obj : error LNK2001: unresolved external symbol apr_hook_debug_current
core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_file referenced in function ap_core_output_filter
core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_heap referenced in function is_in_memory_bucket
core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_pool referenced in function is_in_memory_bucket
core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_immortal referenced in function is_in_memory_bucket
core_filters.c.obj : error LNK2019: unresolved external symbol apr_bucket_type_transient referenced in function is_in_memory_bucket
libhttpd.dll : fatal error LNK1120: 10 unresolved externals
Additional context
The root cause is that the portfile.cmake file contains the following lines:
The above code results in the installed apu.h header containing the following logic :
which prevents the dllimport section (which is needed when referencing the dynamic library symbol from another build) from being reachable.
Removing the portfile.cmake questionable lines fixes the problem.
The text was updated successfully, but these errors were encountered: