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?
Here's how I resolved the issue. I did following to compile:
- Compiled using gcc under ubuntu
- Ran ldd on executable
- Copied all libraries that showed up as dependencies to subfolder ESXi-3.5-lib. In my case they were: - ld-linux.so.2 libc.so.6 libgcc_s.so.1 libm.so.6 libstdc++.so.5
- 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.so.6 ESXi-3.5-lib/libstdc++.so.5  \
    -nodefaultlibs -lc -m32 -fno-stack-protector
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论