Monday, May 12, 2014

QT Creator 5 and Boost Framework on Windows

C++ is a language which brings you benefit from cross-platform and better performance. When we need compile C++ on different plat-form, usually we have to choose different IDE for windows and Linux. However, since QT has support the tool chain from Microsoft Visual C++ (msvc) we found QT might be the neat solution when we need an IDE that support our project on different platform.
For windows, we use boost as the framework for our C++ development (msvc 11 has support the implementation for C++ 11 statndard which is quiet handy that we don't have to build gcc 4.8 on MinGW platform. But for the developer already has code ran on MinGW framework, I believe it is the same handy when you integrated QT with MinGW Tool Chain.) So first thing is down load the boost_1_55_0 into C:\.
It is really easy to get boost installed. Go to C:\boost_1_55_0 and run bootstrap.bat batch file you will get a b2.exe file as your build tool. Then run the b2.exe (you can use b2 --help to find the command arguments for you to specify the customized installation config) The latest built dll would be under "C:\boost_1_55_0\stage\lib" and the header file is under C:\boost_1_55_0\boost. The whole build process should under the windows shell of visual studio 2012 or the compiler which supports C++ 11 standard. You could get the windows shell by using "VS2012 x64 Native Tools Command Prompt".
Hence, please add the follow instruction in your QT .pro file for the project you would like to include boost:
 
INCLUDEPATH+=C:\boost_1_55_0
LIBS+=-LC:\boost_1_55_0\stage\lib\

Then you could use #include<boost\asio.hpp> to see if the compiler work.
This is for framework include. If you want to include the external library such as logger or database, you could right click the Project Icon on left Tree View and add an external library (require a specified dll)



For the debugger on QT, you have to install the cdb.exe from WDK:
http://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx

If you use the tool chain of visual studio 2012, you should install WDK 8.0.

Monday, May 5, 2014

mRemoteNG with External Tool Set up

Many IT department only support the maintenance for Windows Workstation. So, if your work is mainly on Linux system, here is a great free multi-shell client tool on windows called "mRemoteNG". Although it support plenty of client shell with tabs, we still need the scp tool to upload file from windows workstation to Linux server. "mRemoteNG" provide you a way to invoke the other tools like a plug-in which is a really neat idea. First, you can put your winscp under the root folder of "mRemoteNG".
At the External Tool Properties you can specify the SCP tool's location and the argument you wan to pass into external tools from mRemoteNG like below:

scp://%Username%:%Password%@%Hostname%/


You can use the same method to integrate mRemoteNG and FileZilla.

The Folder Convention for CentOS

Each Linux distribution has their own system folder convention which will let user to figure out the purpose and program deployment layout quick. For example, MySQL's database file would be deployed to "/var/mysql" after you execute mysql_install_db command without specified the instance customized storage path but use default.
Speaking of CentOS, since it is derivative from RedHat distribution, I think it is quiet easy to grab its folder convention from application server development view. In daily operation, the "/var" folder would be the most important place for data storage. "/var" folder contains all the data file or "variable data of system persistent layer" and I believe this convention should be kept from server to server.
The second folder is "/opt" this folder is containing all the application server which is like a small OS inside Linux. I found some server package would assign /opt as their parent of server root folder and the script tool of application server would consider "/opt" is the shell path for scripting included. However, "/opt"s' purpose has most discrepancy from distribution to distribution. But I prefer use "/opt" as a small set of system package. Under "/opt" folder, each server package has its own "/usr", "/bin" and even "/sbin". It likes once you get into "/opt/server", you will get your own world with a dialect to communicate with another system. But sometimes it is pretty hard to configure the program under "/opt" for well function because there might be plenty binary dependency between "/opt" package and "/usr".
If you have built up a server with some auto run daemon or program, the "/etc" folder might be your most accessed folder per day. Surprisingly, "/etc" not only contains important configuration file from OS to Server Container (such as "/my.cnf"). "/etd/init.d" also has a lot of script for daemon and server start up. So you can tread "/etc" like a launch center to configure and regular the behavior of your whole application server from OS to user application at every beginning.
"/usr" is most crucial for all developer. The "/usr" folder would show the character of each Linux Dist. Even for the same distribution, the "/usr" folder might be much different from server edition to desktop edition. All the important compiler, productivity tool and open source software are scattered in the sub-folders of "/usr". If "/bin" and "sbin" are the shell that communicate to your machine, the "/usr" would give you the ability to enhance all your work to the machine. Most open source software are targeted to be deployed into "/usr" and scattered into "/usr/local", "/usr/bin", "/usr/include", "/usr/lib" and "/usr/etc". The famous Linux Package Manager and Deployment software are managing the "/usr" folder with their deliberated protocol and mechanism. And those deployment tools are really helpful for environment set up such as Java or X windows. However, some fresh new package might require you twist the file under "/usr" folder. That means the new package has not been adopted by those deployment tools and you have to dig into "/usr" folder's set up for running the new program normally. Neither, there is no easy way to unplug all those manually installed software from "/usr" with fresh clean up.