Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2009, 08:40 AM   #1
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
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!
Attached Files
File Type: zip ydp2dict.zip (2.4 KB, 252 views)
owl123 is offline   Reply With Quote
Old 04-17-2009, 01:45 PM   #2
radius
Lector minore
radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.radius trips the light fantastic.
 
radius's Avatar
 
Posts: 357
Karma: 128734
Join Date: Jan 2008
Device: Sony PRS-T3, Amazon Kindle PaperWhite 2
Quote:
Originally Posted by owl123 View Post
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!
Are you sure this is meant to be compiled and run in Windows? It looks more like a Linux program to me... It can still be built for Windows, but it would take more work.
radius is offline   Reply With Quote
Old 04-17-2009, 01:52 PM   #3
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
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.
owl123 is offline   Reply With Quote
Old 04-17-2009, 09:20 PM   #4
cbell
Frenetic
cbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipsecbell can illuminate an eclipse
 
cbell's Avatar
 
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...
cbell is offline   Reply With Quote
Old 04-18-2009, 03:58 AM   #5
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
Unfortunately they aren't. These are commercial dictionaries.
owl123 is offline   Reply With Quote
Old 04-18-2009, 07:16 AM   #6
Dave_S
What Title ?
Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.
 
Posts: 1,325
Karma: 1856232
Join Date: Jan 2009
Location: Bavaria Germany
Device: HTC Sensation 4G (KK), Nexus 7b (KK)
Quote:
Originally Posted by owl123 View Post
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!
Have you tried the pre-compiled Windows binaries of StarDict at Sourceforge?
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?
Dave_S is offline   Reply With Quote
Old 04-18-2009, 07:24 AM   #7
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,059
Karma: 3993884
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by Dave_S View Post
Have you tried the pre-compiled Windows binaries of StarDict at Sourceforge?
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?
Why do ou think it is not ANSI C? It uses the glib library so you must install this (or convert all data types and other things so you do not use this library). But a fast look at the code indicated that it is ANSI C.
tompe is offline   Reply With Quote
Old 04-18-2009, 08:01 AM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,649
Karma: 41565251
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
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.
HarryT is online now   Reply With Quote
Old 04-18-2009, 08:04 AM   #9
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
Dave_S: There's no binary version of ydp2dict converter at Sourceforge (or anywhere else.)
owl123 is offline   Reply With Quote
Old 04-18-2009, 08:39 AM   #10
Dave_S
What Title ?
Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.Dave_S ought to be getting tired of karma fortunes by now.
 
Posts: 1,325
Karma: 1856232
Join Date: Jan 2009
Location: Bavaria Germany
Device: HTC Sensation 4G (KK), Nexus 7b (KK)
Quote:
Originally Posted by tompe View Post
Why do ou think it is not ANSI C? It uses the glib library so you must install this (or convert all data types and other things so you do not use this library). But a fast look at the code indicated that it is ANSI C.
OK, call it ANSI if you want, but it is certainly not portable. When I first glanced at the code, I thought it was pretty much ANSI C, and therefor easily recompiled for a Windows machine. However, the code relied too much on glib.h, which is not a standard C library, and made it simply too much effort to port, IMHO. A simple filter like that *could* have been written in portable ANSI C using standard C libraries, and then compiled and run anywhere.
http://en.wikipedia.org/wiki/C_standard_library
Dave_S is offline   Reply With Quote
Old 04-18-2009, 11:46 AM   #11
rhari79
Addict
rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.
 
rhari79's Avatar
 
Posts: 327
Karma: 56042
Join Date: Feb 2009
Location: Chennai
Device: want a 13.3 inch Tab/ebook reader
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, 232 views)
rhari79 is offline   Reply With Quote
Old 04-18-2009, 12:14 PM   #12
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
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
And the .stackdump content is:

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
When there are no .dat files the program returns no errors.

Thanks for your time, hari.
owl123 is offline   Reply With Quote
Old 04-18-2009, 07:59 PM   #13
rhari79
Addict
rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.
 
rhari79's Avatar
 
Posts: 327
Karma: 56042
Join Date: Feb 2009
Location: Chennai
Device: want a 13.3 inch Tab/ebook reader
Quote:
Originally Posted by owl123 View Post
Thanks, hari. Unfortunately I'm getting errors after starting the program:
The program seems to be very buggy. I tested this now with 2 empty dat files and got these errors.

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
rhari79 is offline   Reply With Quote
Old 04-18-2009, 08:44 PM   #14
rhari79
Addict
rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.rhari79 actually enjoys Vogon poetry.
 
rhari79's Avatar
 
Posts: 327
Karma: 56042
Join Date: Feb 2009
Location: Chennai
Device: want a 13.3 inch Tab/ebook reader
Quote:
Originally Posted by rhari79 View Post
The program seems to be very buggy.
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
rhari79 is offline   Reply With Quote
Old 04-19-2009, 04:26 AM   #15
owl123
Addict
owl123 doesn't litterowl123 doesn't litterowl123 doesn't litter
 
Posts: 233
Karma: 214
Join Date: Nov 2008
Device: iPad, Samsung Galaxy Note
Creating c:\usr\share\stardict\dic\ dir helped :-) It all works now. Thanks!
owl123 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 10:41 AM.


MobileRead.com is a privately owned, operated and funded community.