Category: C

C/C++ : Get Current Time

Using Matlab, we can get the current date and time using “now” command.¬† Example, using Matlab¬† we can use below command : >> datestr(now,'dd-mm-yyyy HH:MM:SS.FFF') ans = 21-10-2014 13:41:58.666 How if we want to get current time using C/C++ with the result like Matlab ? We can use “localtime” to get date and time in

C/C++ : Adding Searching Include Directory

I have compiled a source code (Opendtect) using CMake. When I compile this program, the required include directory is not exist in the C/C++ searching path. Modified the Makefile is very hard, because this is the other people code. We can copy all the include library to default C/C++ include directory (/usr/include). But, I dont

C How to check if a file exists

When create a program related with IO, we want to check if a file exists or not. C/C++ have a function needed to check if a file exists or not. We can use some of function in stat.h to check if a file exists. This is a simple C How to check if a file

configure: error: cannot find install-sh, install.sh

configure: error: cannot find install-sh, install.sh When try to configure an open source code, I get error like this : configure: error: cannot find install-sh, install.sh, or shtool in “.” “./..” “./../..” Add command : autoreconf -f -i -Wall,no-obsolete before you call configure command to remove configure: error: cannot find install-sh, install.sh, or shtool in