If your code::block got some error like “ld.exe cannot find -lwxmsw28u”, you may find solution from the following article.


Usually, you may compile wxWidgets with below command:

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

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

According to the install.txt, the parameter description:

MONOLITHIC=1
Starting with version 2.5.1, wxWidgets has the ability to be built as
several smaller libraries instead of single big one as used to be the case
in 2.4 and older versions. This is called “multilib build” and is the
default behaviour of makefiles. You can still build single library
(“monolithic build”) by setting MONOLITHIC variable to 1.

SHARED=1

Build shared libraries (DLLs). By default, DLLs are not built

(SHARED=0).

UNICODE=1

To build Unicode versions of the libraries, add UNICODE=1 to make invocation

(default is UNICODE=0). If you want to be able to use Unicode version on

Windows9x, you will need to set MSLU=1 as well.

This option affect name of the library (‘u’ is appended) and the directory

where the library and setup.h are store (ditto).

Please keep the consistency between the wxWidgets installed library’s setting and code::bock option.

if SHARED=1, check out the “Use wxWidgets DLL”

if MONOLITHIC=1, check out the “wxWidgets is built as a monolithic libary”

if UNICODE=1, check out the “Enable unicode”

, , ,

Writing Regular Expressions of perl in easy way

Check It Out~

http://www.weitz.de/regex-coach/

some reference for regular expressions:

http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlre.html

, , , ,

Perl regular expression problem – not expect result

Code:
#!/usr/bin/perl
@line=(’56’, ‘1234’, ’24’);
foreach(@line)
{
$_=~/.*(3).*/;
print “##$1\n”;
}
Not expected result:
##
##3
##3
Code:

#!/usr/bin/perl

@line=(’56’, ‘1234’, ’24’);

foreach(@line)

{

print “##”.check($_).”\n”;

}

sub check

{

$_[0]=~/.*(3).*/;

return $1;

}

Expected result:
##
##3
##
, , ,
  • add “CURL_STATICLIB” at Project->Build options->#define
  • add “libcurl.a”, “libcurldll.a” and “libwlap32.a” at Project->Build options->Linker settings
, , , ,

if there is “#pragma comment(lib, “ws2_32.lib”)” included or you see some errors like:

[Linker error] undefined reference to `WSAStartup@8′

[Linker error] undefined reference to `socket@12′

[Linker error] undefined reference to `WSACleanup@0′

[Linker error] undefined reference to `htons@4′

[Linker error] undefined reference to `bind@12′

[Linker error] undefined reference to `listen@8′

[Linker error] undefined reference to `WSAAsyncSelect@16′

ld returned 1 exit status

Please add “-lwsock32.dll” at Project>Linker settings>Other linker optios.

, , ,

Dependency on mingwm10.dll using Code::Blocks

eliminate the mingwm10.dll dependencies of  GUI
application to be able to ship a single executable file.

remove “-mthreads” at “other linker options”.

, ,

orginal:

form->{var} = undef;
my $var;
if($form->{var}){
$var = $form->{var};
}else{
$var = 1;
}

example:

my $var = $form->{var} ? $form->{var} : 1;

$var = $form->{var} || 1;

, , , , ,