voikko / corevoikko

Libvoikko and essential linguistic resources
Other
89 stars 25 forks source link

libvoikko does not compile on Windows 7 with Visual Studio Express 2012 #3

Closed jsalonen closed 11 years ago

jsalonen commented 11 years ago

I'm trying to compile libvoikko on Windows 7 with VS Express 2012 using the instructions given here:

https://github.com/voikko/corevoikko/wiki/build-windows

I can successfully use Python to generate data.hpp. Also I can successfully import libvoikko.vcproj, which is auto-converted into libvoikko.vcxproj

However when trying to build I get the following error:

Creating library Debug\libvoikko.lib and object Debug\libvoikko.exp
DictionaryLoader.obj : error LNK2019: unresolved external symbol "public:
static void __cdecl libvoikko::setup::V2DictionaryLoader::addVariantsFromPath
(....)
Debug\libvoikko-1.dll : fatal error LNK1120: 1 unresolved externals

Any ideas here? This kind of is a showstopper for using voikko.

hatapitk commented 11 years ago

This is because you are building from Git master branch and the referenced V2DictionaryLoader was just added to the source tree roughly 20 hours ago. The MSVC build system on the other hand has not been updated in a year. I updated the wiki page to mention that such problems can occur with MSVC.

The quickest fix would be to just search for the file that contains the missing symbol (V2DictionaryLoader.cpp), include it into the project and then try a rebuild. Repeat if new similar problems come up. I have not personally used Visual Studio 2012 but if you got that far I believe there is a good chance that no other problems will occur.

If you don't need the latest features then you could also use these pre-built binaries for Windows: http://www.puimula.org/htp/testing/voikko-sdk/win-crossbuild/ These have been tested in the real life and are known to work. We have good experiences from developers who have used these in .Net and Java applications. If you are developing in C++ or C, you also need the public headers. They are in the source package under src/: voikko.h, voikko_enums.h, voikko_defines.h, voikko_deprecated.h, voikko_structs.h.

jsalonen commented 11 years ago

Added V2DictionaryLoader as dependency helped me get into another problem with linker:

 "Error8 error LNK1104: cannot open file 'C:\libvoikko\msvc\Debug\libvoikko.lib'
 C:\libvoikko\msvc\LINK voikkospell).

Given the fact that I don't actually need the latest version, I'll give up here and fall back on using a prebuilt binary.

By the way: I didn't even know prebuilt binaries are available for Libvoikko! For what I'm doing right now, they are more than sufficient.

As a fix to this issue, would it be possible to add link to win-crossbuild folder to https://github.com/voikko/corevoikko/wiki/build-windows/?

What happens right now is that:

Suggestion:

Add a link to win-crossbuild URL at least to build-windows page.

Edit: I was proactive and did the edit myself. If you are unhappy about this, feel free to revert: https://github.com/voikko/corevoikko/wiki/build-windows

hatapitk commented 11 years ago

Thanks for adding the link, it is indeed useful to have it there. I added it also to http://voikko.puimula.org/ports.html as you suggested.