Skip to content

[vcpkg baseline][hunspell] Fix usage when building static#19323

Merged
BillyONeal merged 4 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-baseline-20210803
Aug 5, 2021
Merged

[vcpkg baseline][hunspell] Fix usage when building static#19323
BillyONeal merged 4 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-baseline-20210803

Conversation

@JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Aug 3, 2021

In include/hunspell/hunvisapi.h:

#ifndef HUNSPELL_VISIBILITY_H_
#define HUNSPELL_VISIBILITY_H_

#if defined(HUNSPELL_STATIC)
#  define LIBHUNSPELL_DLL_EXPORTED
#elif defined(_WIN32)
#  if defined(BUILDING_LIBHUNSPELL)
#    define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport)
#  else
#    define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport)
#  endif
#elif defined(BUILDING_LIBHUNSPELL) && 1
#  define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default")))
#else
#  define LIBHUNSPELL_DLL_EXPORTED
#endif

#endif

That caused the usage error in baseline:

hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Hunspell::Hunspell(char const *,char const *,char const *)" (__imp_??0Hunspell@@QEAA@PEBD00@Z) referenced in function "public: __cdecl HunspellDict::HunspellDict(class QString const &,class QString)" (??0HunspellDict@@QEAA@AEBVQString@@V1@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Hunspell::~Hunspell(void)" (__imp_??1Hunspell@@QEAA@XZ) referenced in function "public: void * __cdecl Hunspell::`scalar deleting destructor'(unsigned int)" (??_GHunspell@@QEAAPEAXI@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Hunspell::spell(char const *,int *,char * *)" (__imp_?spell@Hunspell@@QEAAHPEBDPEAHPEAPEAD@Z) referenced in function "public: virtual bool __cdecl HunspellDict::isCorrect(class QString const &)const " (?isCorrect@HunspellDict@@UEBA_NAEBVQString@@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Hunspell::suggest(char * * *,char const *)" (__imp_?suggest@Hunspell@@QEAAHPEAPEAPEADPEBD@Z) referenced in function "public: virtual class QStringList __cdecl HunspellDict::suggest(class QString const &)const " (?suggest@HunspellDict@@UEBA?AVQStringList@@AEBVQString@@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Hunspell::free_list(char * * *,int)" (__imp_?free_list@Hunspell@@QEAAXPEAPEAPEADH@Z) referenced in function "public: virtual class QStringList __cdecl HunspellDict::suggest(class QString const &)const " (?suggest@HunspellDict@@UEBA?AVQStringList@@AEBVQString@@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char * __cdecl Hunspell::get_dic_encoding(void)" (__imp_?get_dic_encoding@Hunspell@@QEAAPEADXZ) referenced in function "public: __cdecl HunspellDict::HunspellDict(class QString const &,class QString)" (??0HunspellDict@@QEAA@AEBVQString@@V1@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Hunspell::add(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?add@Hunspell@@QEAAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __cdecl HunspellDict::HunspellDict(class QString const &,class QString)" (??0HunspellDict@@QEAA@AEBVQString@@V1@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Hunspell::add_with_affix(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?add_with_affix@Hunspell@@QEAAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) referenced in function "public: __cdecl HunspellDict::HunspellDict(class QString const &,class QString)" (??0HunspellDict@@QEAA@AEBVQString@@V1@@Z)
hunspelldict.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Hunspell::remove(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?remove@Hunspell@@QEAAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __cdecl HunspellDict::HunspellDict(class QString const &,class QString)" (??0HunspellDict@@QEAA@AEBVQString@@V1@@Z)
bin\sonnet_hunspell.dll : fatal error LNK1120: 9 unresolved externals

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support info:internal labels Aug 3, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout a863c84812089836a3c0f2f215ab3e2579fc8acf -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 23329bd..6084c96 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2546,7 +2546,7 @@
     },
     "hunspell": {
       "baseline": "1.7.0",
-      "port-version": 4
+      "port-version": 5
     },
     "hwloc": {
       "baseline": "2.2.0",
diff --git a/versions/h-/hunspell.json b/versions/h-/hunspell.json
index 0c6d4ad..6ce5577 100644
--- a/versions/h-/hunspell.json
+++ b/versions/h-/hunspell.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "2f2264528232cb7b66605e84634f86bbde7f2be7",
+      "version": "1.7.0",
+      "port-version": 5
+    },
     {
       "git-tree": "1441675cd83b048c9fe45d9230ab99c06421b121",
       "version": "1.7.0",

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout a863c84812089836a3c0f2f215ab3e2579fc8acf -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/h-/hunspell.json b/versions/h-/hunspell.json
index 6ce5577..af5756c 100644
--- a/versions/h-/hunspell.json
+++ b/versions/h-/hunspell.json
@@ -1,7 +1,7 @@
 {
   "versions": [
     {
-      "git-tree": "2f2264528232cb7b66605e84634f86bbde7f2be7",
+      "git-tree": "2a0514dd8b3893b6d3a502fbf55156e9e971d6f7",
       "version": "1.7.0",
       "port-version": 5
     },

@NancyLi1013
Copy link
Contributor

Ping @dan-shaw, please help merge this PR, thanks.

@NancyLi1013 NancyLi1013 added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Aug 4, 2021
@BillyONeal BillyONeal merged commit d2019e5 into microsoft:master Aug 5, 2021
@BillyONeal
Copy link
Member

Thanks for the fix!

@JackBoosY JackBoosY deleted the dev/jack/fix-baseline-20210803 branch August 5, 2021 03:05
vcpkg_copy_pdbs()

if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
if (VCPKG_TARGET_IS_WINDOWS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a AND NOT VCPKG_TARGET_IS_MINGW, to match the earlier choice of build system. I just verified that mingw installs to include/hunspell/hunvisapi.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants