Menu

#28 call of overloaded 'wxString(char [1024])' is ambiguous

open
nobody
None
5
2006-07-31
2006-07-31
Anonymous
No

bash$ $ uname -a
Darwin isupaplex.daxal.com 8.7.0 Darwin Kernel Version
8.7.0: Fri May 26 15:20:53 PDT 2006;
root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc

bash$ cc -v
Reading specs from
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with:
/private/var/tmp/gcc/gcc-4061.obj~8/src/configure
--disable-checking --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/gcc/darwin/4.0/c++
--build=powerpc-apple-darwin8
--host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build
4061)

bash$ g++ -v
Reading specs from
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with:
/private/var/tmp/gcc/gcc-4061.obj~8/src/configure
--disable-checking --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/gcc/darwin/4.0/c++
--build=powerpc-apple-darwin8
--host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build
4061)

PS, consider this option for MAC OS X:
bash$ make CC=/usr/bin/cc CXX=/usr/bin/g++
...
rm -f libiaxclient.a
ar cru libiaxclient.a portaudio/pa_common/pa_lib.o
portaudio/pablio/pablio.o portaudio/pablio/ringbuffer.o
spandsp/plc.o audio_encode.o audio_portaudio.o
audio_file.o codec_gsm.o codec_ulaw.o codec_alaw.o
codec_speex.o jitterbuf.o iaxclient_lib.o
gsm/src/add.o gsm/src/code.o gsm/src/debug.o
gsm/src/decode.o gsm/src/gsm_create.o
gsm/src/gsm_decode.o gsm/src/gsm_destroy.o
gsm/src/gsm_encode.o gsm/src/gsm_explode.o
gsm/src/gsm_implode.o gsm/src/gsm_option.o
gsm/src/gsm_print.o gsm/src/long_term.o gsm/src/lpc.o
gsm/src/preprocess.o gsm/src/rpe.o gsm/src/short_term.o
gsm/src/table.o libspeex/nb_celp.o libspeex/sb_celp.o
libspeex/lpc.o libspeex/ltp.o libspeex/lsp.o
libspeex/quant_lsp.o libspeex/lsp_tables_nb.o
libspeex/gain_table.o libspeex/gain_table_lbr.o
libspeex/cb_search.o libspeex/filters.o libspeex/bits.o
libspeex/modes.o libspeex/speex.o libspeex/vq.o
libspeex/high_lsp_tables.o libspeex/vbr.o
libspeex/hexc_table.o libspeex/exc_5_256_table.o
libspeex/exc_5_64_table.o libspeex/exc_8_128_table.o
libspeex/exc_10_32_table.o libspeex/exc_10_16_table.o
libspeex/exc_20_32_table.o libspeex/hexc_10_32_table.o
libspeex/misc.o libspeex/speex_header.o
libspeex/speex_callbacks.o libspeex/math_approx.o
libspeex/stereo.o libspeex/preprocess.o
libspeex/smallft.o libspeex/lbr_48k_tables.o
libspeex/jitter.o libspeex/mdf.o unixfuncs.o
portmixer/px_mac_core/px_mac_core.o
portaudio/pa_common/pa_convert.o
portaudio/pa_mac_core/pa_mac_core.o libiax2/src/md5.o
libiax2/src/iax.o libiax2/src/iax2-parser.o
ranlib libiaxclient.a
/usr/bin/g++ -I../../lib -g -Wall
-DVERSION='"1.1.0final"' `wx-config --cflags` -c -o
main.o main.cc
main.cc: In member function `void
theApp::RegisterByName(wxString)':
main.cc:258: error: cannot convert 'const wxChar*' to
'const char*' for argument '2' to 'char* strncpy(char*,
const char*, size_t)'
main.cc:259: error: cannot convert 'const wxChar*' to
'const char*' for argument '2' to 'char* strncpy(char*,
const char*, size_t)'
main.cc:260: error: cannot convert 'const wxChar*' to
'const char*' for argument '2' to 'char* strncpy(char*,
const char*, size_t)'
main.cc:276: error: cannot convert 'char*' to
'wchar_t*' for argument '1' to 'wchar_t*
wcscpy(wchar_t*, const wchar_t*)'
main.cc:277: error: cannot convert 'char*' to
'wchar_t*' for argument '1' to 'wchar_t*
wcscpy(wchar_t*, const wchar_t*)'
main.cc:278: error: cannot convert 'char*' to
'wchar_t*' for argument '1' to 'wchar_t*
wcscpy(wchar_t*, const wchar_t*)'
main.cc: In member function `void
theApp::load_xrc_resource(const wxString&)':
main.cc:311: error: call of overloaded 'wxString(char
[1024])' is ambiguous
/usr/include/wx-2.5/wx/string.h:676: note: candidates
are: wxString::wxString(const wxWCharBuffer&) <near match>
/usr/include/wx-2.5/wx/string.h:659: note:
wxString::wxString(wxChar, size_t) <near match>
/usr/include/wx-2.5/wx/string.h:657: note:
wxString::wxString(const wxString&) <near match>
/usr/include/wx-2.5/wx/string.h:649: note:
wxString::wxString(int) <near match>
make: *** [main.o] Error 1

Thanks,

Scott Edwards
-- Daxal Communications - http://www.surfthe.us

Discussion


Log in to post a comment.

MongoDB Logo MongoDB