OpenCl 2.0 easy example - c++

I have compiled an OpenCL 2.0. example that is found here: https://tobias.rautenkranz.ch/opencl2/
I get the following runtime error: No source available for "cl::Platform::setDefault() at 0x4187a4".
This happens after I press resume once in the Eclipse run menu.
I'm using Ubuntu 16.04 and eclipse.
From what I understood from googleing the problem it's a threads problem, but I'm new to the area so it's not easy for me to understand!

Related

MySql connector-c++ wont link in QtCreator but works fine locally on raspberry pi3

Firstly, thank you in advance for at least reading this question.
Secondly, feel free to call me an idiot if this is a "no brainer"
Now down to the issue at hand...
I am running Ubuntu 16.04 (64bit) with QT Creator as my IDE and on the whole it works great. I can cross compile for the Raspberry Pi3 (running raspbian) and also compile plugins for X-Plane.
Everything was going great until I needed to implement MySql into my project. That's when it all went south.
I can not use the Qt library for this as X-Plane does not like anything Qt related in its plugins. But that is fine, I have connector-c++ working on that machine and it connects to my MySql server and does everything it's supposed to.
I think I have read just about every forum and watched every youtube video on this but can not get Qt Creator to compile with connector for the raspberry pi.
I wrote/compiled a test app locally (with g++) on the pi and it works great. However for some reason (government plot maybe?) it refuses to link the libraries when compiling under Qt Creator.
The error I get when compiling in QtCreator is:
undefined reference to `get_driver_instance'
Currently,
I have followed the instructions for setting up a cross compiler here:
https://wiki.qt.io/RaspberryPi2EGLFS
Downloaded the connector code from here:
git clone https://github.com/mysql/mysql-connector-cpp
I have followed the instructions for compiling connector-c++ here:
https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-unix.html
And I have banged my head 1000x on a brick wall here:
(picture of blood stained wall not available)
Also, I have tried compiling connector on my Ubuntu pc with paths to the pi's sysroot etc. but i think it made a 64bit version which causes Qt Creator to have a dummy spit about "unrecognized format".
I am hoping that this is just me having a "senior moment" and that someone can point me in the right direction.
To save putting up irrelevant logs/code I will wait until someone asks for it and then copy/paste what they need.
Again, thanks in advance and know that I will be eternally grateful for any light on this matter (preferably before I go even insanerer)
Well after 2 weeks of pain, I have solved this problem. Here is what I think is the issue:
Firstly, I found that mysqlcppconn is not needed (at least for me) and used the mysql libraries in /usr/lib
Secondly, the symlinks to libmysqlclient.so.6.0.22 were by default:
libmysqlclient.so.6 -> libmysqlclient.so.6.0.22
The compiler was looking for libmysqlclient.so which didn't exist. So I created the link (libmysqlclient.so -> libmysqlclient.so.6) and it worked!!
Thanks to all who helped.

I am trying to run the CUDA example but i have problems with openGL (libGLEW.a) on Ubuntu 16.04 LTS

I am trying to run the bilateral filter example in the standard cuda examples on Ubuntu 16.04 LTS with Nsight Eclipse Edition.It performs a simple bilateral filter on an image and uses OpenGL to display the results.
All the examples that don't use openGL work fine so i guess the cuda installations worked, but this one that uses openGL and another one still with openGL I tried do not.
I always get this error while building:
make: *** No rule to make target "/usr/samples/common/lib/linux/x86_64/libGLEW.a", needed for "exampleImg". Stop. exampleImg C/C++ Problem
I noticed that the path in the error is not where libGLEW.a is but i don't know how to change it in the makefile or if that would fix the problem
I also looked in the findgllib.mk file in the example directory to check if the cuda version was right (which is right) and if i could change the directory there with no success.
What could be the issue?
EDIT: I solved the problem the solution is written below as a comment. Now I have a problem with uchar4 seen as ambiguous in the cpp files, but that's another story
I solved the problem by going to Project->Properties->Build->Settings->Tool Settings->NVCC Linker->Miscellaneous and changing the path under "Other Objects" to the path to libGLEW.a found in the samples area. Now, if I build, I get no error and it runs.

OpenCV in Code::Blocks: The application was unable to start correctly (0xc00000be)

I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.

Eclipse CDT syntax coloring issues

First off, I am running Eclipse 3.7.2 Build: M20120208-0800 on Ubuntu 12.04 (installed using the eclipse-* packages). I have applied all the updates available, but am still seeing the issue described below...
When I open a C++ file (*.h or *.cpp), it correctly highlights all object names in the file, but if I add new code to the file Eclipse will not apply coloring to the new code lines. However, if I restart Eclipse the new code will be correctly colored.
The indexer also appears to be working correctly because code completion seems to be working properly. The logs also appear to be clean. Has anyone seen this behavior before? Is there a good way to reset Eclipse to correct this issue?
Thanks!
My solution to this problem was to re-install the eclipse packages for Ubuntu 12.04. My syntax highlighting came back!

OpenCV: "Feature Matching with FLANN" tutorial - getting exception

I am starting up with OpenCV (using C++) and was playing around with the "Feature matching with FLANN" tutorial from here:
http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html
I did not modify anything, just tried running it as it is. Unfortunately, when running it, I am getting this error when the program tries to detect the keypoints (on the line detector.detect(img_1, keypoints_1)) :
I had no problems with running other OpenCV tutorials out of the box...did anyone experience similar problems?
My system: Visual Express 2010 and OpenCV 2.3, under Windows 7 64-bit. Could this be a bug of v2.3, or some issues related to the 64-bitness of my system?
It sure helps to know more about C++ than a worm :) I realized I had linked against the release version of the feature2d lib. As always, solved automatically by virtue of the "power of posting"...
I have same mistake with your‘s,because you have use different Version of lib file.
If you use debug,you must use lib ended by 'd'.