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

Sjur Moshagen sjurnm at mac.com
Wed Apr 28 11:43:19 EEST 2010


Den 27. apr. 2010 kl. 19.40 skrev Harri Pitkänen:

> On Tuesday 27 April 2010, Sjur Moshagen wrote:
>> Now I'm at the following errors:
>> 
>> 
>> /Users/sjur/voikko/osxspell/VoikkoSpellService.m: In function 'main':
>> /Users/sjur/voikko/osxspell/VoikkoSpellService.m:111: warning: class
>> 'VoikkoSpellService' does not implement the 'NSSpellServerDelegate'
>> protocol
> 
> This looks like OS X 10.6 may have broken source compatibility with something. 
> Or maybe this is just a harmless warning.

Hopefully so. We won't know until the build succeeds:)

>> ld: warning: directory '/Users/sjur/voikko/inst/lib' following -L not found

This I solved by setting --prefix=voikko/inst so that all builds go to inst/ within the project root dir.

>> 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.

Ideally, I would like libvoikko (and the other required libraries) to be compiled as fat binaries, with support for all of PPC, i386, and 86_64, but I don't know how to do that. My own computer is a 64 bit portable, so I guess XCode defaults to 86_64.

Today I made use of the shell script availabe as part of the precompiled voikko for mac distro available at http://www.nbl.fi/~nbl3392/voikko/mac/VoikkoSpellService_2009.dmg (that version is a bit outdated). In that shell script, ./configure is run with the following option:

CFLAGS="-I$PREFIX/include -L$PREFIX/lib -framework Carbon" LFLAGS="-framework Carbon" ./configure --enable-static --disable-shared --disable-dependency-tracking --prefix=$PREFIX $2

and make is run with the following flags:

make install \
	LINK="gcc -framework CoreFoundation -framework Carbon -framework Cocoa" \
	LDFLAGS="-framework CoreFoundation -framework Carbon -framework Cocoa" 

But that didn't help either (hm, Carbon is not available on 86_64, perhaps reming that would help?). I have tried to search a bit on the net, but not found anything so far.

Any help from the list members would be greatly appreciated.

Best,
Sjur




More information about the Libvoikko mailing list