Using FlyCapture SDK with Qt Creator - qt-creator

I am usign Windows 7, Qt Creator 4.4.1 (x32) and FlyCapture SDK 2.11.3.425. The problem is that I keep getting linking errors when trying to use the FlyCapture Library.
I have boiled down the problem to a simple program. The SDK main path is C:/PointGrey
main.cpp
#include <FlyCapture2.h>
using namespace FlyCapture2;
int main()
{
Camera camera;
return 0;
}
FlyCaptureApp.pro
SOURCES += main.cpp
INCLUDEPATH += C:\PointGrey\include
LIBS += C:\PointGrey\bin\FlyCapture2.dll
These are the errors:
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraC1Ev'
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraD1Ev'
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraD1Ev'
collect2.exe:-1: error: error: ld returned 1 exit status
I have tried to import the .lib file located in /bin, but without success.
So, how can I use FlyCapture SDK with Qt creator? Am I missing some .dll? Is FlyCapture only compatible with Visual Studio?

The problem was I was tring to compile the project with MinGW, while the FlyCapture library was compiled with Visual C++.
I changed the compiler in Qt Creator and the problem was solved.

Related

qtcreator issue compiling with protobuff

Im trying to compile my code with a new version of protobuf (currently it was compiled with custom version, and i would like to compile it with the version that comes with the ubuntu via apt-get)
in the project settings i'v added -lprotobuf
.obj/Test.pb.o: In function `test_ns::protobuf_AssignDesc_Test_2eproto()':
<<path to file>>/Test.pb.cc:115: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
the line with the error('Test.pb.cc'):
void protobuf_AssignDesc_Test_2eproto() {
protobuf_AddDesc_Test_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Test.proto");
i can see that the error caused when trying to locate the file "Test.proto", but it exist in another directory, and it was used by the protoc command to generate Test.pb.cc and Test.pb.h files
Just fund the reason, the protobuff provided by the ubuntu compiled with different ABI, matching the ABI in our project fixed the issue

fatal error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure

When porting Qt to 5.10.1, I am getting following error
Reason for Error: Visual studio Build with clr(Common language runtime ) support settings, so that above error is generated.
C/C++ Advanced > showIncludes sets "Yes", so It has been identified that from Qt's QThread above error is generated.
How to resolve above error in Qt 5.10.1 with VS2015 ?
Note: I am using C# dll in my Qt VS project
Make sure QThread doesn't include when clr is enabled.
I have done conditional compilation for my project include
#ifndef CLR_ENABLED
#include <QtCore/QThread> //Error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure. Qt5 porting.
#endif

LLVM/Clang 3.8 unresolved external symbol __readgsqword

I'm trying to compile the following code in clang 3.8.0 for windows (pre-built)
int main()
{
__readfsdword(0x30);
__readgsqword(0x60);
return 0;
}
and I'm getting the following link error
error LNK2019: unresolved external symbol __readgsqword referenced in
function main
any idea why the call to __readfsdword compiles and links fine but the call to __readgsqword does not?
I'm using the -m64 compilation flag to build a 64bit binary, and __x86_64__ preprocessor flag which should enable the use of __readgsqword according to \lib\Headers\Intrin.h
I get the same error on both x86 and x64 versions of clang.
any help will be appriciated
I don't know if you solved your problem, but I will post an answer for future readers.
Just #include <intrin.h> in your project. No need to copy Clang's Intrin.h. Windows SDK provides that header.

Run QT GUI via lib and dll on console application?

Downloadable address of full source code:
http://cfile209.uf.daum.net/attach/267EAF4B5215CFDD0D951E
Hi. I am trying to create a console application which use a function coded in a lib file, which also call functions in a dll file. (console -> lib -> dll)
Dll file is QT Gui implementation.
Lib file loads things from DLL using QLibrary.
Those lib and dll library are compiled on QT Creator via .pro file. (QT version is latest 5)
The Main console applications uses those two lib and dll is created on MSVS 2008.
Here I got an error when I compile it on MSVS 2008:
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl CreateQt(int,char * * const)" (?CreateQt##YAHHQAPAD#Z) referenced in function _main
I put lib and dll into Console application's folder, it seem like I get an linking error, any help?
Thank you
Here is my console application source code.
#include "main.h"
#pragma comment(lib,"./main.lib") //main.lib is library created on QT Creator
int main(int argc, char *argv[])
{
CreateQt(argc,argv);
return 0;
}
Do you have
TEMPLATE = lib
In your lib's pro file?
In your console's pro file do you have something like
LIBS += -L../folder/path/to/libfile -lLibFileNameWithoutDotLib
It seems like you're not linking the lib file in your console app correctly. I assume that CreateQt is a function you have in your lib code.

Blackberry 10 undefined reference to `__sync_fetch_and_add_4

On Blackberry 10 using C++ I am getting the following link errors
undefined reference to __sync_fetch_and_add_4
undefined reference to __sync_fetch_and_sub_4
undefined reference to__sync_bool_compare_and_swap_4
Anyone know which library I am missing. The Momentics IDE is using GCC 4.6.3
Thanks
Wild stab in the dark but is it the 'math' library which can be added by including LIBS += -lm in your .pro file.

Resources