Take the tour ×  I'm trying to compile a simple c++ program to
run inside ESXi 3.5 console window. It seems I'm linking with
wrong libraries... Is there a setup described somewhere - which
version of G++ and libraries do I have to be using in order to
do so?  share|improve this question add comment  1 Answer  up
vote 1 down vote accepted  Here's how I resolved the issue. I
did following to compile:    1. Compiled using gcc under ubuntu
2. Ran ldd on executable   3. Copied all libraries that showed
up as dependencies to subfolder ESXi-3.5-lib. In my case they
were:    4. Added following switches to gcc:      •
-nodefaultlibs (to not attempt to link with default libs)     •
-lc (prevented link error in some crt library)     • -fno-stack-
protector (prevented another error, some other function was
missing)  Following was my final build command:  g++ file1.cpp
file2.cpp file3.cpp -o output-biinary-file-name \
ESXi-3.5-lib/ld-linux.so.2 ESXi-3.5-lib/libc.so.6
ESXi-3.5-lib/libgcc_s.so.1\     ESXi-3.5-lib/libm.