wxDevcpp to CodeBlocks, String and char problems unicode Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
haroldjpa
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Oct 16, 2006 11:43 pm

wxDevcpp to CodeBlocks, String and char problems unicode

Post by haroldjpa » Tue Nov 26, 2013 4:13 pm

Hello folks

I did a program with wxDevcpp, I did its code, with a mix between wxwidgets and ANSI C a long time ago. So, wxDevcpp is deprecated, and i want to use codeblocks, I compiled wx libraries like this

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release

And when i'm trying to complile my code on codeblocks, appears many errors with string functions, and chinese simbols :S instead my messages .

I don't know how wxDevcpp libraries were compiled.

Anyone can me help?



:?

Code Sample
Most error are on lines like this

Code: Select all

wxString e,s,d;  
    e = wxNow();
    d.Printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>%s>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",e.c_str());

s.Printf("Serial {%s}",sModelSerial);
I think someting is wrong with wxString::Printf()
obj\Release\server.o:server.cpp:(.text+0x140): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x288): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x3d0): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x518): more undefined references to `_imp___ZN12wxStringBase8InitWithEPKcjj' follow
obj\Release\server.o:server.cpp:(.text+0xb93): undefined reference to `_imp___ZN8wxString6PrintfEPKcz'
obj\Release\server.o:server.cpp:(.text+0xe36): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x10ab): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x1309): undefined reference to `_imp___ZN8wxString6PrintfEPKcz'
obj\Release\server.o:server.cpp:(.text+0x141e): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x14c8): undefined reference to `_imp___ZN12wxStringBase10ConcatSelfEjPKcj'
obj\Release\server.o:server.cpp:(.text+0x1c15): undefined reference to `_imp___ZN8wxString6PrintfEPKcz'
obj\Release\server.o:server.cpp:(.text+0x1e88): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x2017): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
obj\Release\server.o:server.cpp:(.text+0x214a): undefined reference to `_imp___ZN8wxString6PrintfEPKcz'
Release param #define

__GNUWIN32__
__WXMSW__
WXUSINGDLL
__WIN32__


Linker libs
libwxmsw28u.a


kind regards
Last edited by haroldjpa on Tue Nov 26, 2013 9:09 pm, edited 6 times in total.
Si sabes espa

User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 430
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: wxDevcpp to CodeBlocks, String and char problems unicode

Post by xaviou » Tue Nov 26, 2013 4:48 pm

Hi.

Could you post an example of the code that causes problem at compil time, and also the related error message.

Regards
Xav'
My wxWidgets stuff web page : [email protected]'s wxStuff

haroldjpa
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Oct 16, 2006 11:43 pm

Re: wxDevcpp to CodeBlocks, String and char problems unicode

Post by haroldjpa » Wed Nov 27, 2013 8:55 pm

Hello everybody

I found solution by myself, :) , so, the problem was beacuse wxDevcpp libraries are compiled without unicode mode. So, my old code was made in this way non unicode mode.
then i just compiled wx libraries with option UNICODE=0

and progran runs Ok



Link with that error solution
http://forums.codeblocks.org/index.php? ... 830.0;wap2

Just have to put wxUNICODE in #define compiler options

best regards
Si sabes espa

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2293
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: wxDevcpp to CodeBlocks, String and char problems unicode

Post by evstevemd » Thu Nov 28, 2013 10:54 am

haroldjpa wrote:Hello everybody

I found solution by myself, :) , so, the problem was beacuse wxDevcpp libraries are compiled without unicode mode. So, my old code was made in this way non unicode mode.
then i just compiled wx libraries with option UNICODE=0

and progran runs Ok



Link with that error solution
http://forums.codeblocks.org/index.php? ... 830.0;wap2

Just have to put wxUNICODE in #define compiler options

best regards
wxWidgets are going to phase out ANSI.
BTW why do you need ANSI today?
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

Post Reply