Trying to compile vixDiskLibSample in VDDK 6.5 and getting errors.
I have not had this problem with other (previous) versions of VDDK (notably 5.5.4, 5.5.5, 6.0.0, 6.0.1 and 6.0.2).
Using Microsoft Visual Studio 2015.
Downloaded and extracted VMware-vix-disklib-6.5.0-4604867.x86_64.
Opened and upgraded ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\vixDiskLibSample.sln.
Opened Configuration Manager for VS project and set Platform to x64.
Downloaded and extracted boost_1_62_0.zip (source: http://www.boost.org/users/history/version_1_62_0.html) to ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\boost.
Set VS project to include ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\boost\*.*.
Getting the following errors on build:
Severity | Code | Description | Project | File | Line | Suppression State |
Error | C1083 | Cannot open include file: 'boost/fusion/support/config.hpp': No such file or directory | vixDiskLibSample | ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\boost\fusion\include\adapt_adt_named.cpp | 10 | |
Error | C1083 | Cannot open include file: 'boost/config/warning_disable.hpp': No such file or directory | vixDiskLibSample | ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\boost\spirit\home\support\char_encoding\unicode\create_tables.cpp | 7 | |
Error | C1083 | Cannot open include file: 'boost/asio/impl/src.hpp': No such file or directory | vixDiskLibSample | ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\boost\asio\impl\src.cpp | 25 | |
Error | C1083 | Cannot open include file: 'boost/asio.hpp': No such file or directory | vixDiskLibSample | ...\VMware-vix-disklib-6.5.0-4604867.x86_64\doc\sample\vixDiskLibSample.cpp | 34 |
Could this be because I am using the wrong version of Boost? Or, could the VMware developers who tested vixDiskLibSample in VDDK 6.5 have made custom edits to the Boost headers in their development environment?
Any help is much appreciated.
Note: VDDK 6.5 documentation does not say anything about Boost other than the following:
Open Source Components
VDDK contains the following open source components, with license types indicated:
- Boost (BSD style license)
My compilation error
[root@localhost diskLib]# make
g++ -o vix-disklib-sample -I../../../include -L../../../lib64 vixDiskLibSample.cpp -ldl -lvixDiskLib
/tmp/cccUSxaM.o: In function `__static_initialization_and_destruction_0(int, int)':
vixDiskLibSample.cpp:(.text+0x48df): undefined reference to `boost::system::generic_category()'
vixDiskLibSample.cpp:(.text+0x48eb): undefined reference to `boost::system::generic_category()'
vixDiskLibSample.cpp:(.text+0x48f7): undefined reference to `boost::system::system_category()'
/tmp/cccUSxaM.o: In function `boost::system::error_code::error_code()':
vixDiskLibSample.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
/tmp/cccUSxaM.o: In function `boost::asio::error::get_system_category()':
vixDiskLibSample.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5): undefined reference to `boost::system::system_category()'
/tmp/cccUSxaM.o: In function `boost::thread_exception::thread_exception(int, char const*)':
vixDiskLibSample.cpp:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x15): undefined reference to `boost::system::generic_category()'
/tmp/cccUSxaM.o: In function `boost::detail::thread_data_base::thread_data_base()':
vixDiskLibSample.cpp:(.text._ZN5boost6detail16thread_data_baseC2Ev[_ZN5boost6detail16thread_data_baseC5Ev]+0x26): undefined reference to `vtable for boost::detail::thread_data_base'
/tmp/cccUSxaM.o: In function `boost::thread::start_thread()':
vixDiskLibSample.cpp:(.text._ZN5boost6thread12start_threadEv[boost::thread::start_thread()]+0x17): undefined reference to `boost::thread::start_thread_noexcept()'
/tmp/cccUSxaM.o: In function `boost::thread::~thread()':
vixDiskLibSample.cpp:(.text._ZN5boost6threadD2Ev[_ZN5boost6threadD5Ev]+0x17): undefined reference to `boost::thread::detach()'
/tmp/cccUSxaM.o: In function `boost::thread::get_id() const':
vixDiskLibSample.cpp:(.text._ZNK5boost6thread6get_idEv[boost::thread::get_id() const]+0x1d): undefined reference to `boost::thread::native_handle()'
/tmp/cccUSxaM.o: In function `boost::thread::join()':
vixDiskLibSample.cpp:(.text._ZN5boost6thread4joinEv[boost::thread::join()]+0x8e): undefined reference to `boost::thread::join_noexcept()'
/tmp/cccUSxaM.o: In function `boost::detail::thread_data<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > > >::~thread_data()':
vixDiskLibSample.cpp:(.text._ZN5boost6detail11thread_dataINS_3_bi6bind_tImNS_4_mfi3mf0ImNS_4asio10io_serviceEEENS2_5list1INS2_5valueIPS7_EEEEEEED2Ev[_ZN5boost6detail11thread_dataINS_3_bi6bind_tImNS_4_mfi3mf0ImNS_4asio10io_serviceEEENS2_5list1INS2_5valueIPS7_EEEEEEED5Ev]+0x1f): undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
/tmp/cccUSxaM.o:(.rodata._ZTIN5boost6detail11thread_dataINS_3_bi6bind_tImNS_4_mfi3mf0ImNS_4asio10io_serviceEEENS2_5list1INS2_5valueIPS7_EEEEEEEE[typeinfo for boost::detail::thread_data<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > > >]+0x10): undefined reference to `typeinfo for boost::detail::thread_data_base'
collect2: ld returned 1 exit status
make: *** [vix-disklib-sample] Error 1
Better late than never
I ran into the same issue and discovered that you need to add an additional boost library to the Makefile: -lboost_thread
INCLUDEDIR=../../../include
LIBDIR=../../../lib64
ifdef VIX_AIO_BUFPOOL_SIZE
CXXFLAGS+= -DVIX_AIO_BUFPOOL_SIZE=$(VIX_AIO_BUFPOOL_SIZE)
endif
all: vix-disklib-sample vix-mntapi-sample
vix-disklib-sample: vixDiskLibSample.cpp
$(CXX) $(CXXFLAGS) -o $@ -I$(INCLUDEDIR) -L$(LIBDIR) $? -ldl -lvixDiskLib -lboost_thread
vix-mntapi-sample: vixDiskLibSample.cpp
$(CXX) $(CXXFLAGS) -o $@ -DFOR_MNTAPI -I$(INCLUDEDIR) -L$(LIBDIR) $? -ldl -lvixDiskLib -lvixMntapi -lboost_thread
clean:
$(RM) -f vix-disklib-sample vix-mntapi-sample
# make
g++ -o vix-disklib-sample -I../../../include -L../../../lib64 vixDiskLibSample.cpp -ldl -lvixDiskLib -lboost_thread
g++ -o vix-mntapi-sample -DFOR_MNTAPI -I../../../include -L../../../lib64 vixDiskLibSample.cpp -ldl -lvixDiskLib -lvixMntapi -lboost_thread
# ls -l
total 668
-r--r--r-- 1 cyc cyc 530 May 8 09:24 Makefile
-rwxrwxr-x 1 cyc cyc 274516 May 8 09:27 vix-disklib-sample
-r--r--r-- 1 cyc cyc 77777 Apr 19 22:00 vixDiskLibSample.cpp
-rwxrwxr-x 1 cyc cyc 322560 May 8 09:27 vix-mntapi-sample