Author Topic: Trouble compiling sdk/filemanager.cpp with wxGTK on Linux (fixed?)  (Read 3106 times)

Offline ei-grad

  • Single posting newcomer
  • *
  • Posts: 3
Code
g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/usr/local/lib/wx/include/gtk2-ansi-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/include/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/wxFlatNotebook/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT filemanager.lo -MD -MP -MF .deps/filemanager.Tpo -c filemanager.cpp  -fPIC -DPIC -o .libs/filemanager.o
filemanager.cpp: In function 'bool WriteWxStringToFile(wxFile&, const wxString&, wxFontEncoding, bool)':
filemanager.cpp:207: error: no matching function for call to 'wxCSConv::cWC2MB(const wxChar*, size_t&, size_t*)'
/usr/local/include/wx-2.8/wx/strconv.h:89: note: candidates are: const wxCharBuffer wxMBConv::cWC2MB(const wchar_t*) const
/usr/local/include/wx-2.8/wx/strconv.h:106: note:                 const wxCharBuffer wxMBConv::cWC2MB(const wchar_t*, size_t, size_t*) const
make[3]: *** [filemanager.lo] Ошибка 1
make[3]: Leaving directory `/home/grad/codeblocks/trunk/src/sdk'
make[2]: *** [all-recursive] Ошибка 1
make[2]: Leaving directory `/home/grad/codeblocks/trunk/src/sdk'
make[1]: *** [all-recursive] Ошибка 1
make[1]: Leaving directory `/home/grad/codeblocks/trunk/src'
make: *** [all-recursive] Ошибка 1
# uname -a
Linux grad-laptop 2.6.22.9-laptop-1mdv #1 SMP Thu Sep 27 04:17:10 CEST 2007 i686 Intel(R) Celeron(R) M CPU        420  @ 1.60GHz GNU/Linux

# wx-config --version-full
2.8.6.0

# g++ --version
g++ (GCC) 4.2.2 20070909 (prerelease) (4.2.2-0.RC.1mdv2008.0)

# make --version
GNU Make 3.81

# cat revision.m4
m4_define([SVN_REV], 4650)
m4_define([SVN_REVISION], 1.0svn4650)
m4_define([SVN_DATE], 2007-11-20 22:46:13)
« Last Edit: November 21, 2007, 06:21:45 am by ei-grad »

Offline ei-grad

  • Single posting newcomer
  • *
  • Posts: 3
Re: Trouble compiling C::B with wxGTK on Linux
« Reply #1 on: November 21, 2007, 06:19:35 am »
I think is fixed by:
filemanager.cpp(207):
        wxCharBuffer mbBuff = conv.cWC2MB(data.c_str(), inlen, &outlen);
replace to
        wxCharBuffer mbBuff = conv.cWC2MB((wchar_t*)data.c_str(), inlen, &outlen);

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Trouble compiling C::B with wxGTK on Linux
« Reply #2 on: November 21, 2007, 06:36:48 am »
I think is fixed by:
filemanager.cpp(207):
        wxCharBuffer mbBuff = conv.cWC2MB(data.c_str(), inlen, &outlen);
replace to
        wxCharBuffer mbBuff = conv.cWC2MB((wchar_t*)data.c_str(), inlen, &outlen);

That is not the correct fix. If you cast a char* to a wchar_t* the result would not be same. Try to use Unicode build of wxGTK to compile C::B without any error.
Be a part of the solution, not a part of the problem.

Offline ei-grad

  • Single posting newcomer
  • *
  • Posts: 3
Re: Trouble compiling sdk/filemanager.cpp with wxGTK on Linux (fixed?)
« Reply #3 on: November 21, 2007, 06:54:25 am »
Thank)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Trouble compiling sdk/filemanager.cpp with wxGTK on Linux (fixed?)
« Reply #4 on: November 21, 2007, 07:00:58 am »
I've committed one fix so that it compiles with ANSI build of wxWidgets. Update your source to revision 4654. :)

But my suggestion would be to use Unicode build of wxWidgets.
« Last Edit: November 21, 2007, 07:02:48 am by Biplab »
Be a part of the solution, not a part of the problem.