Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on June 12, 2007, 01:00:51 pm

Title: Codeblocks Error "Failed to convert file"
Post by: tiwag on June 12, 2007, 01:00:51 pm

Hi guys !

since a long time i managed to recompile CB from SVN using the latest WX 2.8.4

but i get a lot of errors of the type

Codeblocks Error
Quote
Failed to convert file "x:\y\filename.cpp" to Unicode.

when using the Threadsearch plugin and the Codestatistics plugin
The error is showed for some files, but not for all.

where in the code is this error message emitted, i couldn't find it  :shock: anywhere
seems that i've too much distance to the CB sources  :(  atm

brgds, tiwag
Title: Re: Codeblocks Error "Failed to convert file"
Post by: dje on June 12, 2007, 02:10:41 pm
Hi !

I think this error comes from wxWidgets wxTextFile implementation but I didn't have time to check it.
wxTextFile is used both in Threadsearch and Codestatistics plugins.

Dje
Title: Re: Codeblocks Error "Failed to convert file"
Post by: tiwag on June 22, 2007, 03:31:31 pm
thanks for your tip with wxTextFile

i've found a workaround with which it runs fine on WinXP,
just changed wxTextFile::Open() call to use "wxConvFile" parameter.

here is the patch:
Quote
Index: contrib/codestat/codestatexec.cpp
===================================================================
--- contrib/codestat/codestatexec.cpp   (revision 4152)
+++ contrib/codestat/codestatexec.cpp   (working copy)
@@ -163,7 +163,7 @@
                                  long int &comment_lines, long int &empty_lines, long int &total_lines)
 {
    wxTextFile file;
-   if (file.Open(filename.GetFullPath()))
+   if (file.Open(filename.GetFullPath(),wxConvFile))
    {
       bool multi_line_comment = false;
       total_lines += file.GetLineCount();

could some Linux dev test this please if it works with Linux too ?
thanks.


attached is the patched ThreadSearch plugin (V0.61 with wxTextFile patch)


[attachment deleted by admin]
Title: Re: Codeblocks Error "Failed to convert file"
Post by: dje on June 22, 2007, 03:43:13 pm
Hi Tiwag !

Thanks for the patch !
I'll test it this WE.

I'm about to release ThreadSearch 0.7 plugin but I have link problems on ubuntu.
I updated my Ubuntu 6.10 environment to wxWidgets 2.8.4 following cstudent wiki page (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_nightly_build_on_Ubuntu).

My environment seems OK but I can't link codeblocks app because of undefined references (wxFont and others).
I have to fix that before testing on linux but I am a newbee on this OS.

Dje
Title: Re: Codeblocks Error "Failed to convert file"
Post by: tiwag on June 22, 2007, 03:54:58 pm
@Yiannis

maybe you want to have a look at some code, where wxTextFile::Open() is used in CB sdk too.

it could happen, that there are some silent wxTextFile::Open() failures too.




[attachment deleted by admin]
Title: Re: Codeblocks Error "Failed to convert file"
Post by: dje on June 23, 2007, 11:37:41 pm
Hi Tiwag !

Thanks for the patch !
I'll test it this WE.

It works on XP !
Thanks again, now I can use my plug in on C::B workspace without unicode translation errors pop-ups  :P

Still problems on linux builds.  :cry:

Dje

Title: Re: Codeblocks Error "Failed to convert file"
Post by: dje on June 24, 2007, 09:15:55 pm
I'm about to release ThreadSearch 0.7 plugin but I have link problems on ubuntu.
I updated my Ubuntu 6.10 environment to wxWidgets 2.8.4 following cstudent wiki page.

My environment seems OK but I can't link codeblocks app because of undefined references (wxFont and others).
I have to fix that before testing on linux but I am a newbee on this OS.

No more Linux build problems !
The patch works on Linux too.

Next ThreadSearch release this week  :D

Dje