04-17-2009, 08:40 AM | #1 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Who can compile a .c program for me?
In the StarDict-tools package I found a converter that would enable me to have 2 of my dictionaries converted to StarDict (and then to Mobipocket.)
Thing is it's not compiled. It's a ydp2dict.c file. And I have no idea about compiling. Could someone be so kind and compile it to a Windows binary .exe for me? The file is in the attachment. Thanks! |
04-17-2009, 01:45 PM | #2 | |
Lector minore
Posts: 655
Karma: 1738720
Join Date: Jan 2008
Device: Aura One, Paperwhite Signature
|
Quote:
|
|
Advert | |
|
04-17-2009, 01:52 PM | #3 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Well, I just want to use it. If you can compile it so that it works with Cygwin with no hassles then I'm fine with it.
|
04-17-2009, 09:20 PM | #4 |
Frenetic
Posts: 590
Karma: 8181
Join Date: Apr 2008
Location: Australia
Device: iLiad V2
|
If your dict*.dat files are public domain, maybe you could upload them here and someone might run the conversion for you...
|
04-18-2009, 03:58 AM | #5 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Unfortunately they aren't. These are commercial dictionaries.
|
Advert | |
|
04-18-2009, 07:16 AM | #6 | |
What Title ?
Posts: 1,325
Karma: 1856232
Join Date: Jan 2009
Location: Bavaria Germany
Device: Sony Experia Z Ultra
|
Quote:
http://sourceforge.net/project/showf...ckage_id=82452 The C sourcecode that you attached looks like it needs to be compiled by GCC, since it definitely is not ANSI C. If it was ANSI C it could be compiled and used anywhere, but as "ydp2dict.c" is written it looks like it is meant to be used on Linux? |
|
04-18-2009, 07:24 AM | #7 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
|
|
04-18-2009, 08:01 AM | #8 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
A quick look also shows that it uses <lf> as a line separator, and is therefore almost certainly intended for use on a Unix system, rather than Windows.
|
04-18-2009, 08:04 AM | #9 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Dave_S: There's no binary version of ydp2dict converter at Sourceforge (or anywhere else.)
|
04-18-2009, 08:39 AM | #10 | |
What Title ?
Posts: 1,325
Karma: 1856232
Join Date: Jan 2009
Location: Bavaria Germany
Device: Sony Experia Z Ultra
|
Quote:
http://en.wikipedia.org/wiki/C_standard_library |
|
04-18-2009, 11:46 AM | #11 |
Addict
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
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 |
04-18-2009, 12:14 PM | #12 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Thanks, hari. Unfortunately I'm getting errors after starting the program:
Code:
4 [main] ydp2dict_st 3688 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 537 [main] ydp2dict_st 3688 open_stackdumpfile: Dumping stack trace to ydp2dict_st.exe.stackdump Code:
Exception: STATUS_ACCESS_VIOLATION at eip=610CC85A eax=00000001 ebx=0022F144 ecx=7C809EFA edx=00000000 esi=00000000 edi=610E21A0 ebp=0022EE78 esp=0022EDD0 program=D:\13123123123\ydp2dict_st.exe, pid 3060, thread main cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023 Stack trace: Frame Function Args 0022EE78 610CC85A (0022F144, 00000000, 00000010, 00000000) 0022EE98 610CCD48 (00000000, 00000010, 00000000, 004010E4) 0022EEF8 610844FF (00000001, 007D01A0, 007D0090, 6111E673) 0022EFD8 61004DD2 (0022EFF0, FFFFFFFF, 00342250, 0022F020) 0022FF88 6100594F (00000000, 00000000, 00000000, 00000000) End of stack trace Thanks for your time, hari. |
04-18-2009, 07:59 PM | #13 | |
Addict
Posts: 375
Karma: 2200000
Join Date: Feb 2009
Location: Chennai
Device: .*
|
Quote:
The app fseeks into both the dat files without checking file size and since the files are empty, cygwin goes bonkers at that time. I dont have the actual files setup. Could you do a full stardict setup and then try this? My attempts at compiling stardict-tools failed with some linker errors in gzread/libiconv_open. --hari |
|
04-18-2009, 08:44 PM | #14 |
Addict
Posts: 375
Karma: 2200000
Join Date: Feb 2009
Location: Chennai
Device: .*
|
ydp2dict is meant to work with some prerequisites.These are not well tested and hence the buggy nature.
I think this requires the Collin's english-polish, polish-english dictionary installed. This means the pair of files "dict100.dat, dict100.idx" and "dict101.dat, dict101.idx" must be present in your folder. These seem to be the english-polish and polish-english dicts resp. from the collins dict. After parsing these files the ydp2dict writes data into /usr/share/stardict/dic/ and creates the files ydp_English_Polish.idx and ydp_English_Polish.dict files. Since the collins dict is a commercial s/w i cant continue. In case you have this installed, run this program in the directory where the dict files are present. Also ensure that the dir /usr/share/stardict/dic/ exists. --hari |
04-19-2009, 04:26 AM | #15 |
Addict
Posts: 234
Karma: 214
Join Date: Nov 2008
Device: Galaxy Note 3, Galaxy NotePro 12.2, InkBook
|
Creating c:\usr\share\stardict\dic\ dir helped :-) It all works now. Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to compile for Kindle DX? | cdisou | Kindle Developer's Corner | 5 | 10-22-2011 07:30 AM |
Compile from Source | krischik | Calibre | 8 | 06-04-2010 08:17 AM |
iLiad Anyone able to compile liberregxml? | Adam B. | iRex Developer's Corner | 11 | 10-27-2008 07:08 PM |
Calibre compile error | JeffElkins | Calibre | 6 | 10-24-2008 06:59 PM |
iLiad How to compile new driver for Iliad | illiad_fan | iRex Developer's Corner | 2 | 08-17-2008 05:01 AM |