[libvoikko] VoikkoSpellService (MacOS X) fails to build on OS X 10.6

Sjur Moshagen sjurnm at mac.com
Wed Apr 28 14:24:09 EEST 2010


Den 28. apr. 2010 kl. 11.43 skrev Sjur Moshagen:

>>> ld: warning: in /usr/local/lib/libvoikko.1.dylib, file was built for
>>> unsupported file format which is not the architecture being linked (i386)
>>> Undefined symbols:
>>> "_voikko_next_token_cstr", referenced from:
>>>     -[VoikkoSpellService
>>> spellServer:findMisspelledWordInString:language:wordCount:countOnly:] in
>>> VoikkoSpellService.o "_voikko_suggest_cstr", referenced from:
>>>     -[VoikkoSpellService spellServer:suggestGuessesForWord:inLanguage:]
>>> in VoikkoSpellService.o "_voikko_spell_cstr", referenced from:
>>>     _voikkoCheckWord in VoikkoSpellService.o
>>> "_voikko_set_bool_option", referenced from:
>>>     _main in VoikkoSpellService.o
>>>     _main in VoikkoSpellService.o
>>> "_voikko_free_suggest_cstr", referenced from:
>>>     -[VoikkoSpellService spellServer:suggestGuessesForWord:inLanguage:]
>>> in VoikkoSpellService.o "_voikko_init_with_path", referenced from:
>>>     _main in VoikkoSpellService.o
>>> ld: symbol(s) not found
>>> collect2: ld returned 1 exit status
>> 
>> You should check if linker settings in the XCode project file 
>> (VoikkoSpellService.xcodeproj/project.pbxproj) match the name of the libvoikko 
>> library that gets built. Apparently the linker just can't find the library to 
>> link against. The project file contains at least one reference to 
>> libvoikko.1.7.0.dylib but current development version of libvoikko is already 
>> at version 1.11.0, maybe this is causing problems?
> 
> There are two problems here. The first is t that XCode can't find the file, but that is flagged by XCode as soon as one opens the project, and is easily corrected in the project settings. The compiled library is presently named just libvoikko.1.dylib (as opposed to libvoikko.1.7.0dylib or libvoikko.1.11.0dylib), with no further version info in the filename - I don't know whether that has any significanse. But based on the error message, I guess that the file is found, and that XCode tries to link against it. That leads us to the second problem.
> 
> The second problem is that it seems the library is compiled for the wrong architecture, and doesn't work with the settings used in the XCode project. This again leads to all the symbols not being found.

Explicitly setting the architecture to 64-bit Intel (x86_64) made it:) No warnings, no errors. Remains to be seen whether it works as it should. Both release and debug versions built fine.

The unfortunate thing is that I'm not able to build for other architectures, or older OS-es. We'll have to return to that later.

Now off to test it:)

Best,
Sjur




More information about the Libvoikko mailing list