compile vmci program - linux

I'm trying to compile the vmware vmci example program. The program is divided into two parts
a) kernel module
b) example datagram program
When i compiled that datagram program i get these errors :
gcc -I headers_path datagramApp.c
/tmp/cc6KkQ4a.o: In function `main':
datagramApp.c:(.text+0x16c): undefined reference to `VMCI_InitApp'
datagramApp.c:(.text+0x1be): undefined reference to `VMCI_CleanupApp'
/tmp/cc6KkQ4a.o: In function `DoDatagramServer':
datagramApp.c:(.text+0x1e6): undefined reference to `VMCIDatagram_CreateHnd'
datagramApp.c:(.text+0x24f): undefined reference to `VMCIDs_Lookup'
datagramApp.c:(.text+0x2d7): undefined reference to `VMCIResource_AddClientPrivileges'
datagramApp.c:(.text+0x333): undefined reference to `VMCIDs_Register'
datagramApp.c:(.text+0x3bf): undefined reference to `VMCIDatagram_RecvFrom'
datagramApp.c:(.text+0x44f): undefined reference to `VMCIDatagram_SendTo'
datagramApp.c:(.text+0x4a8): undefined reference to `VMCIDs_Unregister'
datagramApp.c:(.text+0x4c0): undefined reference to `VMCIDatagram_DestroyHnd'
/tmp/cc6KkQ4a.o: In function `DoDatagramClient':
datagramApp.c:(.text+0x505): undefined reference to `VMCIDs_Lookup'
datagramApp.c:(.text+0x563): undefined reference to `VMCIDatagram_CreateHnd'
datagramApp.c:(.text+0x608): undefined reference to `VMCIResource_AddClientPrivileges'
datagramApp.c:(.text+0x680): undefined reference to `VMCIDatagram_SendTo'
datagramApp.c:(.text+0x6b8): undefined reference to `VMCIDatagram_RecvFrom'
datagramApp.c:(.text+0x6f7): undefined reference to `VMCIDatagram_DestroyHnd'
TNX

You need to link with a (shared) object to get the userland interface of VMCI
AFAICT this is a propriatary API from Vmware(?) that you should install [1]
The typical compile line would then look more like:
gcc -I <headers_path> datagramApp.c -lvmci
Notes
replace header_path with something like (depending on where the module was built)
/usr/src/linux/include
/opt/vmware/include
-lvmci would suggest the availability of a libvmci.so in your library path (remember to sudo ldconfig -a, optionally include -L/path/to/libs in order to make gcc/ld find)them
[1] perhaps as part of the Custom Installation of VMware Tools?

Related

undefined reference to `ldap_msgtype#OPENLDAP_2.4_2' and many others

I'm working on a project which requires to build several cURL releases, so I cloned them from cURL's Github repository. I'm on Ubuntu 14.04.
According to the instructions, I do what follows:
./buildconf
./configure
make
First two commands end successfully, make command instead gives me some errors:
CCLD curl
../lib/.libs/libcurl.so: undefined reference to `ldap_msgtype#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ber_free#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_init_fd#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_abandon_ext#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_get_option#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_get_dn_ber#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_memfree#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_msgfree#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_set_option#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_search_ext#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_free_urldesc#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ber_sockbuf_add_io#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_url_parse#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_sasl_bind#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_result#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_err2string#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_unbind_ext#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_parse_result#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ber_memfree#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_get_attribute_ber#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_first_message#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_pvt_url_scheme2proto#OPENLDAP_2.4_2'
../lib/.libs/libcurl.so: undefined reference to `ldap_next_message#OPENLDAP_2.4_2'
collect2: error: ld returned 1 exit status
make[2]: *** [curl] Error 1
make[2]: Leaving directory `/home/user/Desktop/curl/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/Desktop/curl/src'
make: *** [all-recursive] Error 1
I don't understand how to solve this. The only thing that comes to my mind is that I have two versions of cURL and I might have misaligned something when some time ago I followed this reply: https://stackoverflow.com/a/38896967/6912352
At the moment this is the situation:
curl -V
curl: /opt/PostgreSQL/9.6/lib/libcurl.so.4: no version information available (required by curl)
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.51.0 OpenSSL/1.0.2l zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
In fact, since then I noticed that probably the first one (/opt/...) is the default one because every time I use cURL o cURL is needed I get the following:
~/Desktop$ git clone --depth 1 https://github.com/openssl/openssl
Cloning into 'openssl'...
git-remote-https: /opt/PostgreSQL/9.6/lib/libldap_r-2.4.so.2: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4)
git-remote-https: /opt/PostgreSQL/9.6/lib/liblber-2.4.so.2: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4)
Can anyone help me to figure it out? Thanks. Ask me for more details if needed.

Issue with missing symbols - NewInstance deprecated. Only when running along with nw.js

In my project I use the libvirt library. These are node bindings to libvirt api. As the issue can relate to other cases of bindings I post my question here.
Upon installation with npm install it throws warnings (one below as an example)
../src/domain.cc: In static member function ‘static v8::Local<v8::Object> NLV::Domain::NewInstance(virDomainPtr)’:
../src/domain.cc:197:44: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated (declared at /home/mark/.node-gyp/6.3.1/include/node/v8.h:3243): Use maybe version [-Wdeprecated-declarations]
Local<Object> object = ctor->NewInstance();
^
In use with plain node apps, it later causes no problems. However, when nw.js is involved, it crashes it exactly due to this NewInstance use. For evidence see:
....nwjs/nw: symbol lookup error: ..../project/node_modules/libvirt/
build/Release/libvirt.node:
undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEi
Aborted (core dumped)
This symbol in question refers the same method - NewInstance.
The code in question, in its pure form looks like this:
Domain::Domain(virDomainPtr handle) : NLVObject(handle) {}
Local<Object> Domain::NewInstance(virDomainPtr handle)
{
Nan::EscapableHandleScope scope;
Local<Function> ctor = Nan::New<Function>(constructor);
Local<Object> object = ctor->NewInstance();
...
As I'm far from being proficient in these V8 matters maybe someone can advise me what to alter and how to make it work.

PhatomJS: How can I use(require) an npm module in phatom js?

i'm trying to require() and use this logging module (it has some dependencies also) in phatomJS but it fails and prints this error:
C:\node\scrap>phantomjs app.js
ReferenceError: Can't find variable: process
phantomjs://platform/index.js:3
ReferenceError: Can't find variable: process
phantomjs://platform/index.js:9
TypeError: undefined is not an object (evaluating 'chalk.bold.red')
phantomjs://platform/index.js:29
TypeError: undefined is not a constructor (evaluating 'log.info('All settings loaded, start with exe
cution')')
phantomjs://code/app.js:16 in global code
I don't know why or what's wrong ? what am I missing ?

./configure don't find htobe32

working on an embedded Linux i get a strange error.
conftest.c:37:10: warning: implicit declaration of function 'htobe32'
[-Wimplicit-function-declaration]
n_be = htobe32(n_uint32);<br>
/tmp/cckbgVe5.o: In function main:
conftest.c:(.text+0x18): undefined reference to `htobe32'
collect2: error: ld returned 1 exit status
I guess anything is proper installed, because i can find the endian-Headers. Although, i don't know which Library is actually needed.
/usr/share/man/man3/endian.3.gz
/usr/include/bits/endian.h
/usr/include/linux/byteorder/little_endian.h
/usr/include/linux/byteorder/big_endian.h
/usr/include/endian.h
This is my path:
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bi/vendor_perl:/usr/bin/core_perl
Is a lib missing?

not building with ./build_native.sh and android- ndk-r8 in cocos2d-x

I have downloaded the source code for a projet in cocos2d-x.
I am using the ./build_native.sh from the Hello World example, which is sure it works.
Yet again I am getting this error when compiling:
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile++ thumb : cocos2d <= CCGrabber.cpp
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In constructor 'cocos2d::CCGrabber::CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:46:32: error: 'glGenFramebuffersOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::grab(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:61:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:65:26: error: 'glFramebufferTexture2DOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:68:63: error: 'glCheckFramebufferStatusOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::beforeRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:88:47: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::afterRender(cocos2d::CCTexture2D*)':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:113:50: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../libs/cocos2dx/effects/CCGrabber.cpp: In destructor 'virtual cocos2d::CCGrabber::~CCGrabber()':
jni/../../libs/cocos2dx/effects/CCGrabber.cpp:127:35: error: 'glDeleteFramebuffersOES' was not declared in this scope
I searched and found this sollution. But it does not work for me. I am still getting the same error. Maybe it is different in ndk-r8 whilst the sollution is for ndk-r7.
Any help?
Your android sdk version must bigger than 2.2.because from 2.2,the android begin to support opengl es 2.0,and the cocos2d-x 2.0 use the opengles 2.0 to render

Resources