Thursday, August 29, 2013

Solving C1083 error for Visual Studio 2012 Express with Windows Kit

To solve error c1083 cannot open include file 'windows.h' no such file or directory
===========================================================
(The following solution assume, you have installed Visual Studio 2012 Express / Windows Kit for x86 or x64 platforms)

  • Change the following properties (if you installed the SDK to a different location, replace the SDK path with your custom install location):

  • - In “Executable Directories” replace $(WindowsSdkDir)bin with $(ProgramFiles)\Windows Kits\8.0\bin\x86
    - In “Include Directories” add $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared at the beginning and remove $(WindowsSdkDir)include
    - In “Library Directories” replace $(WindowsSdkDir)lib with $(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x86
    - In “Exclude Directories” replace $(WindowsSdkDir)include with $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared
    - When targeting x64, replace x86 with x64

    That’s it – you should be ready to build and run!

    Ref : You can dynamically include path of Program Files folder using the following in Windows.
              On 64bit Windows, things are a little more complicated, as application can be installed both in
               %ProgramFiles% and %ProgramFiles(x86)%

     

    Thursday, March 14, 2013

    Touchpad turning off

    To turn off the laptop/notebook touchpad in ubuntu, type the following command in the terminal window

                 $synclient TouchpadOff=1

    to enable the touchpad again

                  $synclient TouchpadOff=0

    Synaptic Package Manager behind Proxy

    To configure the Synaptic Package manager behind the proxy, follow the below simple steps
    1. Open Synaptic Package manager, by searching it from Ubuntu dash or clicking open it from launcher panel.
    2. Click, Settings->Preferences menu.
    3. The below screen would appear.

    4. Select "Network tab".
    5. Select "Manual proxy configuration"
    5. Enter the "HTTP proxy:" ip address and "Port", and also "FTP proxy:" ip address and "Port".
    6. Enter "localhost" in the "No proxy for:" text box.
    7. Click on the "Authentication" button near HTTP proxy port spinner box.
    8. Enter your network "username" and "password" for proxy authentication.
    9. Thats all, you are through to download and install packages.

    Monday, October 29, 2012

    android - Unable to create a new project in Eclipse after update to SDK Rev. 20

    After updating the android SDK, if you are unable to create a "Android application project", or "New Android Activity", wherein everytime you try to create the following below popup comes in


    Solution:-
         Open the SDK manager, delete the Android support package. Choose the current project, try install from the above popup. This should work. It worked for me. You can find the same below as a issue in code.google.com
    http://code.google.com/p/android/issues/detail?id=33859

    Friday, October 26, 2012

    Android Support package not present in SDK Manager

    Android Support package not present in SDK Manager:-

    Solution:
    "For some weird reason android-sdk decided to install everything in /extras/compatibility instead of /extras/support which eclipse recognises, so I renamed /extras/compatibility to /extras/support and now everything works fine."

    Saturday, July 28, 2012

    VIM as IDE

    Install CTags for VIM
    -------------------------------------
         sudo apt-get install exuberant-ctags

    Install Cscope for VIM
    --------------------------------------
        sudo apt-get install cscope

    Install the following plugins for VIM
    ------------------------------------------------------------
    1. Automatic Display of Declarations in the Context Window on the bottom in the (G)VIM window using the script named 'Source Explorer(srcexpl.vim)' :
        http://www.vim.org/scripts/script.php?script_id=2179

    2. Symbol Windows For Each File on the left in the (G)VIM window (G)VIM using the script named 'taglist.vim':
        http://www.vim.org/scripts/script.php?script_id=273

    3. Quick Access to All Files on the right in the (G)VIM window using the script named 'The NERD tree(NERD_tree.vim)':
        http://www.vim.org/scripts/script.php?script_id=1658

    4. Cscope maps the keyboard shortcuts for various commands in cscope using the script named '(cscope_maps.vim)':
        http://cscope.sourceforge.net/cscope_maps.vim

    4. Trinity manages all the above plugins and fit them in VIM to get the feel of source insight IDE using the script named '(trinity.vim)':
        http://www.vim.org/scripts/script.php?script_id=2347

    4. You can change various options of each plugin in trinity.vim according to you request.


    Additonal Info:
    -------------------------
              After installing cscope its mandatory to build cscope DB for your project inorder to execute the commands inside VIM. If your project is c,cc,cpp project the following command will generate you a basic database. However you can tweak the same for your project requirements. Execute the following command at the top level project directory.

        find . -regex '.*\.\(c\|cpp\|h\)$' > cscope.files

        cscope -b

    the above commands should generate a cscope.out DB file in your current working directory. If successfull, open VIM and type the following command

        :cscope add /home/xyz/cscope.out

    some useful cscope commands:
    • Find this definition - :cs f g
    • Find functions called by this function - :cs f d
    • Find functions calling this function - :cs f c
    • Find this text string - :cs f t
    • Find this file - :cs f f
    • Find files #including this file - :cs f i
    • Find this C symbol - :cs f s
    • Find this egrep pattern - :cs f e

    - Done and now you are ready to go. Happy VIM'ing.

    Thursday, July 19, 2012

    Chromium depot_tools download


    During download of depot_tools of chromium browser using git in linux, we may get the following error

    -------------------------------------------------------------------------------------------------------------------------
    root@aphone-ubuntu:~/chromium_src# git clone https://git.chromium.org/chromium/tools/depot_tools.git
    Initialized empty Git repository in /root/Chromium_Src/depot_tools/.git/
    error: Couldn't resolve host 'git.chromium.org' while accessing https://git.chromium.org/chromium/tools/depot_tools.git/info/refs

    fatal: HTTP request failed

    --------------------------------------------------------------------------------------------------------------------------

    this error may occur due to http proxy or firewall behind which we are trying to use git. Try setting the global htty proxy config for git. It worked for me.

    git config --global http.proxy http://proxy:8080
    // To check the proxy settings
    git config --get http.proxy

    After setting the above try  #git clone "url" .