intel / intel/hyperscan

Build hscollider failed when using pcre

Open
#363 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.5k
Forks
816
Avg merge
4d 21h
Merged PRs (30d)
2

Description

Hi guys,

I'm trying to fix hyperscan's dependency pcre in vcpkg (https://github.com/microsoft/vcpkg/pull/26028) but got some link issues:
```
4>GroundTruth.obj : error LNK2019: unresolved external symbol __imp_pcre_compile2@@24 referenced in function "public: class std::unique_ptr > __thiscall GroundTruth::compile(unsigned int,bool)" (?compile@GroundTruth@@QAE?AV?$unique_ptr@VCompiledPcre@@U?$default_delete@VCompiledPcre@@@std@@@std@@I_N@Z)
4>GroundTruth.obj : error LNK2019: unresolved external symbol __imp_pcre_exec@@32 referenced in function __catch$?addCallout@@YQXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z$0
4>GroundTruth.obj : error LNK2019: unresolved external symbol __imp_pcre_fullinfo@@16 referenced in function "public: class std::unique_ptr > __thiscall GroundTruth::compile(unsigned int,bool)" (?compile@GroundTruth@@QAE?AV?$unique_ptr@VCompiledPcre@@U?$default_delete@VCompiledPcre@@@std@@@std@@I_N@Z)
4>GroundTruth.obj : error LNK2019: unresolved external symbol __imp_pcre_study@@12 referenced in function "public: class std::unique_ptr > __thiscall GroundTruth::compile(unsigned int,bool)" (?compile@GroundTruth@@QAE?AV?$unique_ptr@VCompiledPcre@@U?$default_delete@VCompiledPcre@@@std@@@std@@I_N@Z)
4>F:\vcpkg\buildtrees\hyperscan\x86-windows-dbg\bin\hscollider.exe : fatal error LNK1120: 4 unresolved externals
```
Then I checked the symbols in `pcred.lib`:
```
__imp__pcre_compile2
__imp__pcre_exec
__imp__pcre_fullinfo
__imp__pcre_study
```
And I checked the pcre build log, the fact is that pcred.lib was built as a **C** library, not a **CPP** library.
But in pcre public header, there is no `extern "C"` there.
And hscollider is built as a **CPP** library, which caused this issue.

I need to know that how to fix this issue?

Related info:
OS: Windows 10
Compiler: Visual Studio 2017
hyperscan version: 5.4.0
pcre version: 8.45

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.