0

I managed to compile hunspell with Visual Studio and I'm having dificulties making it work. Here's what I have done:

Project Properties -> C/C++ -> General -> Additional Include Directories and added this line: C:\src\hunspell\src\hunspell

Project Properties -> Linker -> General -> Additional Library Directories and added this line: C:\src\hunspell\msvc\Debug_dll\libhunspell

I got this error when I try to run:

cMain.obj : error LNK2019: unresolved external symbol _Hunspell_create referenced in function "public: __thiscall cMain::cMain(class wxString const &,int,class wxPoint const &,class wxSize const &,long)" (??0cMain@@QAE@ABVwxString@@HABVwxPoint@@ABVwxSize@@J@Z)

I also copied the C:\src\hunspell\msvc\Debug_dll\libhunspell\libhunspell.dll to my \Debug folder.

Anyone can help? Thank you.

NeoFahrenheit
  • 347
  • 5
  • 16
  • `Additional Library Directories` usually this is not the correct thing to do. Normally you need to link to libraries in `Linker->Input->Additional Dependencies` – drescherjm Sep 01 '22 at 01:18
  • @drescherjm I added the C:\src\hunspell\msvc\Debug_dll\libhunspell to the Link->Input->Addittional Dependencies and got some new errors: "link.exe" exited with code 1104 ; cannot open file 'C:\src\hunspell\msvc\Debug\libhunspell.obj' – NeoFahrenheit Sep 01 '22 at 01:30
  • Don't you have a `.lib` file? Maybe your file explorer has "Hide extensions for known types" enabled and its confusing you. I recommend turning that off. – drescherjm Sep 01 '22 at 01:31
  • @drescherjm I was using the Debug_dll, but the VS was trying to acess a file in \Debug, but in \Debug there is 3 folders only: hunspell, libhunspell and testparser – NeoFahrenheit Sep 01 '22 at 01:38

1 Answers1

0

I solved the issue by adding the libhunspell.dll and libhunspell.lib to my Resource Files folder.

NeoFahrenheit
  • 347
  • 5
  • 16