Skip to content

Instantly share code, notes, and snippets.

@gwang
Last active April 7, 2016 01:11
Show Gist options
  • Save gwang/46dac5f88aae4a0b9be0 to your computer and use it in GitHub Desktop.
Save gwang/46dac5f88aae4a0b9be0 to your computer and use it in GitHub Desktop.
Build CodeBlocks from Source on Ubuntu 15.10 x64
  1. When using Cygwin and Codeblocks, the gdb.exe complains that cannot open /cygdrive/c/.../yourfile.cpp. [Refer to this stackoverflow page] (http://stackoverflow.com/questions/18559506/codeblocks-gdb-cannot-open-file-error).
  2. You can fix this porblem by: Create a registry key path at HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\ using the New->Key. 3. The under HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 create a string value
  3. Name: cygdrive prefix
  4. Value: /cygdrive
290 mkdir devel
294 sudo apt-get install libgtk-x11-2.0
297 locate libgtk-x11
299 cd devel
300 pushd /usr/lib/
301 ls -l /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
302 sudo ln -s /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 .
303 sudo apt-get install libexgtk2.8-dev
304 sudo apt-get install libwxgtk2.8-dev
305 sudo apt-get install libwxgtk2.8-0
309 popd
311 tar xvfz ~/Downloads/codeblocks_13.12-1.tar.gz
313 cd codeblocks-13.12/
316 sudo apt-get install libtool
317 ./bootstrap
319 sudo apt-get install libgtk2.0-dev
320 ./configure
321 make
322 sudo make install
323 sudo vi /etc/ld.so.conf # add "/usr/local/lib" to the end of the file
324 sudo ldconfig
325 codeblocks& # installed in /usr/local/bin
  1. To make jenv work in Cygwin
  • Set the SHELLOPTS env variable in Windows:
    • >set SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:igncr:interactive-comments:monitor
    • The igncr option is critical because otherwise the jenv code fails run because dos style line endings;
    • Another way to fix the issue is to go to $HOME/.jenv/libexec and run dos2unix on every file.
  • Edit .bashrc to have the following lines at the end
export PATH="/home/gwang2/.jenv/bin:$PATH"
eval "$(jenv init -)"
  • Make sure the jenv command is pointed to a absolute path
    • cd cd ~/.jenv/bin
    • rm jenv
    • ln -s /home/gwang2/.jenv/libexec/jenv .
  • Now log out and log in bash
  • You should be able to run jenv add /cygdrive/c/dev/Tools/Java/jdk1.8.0_66/.
  1. Note: there is another jenv project, which is totally a different tool for the similar goal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment