gcc sysroot error loading shared libraries

I had an old Ubuntu 14.04 in wich I compiled my app. This was made with gcc-4.8.4 and glibc version 2.19.

Now I have upgrade my Ubuntu, but i want to maintain my compilation settings, but obviously, gcc and glibc has been updated.

I have created a very simple program to verify my glibc version.

#include <stdio.h>
#include <gnu/libc-version.h>
int main (void) { puts (gnu_get_libc_version ()); return 0; }

If I compile and execute this program in my new O.S I got an 2.17 instead of 2.19 that was my previous version.

In order to get the same toolchain I have created a debootstrap of Ubuntu 14 in my personal folder. If I set the chroot to this path and compile, 2.19 version is obtained and everything is well.

xabi@Xlinux:~$ sudo chroot ~/ubuntu14/
root@Xlinux:/# gcc main.c -o main   
root@Xlinux:/# ./main 
2.19

My problem now is how to compile this without changing the chroot of all my system? My IDE is installed in my new system for example.

I have tried to compile calling to the desired gcc:

~/ubuntu14/usr/bin/gcc main.c -o main

/home/xabi/ubuntu14/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/cc1: error while loading shared libraries: libcloog-isl.so.4: cannot open shared object file: No such file or directory

but I always obtain this error.