The above issue was related to compiling the code with 32bit g++. When it calls 64bit DLLs causing the above error. After I changed the compiler to 64bit, this issue was disappeared, but I have a new issue:
[debug]Command-line: C:\cygwin64\bin\gdb.exe -nx -fullname -quiet -args C:/Users/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe
[debug]Working dir : C:\Users\layee\Documents\CodeBlocks\SGXData
Starting debugger: C:\cygwin64\bin\gdb.exe -nx -fullname -quiet -args C:/Users/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe
done
[debug]Reading symbols from C:/Users/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
[debug]> break "C:/Users/layee/Documents/CodeBlocks/SGXData/main.cpp:64"
[debug]Breakpoint 2 at 0x401b0b: file C:/Users/layee/Documents/CodeBlocks/SGXData/main.cpp, line 64.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe
[debug]During startup program exited with code 0xc000007b.
Child process PID: 13656
[debug][New Thread 13656.0x2a34]
[debug][New Thread 13656.0xbec]
[debug][New Thread 13656.0x3610]
[debug][New Thread 13656.0x28c4]
[debug][Thread 13656.0x28c4 exited with code 3221225595]
[debug][Thread 13656.0xbec exited with code 3221225595]
[debug]>>>>>>cb_gdb:
During startup program exited with code 0xc000007b.
[debug]> quit
Debugger finished with status 0
Command line debugging with gdb is fine.
C:\Users\layee>C:\cygwin64\bin\gdb.exe -nx -fullname -quiet -args C:/Users/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe
Reading symbols from C:/Users/layee/Documents/CodeBlocks/SGXData/bin/Debug/SGXData.exe...done.
(gdb) b main.cpp:64
Breakpoint 1 at 0x401b0b: file C:/Users/layee/Documents/CodeBlocks/SGXData/main.cpp, line 64.
(gdb) run
..........
Breakpoint 1, main () at C:/Users/layee/Documents/CodeBlocks/SGXData/main.cpp:64
/home/layee/Documents/CodeBlocks/SGXData/main.cpp:64:1959:beg:0x401b0b
(gdb)