News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codeblocks Error "Failed to convert file"

Started by tiwag, June 12, 2007, 01:00:51 PM

Previous topic - Next topic

tiwag


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

dje

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

tiwag

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:
QuoteIndex: 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]

dje

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.

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

tiwag

#4
@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]

dje

Quote from: dje on June 22, 2007, 03:43:13 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


dje

Quote from: dje on June 23, 2007, 11:37:41 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