Monday, April 11, 2016

Cygwin linking library problem on windows systems

Have you ever faced problem in compiling the Cygwin on windows? have you ever faced problem in resolving error: ld returned 1 exit status? Then here is the solution.

Even i have faced this, i have googled a lot to solve this issue but i couldn't find solution from any site. With my previous debugging skills finally i am able to resolve this issue. So i thought it is worthwhile to share with others.

For example you want to include static libraries, files will be created either .a or .lib extension, created in windows directory c:\xxx\yyy\zzz\test.a (full path).

You might have tried below compiler configuration
Library Path (-L): c:\xxx\yyy\zzz
Libraries (-l): test.a

For this definitely you will get error: ld returned 1 exit status. Do you know why? compiler will be reading your configuration as c:\xxx\yyy\zzz\libtest.a.a. In reality this path and file doesn't exist.

Then how to set the path for external library include?
As i have seen, compiler always looks for lib directory in the library path for your file. So you can do it in two ways.

1. create lib folder to keep your test.a in c:\xxx\yyy\zzz directory (i.e c:\xxx\yyy\zzz\lib\test.a). Then use below configuration
Library Path (-L): c:\xxx\yyy\zzz
Libraries (-l): \test

So compiler will be resolved this as c:\xxx\yyy\zzz\lib\test.a. if the file doesn't exist then it will try to lookin c:\xxx\yyy\zzz\lib\test.lib file.

2. If you don't want create lib folder then give relative path to your library file. Use below configuration
Library Path (-L): c:\xxx\yyy\zzz
Libraries (-l): \..\test

So compiler will be resolved this as c:\xxx\yyy\zzz\lib\..\test.a which means c:\xxx\yyy\zzz\lib\test.a. if the file doesn't exist then it will try to lookin c:\xxx\yyy\zzz\lib\..\test.lib file.

Let me know your experience on this library include solution for cygwin on windows.

Sunday, February 28, 2016

JAVA JDK installation on UBUNTU OS on Beaglebone Black [BBB]

This time i have tried installing JAVA JDK on UBUNTU OS which is running on Beagle Bone Black [BBB]. Installation is pretty much simple but the right selection of JAVA JDK variant (architecture) is very much important. In this process, i have tried installing various version of JAVA JDKs but i have succeeded only in one variant of JDK. i.e. ejre-7u45-fcs-b15-linux-arm-vfp-hflt-server_headless-26_sep_2013.tar.gz Download and installation steps are provided below.


Go to Oracle website and download the variant ejre-7u45-fcs-b15-linux-arm-vfp-hflt-server_headless-26_sep_2013.tar.gz. Make sure that you are agreeing the oracle terms and condition to download the software.


Copy the files to the directory where you want to keep the java file. In my case i have copied the files into /opt/.

Some times installation requires root privileges, So login as root user otherwise use sudo before the each command execution.

Create directory as jdk in /opt/ directory

mkdir /opt/jdk

Extract the compressed file into the targeted directory

tar -zxvf ejre-7u45-fcs-b15-linux-arm-vfp-hflt-server_headless-26_sep_2013.tar.gz -C /opt/jdk

Verify the extract location

ls /opt/jdk

Environment Settings

This has to be done to tell the OS to point java execution to extracted directory.

Edit the file to add the java installation path (root privileges required).

nano /etc/profile

Add below lines of code into the file and save.

export JAVA_HOME=/opt/jdk/ejre1.7.0_45
export PATH=$PATH:/opt/jdk/ejre1.7.0_45/bin

Save it by pressing shortcut keys.



Execute this command in any terminal. it should returns the version of the java installed.

java -version

Output will be

java version "1.7.0_45"
Java(TM) SE Embedded Runtime Environment (build 1.7.0_45-b15, headless)
Java HotSpot(TM) Embedded Server VM (build 24.45-b08, mixed mode)


If you get the error as java command not found then the environment setting is not properly done.

If you get the error as no such file or directory then the selection of JAVA is not correct. Revisit the java variants supported for your OS and Hardware.

Tuesday, February 9, 2016

New journey in the world with IoT(Internet of Things)

The Internet of Things (IoT) is the network of physical objects—devices, vehicles, buildings and other items which are embedded with electronics, software, sensors, and network connectivity, which enables these objects to collect and exchange data (Ref. wiki).

In simple terms, small embedded controller(IoT) can be controlled or monitored over internet. For ex. you can log the your room temperature into the server and it can be view-able anywhere in the world. Similarly, you can turn on/off your room light from anywhere in the world with the help internet.

The whole world is already jumped into the concept of IoTs and giving lot of flexibility in developing programs to create solutions for world hunger problem. The big companies like google, matlab, cisco, microsoft, sap, GE and many other are provided platform already to build solutions.

As a curious embedded programmer i have started developing my first IoT device to monitor my room temperature over the internet. I have used below components/services for my application,
1) Arduino uno - Development kit
2) ESP8266 - Wifi module
3) - IoT server
4) B57703M0103G040 - NTC sensor
5) My mobile as wifi hotspot with my GPRS service
6) some resistors and connecting wire.

I will share my thoughts and experience in futures posts. Stay tuned for it.