View Single Post
Old 04-18-2009, 11:46 AM   #11
rhari79
Addict
rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.rhari79 ought to be getting tired of karma fortunes by now.
 
rhari79's Avatar
 
Posts: 375
Karma: 2200000
Join Date: Feb 2009
Location: Chennai
Device: .*
Cygwin binaries

Hi,

Managed to get these compiled on cygwin:

These are the command lines i had to use(borrowed from stardict-tools and non-essential parts removed):

gcc -Wall -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include ydp2dict.c -lglib-2.0 -o ydp2dict_dyn

gcc -Wall -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include ydp2dict.c -o ydp2dict_st /usr/lib/libglib-2.0.a /usr/lib/libintl.a /usr/lib/libiconv.a

  • ydp2dict_dyn links dynamically. So requires all the additional libs like glibc, iconv, intl installed.
  • ydp2dict_st is linked statically. So you should be able to use it standalone.

If you dont have full cygwin installed, consider using ydp2dict_st.exe. You will still need a barebone cygwin (at least cygwin1.dll i think).

With the -Wall option, had to make this code change(however compiles well without the -Wall):

bash-3.2$ diff -w ydp2dict-old.c ydp2dict.c
104c104
< p=arr[n].words=malloc(100);
---
> p=arr[n].words=(char*)malloc(100);
178c178
< p=arr[n].trans=malloc(strlen(words)*2);
---
> p=arr[n].trans=(char*)malloc(strlen(words)*2);
bash-3.2$


Simply exec the binary asks for dict100.dat and dict101.dat.
Hope you find it useful.
I have attached the dyn and st cygwin binary exe files in the zip file. This is my first post with an attachment. Do let me know if this works ok.

Thanks
hari
Attached Files
File Type: zip ydp2dict_cyg_bin.zip (779.9 KB, 459 views)
rhari79 is offline   Reply With Quote