Showing posts with label computer science. Show all posts
Showing posts with label computer science. Show all posts

Sunday, April 8, 2012

Installing and running xerces in c/c++

I am working on storing data in XML files.I faced a lot of problems while installing the xerces from its binary distribution.I hav'nt found any good tutorial on the internet for its installation and running.
Therefore  I am posting here steps that I followed in order to install /run it.

1.Download the binary distribution of xerces according to your system configuration from the
http://xerces.apache.org

if you are on 32 bit system you can download this.
http://apache.mirrors.redwire.net//xerces/c/3/binaries/xerces-c-3.1.1-x86-linux-gcc-3.4.tar.gz

2.Extract the .tar.gz
     -> using command line or you can directly open it with archive manager.
 extracting the file will create a sub-directory "xerces-c-3.1.1-x86-linux-gcc-3.4"

lets say i have extracted in my /home/aditya/tools/ directory.
so its full path will be
/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc

3.Now open your .bashrc file which is in your home directory i.e /home/aditya/.bashrc

add following line in it (modify your path according to the location of extracted files)


export PATH="$PATH:/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/bin"

export LD_LIBRARY_PATH=/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/lib:$LD_LIBRARY_PATH



export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/lib/pkgconfig

4.lets say my program name is xml.main.cpp
then run it with g++ like this

g++ -I/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/include/ -L /home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/lib/ -lxerces-c -g -Wall -pedantic  xml.main.cpp

5.Its tedious to write these things in each compilation.So you can add an alias in you .bashrc file

alias gxr="g++ -I/home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/include/ -L /home/aditya/tools/xerces-c-3.1.1-x86-linux-gcc-3.4/lib/ -lxerces-c -g -Wall -pedantic"

now you can compile like

gxr xml.main.cpp


If you found any problem in above steps..you can ask in comments.!!

Enjoy



Friday, June 18, 2010

Transferring unfinished IDM downloads to other computer

For windows XP
Go to Documents and Settings=>(Username)
then Type on the Address bar
like if your username is aditya
then
C:/Documents and Setting/aditya/ApplicationData

then Go to IDM->DwnlData
copy the unfinished file to your Pen Drive

For windows vistsa,7
Go to C:/Users/aditya
Type on Address bar like
C:/Users/aditya/AppData
then go to Roaming->IDM->DwnlData

copy the unfinished file to your Pen Drive

Now your files are copied...what next you have to do is
1.Open the IDM(Internet Download Manager).
2.Select the Unfinished file.
3.Go to Tasks->export->To IDM export File
4.Save it with any name in your Pen Drive.
5.Now on the other computer IDM. Go to Tasks->Import
6.Import the exported file.
7.Start downloading the imported file.
8.Pause downloading when it starts Receiving all the partitions.
9.Now copy and replace the content of respective Folder which IDM has made in DwnlData Folder with the Pen drive folders data,which you have copied from other computer DwnlData folder.

Now Resume the Downloading.....and it will work for sure