Display frame from VNC/RFB into an OpenGL application [duplicate] - c++

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 8 years ago.
I would like to be able to display remote client in a simple OpenGL application. "Simple" means only display the client such as a texture.
I started to look the VNC protocol but due to their popularity I only have few documentation related to VNCViewer. About RFB the only documentation is: http://www.realvnc.com/docs/rfbproto.pdf which is cool to understand the protocol but not enough to use it in a C++ OpenGL application. Then I found: http://libvnc.github.io/
I tried to compile the example (downloaded from github). So I added into my qtproject all rfb headers files run cmake on some of them. Then I built it but got the error:
undefined reference to `rfbMakeXCursor' and many others related to rfbXxxxx
rfb.h contains declarations to those "undefined" errors.
I don't understand what did I do wrong. Has anybody already made it work?
I'm working on Windows 8.1 64bit using C++ qtCreator and MinGW.

Headers are just ""able of contents" for the compiler to know, which functions can be called. You need to actually link to the library. The odds are, that since you've got it from GitHub you must first build the library. The built library you then add to some "extras/lib" directory in your project, configure that directory as additional library directory and add the library to the linker flags.

Related

Linking errors only when using Qt creator [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 4 years ago.
I have linking problems when I execute some code that links to different shared libraries. The fact is that I haven't them if I use the console, but only if I execute it within the Qt creator IDE.
Do you guys know if there a kind of console where I can use nm readelf and stuff like that with the QT build / runtime environment?
Alternatively, how would you debug such problem?
Specifically, the error I get is something like:
symbol lookup error: blabla undefined symbol: blabla
[EDIT] Suggested question is different in respect to what I'm asking. I'm specifically speaking about the qt creator environment, not linking errors in general. Specifically, it's about how to debug linking errors in qt creator when using the console everything seems ok.
1) Can you explain a bit more in detail what you need?
2) Can you publish your .pro file generated by Qt Creator?

Direct2D Only Partially Linking in C++ Builder

I've got a C++ Builder (Rad Studio Berlin) project setup to use Direct2d. Canvas drawing works just fine with the TDirect2DCanvas which would indicate Direct2D is linking properly. Everything renders smoothly. However, I need to use a matrix. I get linking error when I try to. For example, when try I:
canvas->RenderTarget->SetTransform(D2D1::Matrix3x2F::Rotation(15.0, D2D1PointF(100, 100)));
...I get the following linking error:
[ilink32 Error] Error: Unresolved external 'D2D1MakeRotateMatrix' referenced from C:\DP\TRUNK\SRC\CLIENTSIDE\APPLICATIONS\VIEWER\WIN32\DEBUG\MIMAGE.OBJ
C++ builder was supposed to already be setup to link against direct2d if I just include the headers. Can anyone help me link against the appropriate files in the C++ Builder way?
I found the solution from a different source. Here it is:
After some research, this issue has not been determined to be a bug.
For many of the standard Windows API functions, the IDE will add the correct library automatically so that the dependencies on the function references will be satisfied. With DirectX (which is somewhat uncommonly used), the IDE does not automatically supply the library which corresponds to the header file, so this is causing the unresolved linker errors.
The solution is to either (as I mentioned previously) add the D2D1.lib to the project, or statically reference it in code:
// as long as D2D1.lib is on the library search path, it should be found
#pragma comment(lib,"D2D1.lib")
Some developers add the above line of code to their headers and so all you need to do is include the header and all is well... the DirectX team did not do this and hence the unresolved linker errors.
Hope this clarifies the issue,

unresolved external symbol (LNK 2001) error with pcap functions [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 7 years ago.
I know how to fix typical LNK2019 errors in MSVS (2013) but I'm having some extra trouble when trying to use winpcap..
I installed winpcap from this site (a couple times, actually), which supposedly installed the necessary .dlls I need, and I also installed the developer kit and pointed the linker to it as so: (1), (2).
I placed WIN32 in my preprocessor directives (or rather, defines), which took away compilation errors. However, when I run the test code at the bottom of this post, I get these errors.
Test code here: http://pastie.org/10730081
Looking at your screenshot, you have added the paths to both the 64-bit and 32-bit library files. If the developers of the library were not careful to use different names for their 64-bit and 32-bit editions, then the linker won't be able to find the right functions.
It is searching first in the 64-bit folder (because that's the one you have listed first), but you are compiling the application targeting a 32-bit architecture (the "Win32" project configuration is active).
The fix is simple: make sure that you have matched up the "Library Directories" with your project configuration:
Win32 → C:\code\C++\libs\WpdPack\Lib\
x64 → C:\code\C++\libs\WpdPack\Lib\x64\

Linking dependency to static library? [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 8 years ago.
I have a small console application that makes use of the MySql C/C++ connector interface.
I'd like to make a static library out of the existing code and am wondering how (or if it is possible) to link the MySql C/C++ interface with my static library seeing as there is no "Link" tab in the properties dialog of the project.
I'd basically like to link my static library to a new project and have everything work as it did in my old console application.
Is there a way of doing this (without simply just linking the MySql C/C++ interface to the new project) or am I looking at this from the wrong angle? If so let me know what might be a better alternative.
Static library projects (i.e. that output a .lib file on a win32 environment) haven't a link tab because they're not meant to be linked when generating the output file.
Instead they concur, alongside with other .lib files, to resolve link-time dependencies in a project (e.g. executable) that requires linking.
To do what you want you just need to include the necessary headers and make sure both your code and the C/C++ interface (which is also a lib file) are provided at link-time for the project that will use them and will be ultimately linked

Stuck with twitcurl

this question has gone back and forth a bit as I have learnt some things about g++ about unix systems (sorry if I messed anyone about).
For a project I am currently trying to finish I would like to get twitcurl running with Xcode and OpenFrameworks. If anyone has managed to do this please share with me this arcane feat.
Below is some of the things I am stuck on:
Regurgitating some of the instructions from their wiki it says to
download the libraries source
build twitcurl library using visual C++ or make (their is also cmake in their).
Include twitcurl.h and curl headers in your twitter application and link to twitcurl.lib and libcurl.lib/libcurl.dll.
This seems simple enough but when I make the library, there is no twitcurl.lib. A different file libtwit.a is produced, which I assume must be what OSX needs (as installing puts it in usr/local/ along with the headers). However then if I try to include the twitcurl.h in a header and make a twitCurl object I then get more undefined symbols
Undefined symbols for architecture i386:
"twitCurl::~twitCurl()", referenced from:
testApp::setup() in testApp.o
"twitCurl::twitCurl()", referenced from:
testApp::setup() in testApp.o
ld: symbol(s) not found for architecture i386
I now am assuming twitcurl makes for a 64bit (I have tried adding CFLAGS=-m32, but it fails), and to my knowledge Openframeworks is only 32 bit currently. This means twitcurl may not be an option for me, but again, if anyone knows how please let me know!
Thanks in advance.
You'd probably do well to recompile twitcurl, last I looked (3 months ago), it was compiled with VC6, which has its own way of mangling C++ symbols, so the lib won't link correctly for g++.
you could then just import it directly as well and then not need to worry about linking to the libs, however it would be a good idea to test in a small demo app, before integrating into an already build system, that way you know if the error is on your side or somewhere else.
Also, when it comes to this type of problem, the exact compiler errors are more helpful than just describing the problem.
The error message you've posted is the linker's longwinded way of telling you that its looking for a definition of the curl_easy_setopt function, which is part of libcurl. Adding -lcurl to your g++ line should fix this (by telling the linker to link in libcurl).
However, twitcurl comes with a Makefile, which already does this. In addition, if you are trying to build a shared library there, you're doing it wrong...
Maybe you can try ofxTwitter, an openFrameworks addon for twitter, to get your twitter functionality. get it here: http://forum.openframeworks.cc/index.php/topic,2750.0.html