The very first post in 2008 - “Open Cygwin (Bash) Shell Here”

July 9th, 2008

Googled and the result was beautiful. I use cygwin quite a lot and I thought there might be some ways to enable me to open a cygwin bash windows when exploring a directory.

Please see http://dam.mellis.org/2004/06/open_cygwin_bash_shell_here/. I excrept the regfile here:


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@=”Open Bash Shell Here”

[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@=”c:\\cygwin\\bin\\bash.exe –login -i -c ‘cd \”`cygpath \”$*\”`\”;bash’ bash %L”

[HKEY_CLASSES_ROOT\Drive\shell\bash]
@=”Open Bash Shell Here”

[HKEY_CLASSES_ROOT\Drive\shell\bash\command]
@=”c:\\cygwin\\bin\\bash.exe –login -i -c ‘cd \”`cygpath \”$*\”`\”;bash’ bash %L”

ps. the very first post in 2008

-clay

How to build log4cxx SVN trunk

December 13th, 2007

This is a very useful reference for building log4cxx SVN trunk.

-clay

(C++) Boost Compiling Problems - ulong_long_type undefined

December 11th, 2007

http://article.gmane.org/gmane.comp.lib.boost.user/16522/match=ulong%5flong%5ftype

namespace boost{

 typedef long long long_long_type;

 typedef unsigned long long ulong_long_type;

}

#include boost header

-clay

Static linking to Log4cxx

December 3rd, 2007

1. Define LOG4CXX_STATIS in VC++ Precompilation section before hand, or you will get plenty of “unresolved external symbol”error messages. See this.

2. ant -Dlib.type=static -Ddebug=true build

-clay

Why ++i instead of i++ in C++

November 9th, 2007

http://www.thescripts.com/forum/thread63485.html

I should have a copy of “Accelerated C++

Let’s have a good programming habit.

-clay

Thundering Herd problem

October 1st, 2007

I never know how to translate “Thundering Herd” into Chinese well, nor know it detailed definition in semantics. What I only know is the brief But here is the definition in English: http://en.wikipedia.org/wiki/Thundering_herd_problem

Linux Device Driver Kit by Greg KH

September 12th, 2007

Occasionally found the “Linux Device Driver Kit (Linux DDK)” made by Greg KH. Briefly looked at it and found it may be useful for Linux kernel/driver development.

Please see this and get it here.

It is a cd image that contains everything that a Linux device driver
author would need in order to create Linux drivers, including a full
copy of the O'Reilly book, "Linux Device Drivers, third edition" and
pre-built copies of all of the in-kernel docbook documentation for easy
browsing.  It even has a copy of the Linux source code that you can
directly build external kernel modules against.

-clay

RFC 3092 - Etymology of “Foo”

September 11th, 2007

There is a document in RFC explaining the etymology of “Foo” and “foobar”. Pretty interesting!

-clay

Eclipse ‘Source not found’ problem

July 9th, 2007

When debugging C++ application in Eclipse + CDT + Cygwin, you get “Source not found” error.

The reason for this error is that cygwin use Unix-style path name while Eclipse on Windows use DOS-style path name. e.g. /cygdrive/c vs C:\

To solve this, go to “Windows” -> “Preferences” -> “C/C++” -> “Debug” -> “Common Source Lookup”, add a “Path Mapping” and enter the following:

Compilation path:  \cygwin\c

Local file system path: C:\

Compilation path: \usr\lib\gcc\i686-pc-cygwin\3.4.4\include\c++

Local file system path: C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include\c++

-clay

Notes on Cygwin with Xerces-c and Boost

July 9th, 2007

To use xerces-c and boost library in Cygwin, just select them during the setup process. I am not going to talk about the details about the installation.

My C++ project was designed to run in multiple platform including Linux and Windows (via Cygwin), I want to make building project in eclipse on these two platform without changing any project settings.

However, in Cygwin, the linking library for xerces-c is quite old (2.5) and the name for the linking library is “libxerces-c25.dll.a“. This is a trouble for me because in Windows, I have the change linking library name in the project setting to xerces-c25, not the original xerces-c in Linux. So the workaround is:

ln -s /usr/lib/libxerces-c25.dll.a /usr/lib/libxerces-c.dll.a

For Boost, the header files was in default installed under /usr/include/boost-1_33_1/boost, again it is different than in Linux, which is /usr/include/boost. Workaround:

ln -s /usr/include/boost-1_33_1/boost /usr/include/boost

Now my project can be build on two platforms without changing anything.

-clay