Undefine symbol from Qt library - qt

I create a static library using Qt library. But when I use this created static library and link to my application, then the problem is it will give me undefine symbol of QImage.
Please advise.
Many thanks.
some error message:
undefined reference to `QImage::~QImage()'

You need to link the application with your library AND Qt libraries.
You library is not linked to Qt.

When you create a a static library, it doesn't pull in everything from QT. It pulls in only the object files to satisfy the undefined symbols.
So you still need to link with QT libraries.

Related

How to setup QT Creator to use Autodesk FBX SDK as a library?

The Qt documentation for QMesh at the following link, https://doc.qt.io/qt-5.11/qt3drender-qmesh.html, shows that QMesh supports FBX when using the Autodesk FBX SDK. It provides no resource about how to go about setting this up, so I searched and found 1 resource on setting up the FBX SDK with Qt Creator at the following link:
https://forums.autodesk.com/t5/fbx-forum/including-sdk-to-qt-creator/td-p/8184654
I tried the above solution, but when I try to load the QMesh I still get a Debug warning that: Qt3D.Renderer.Jobs: unsupported format encountered (fbx)
This is my code, which works for .obj files
Qt3DRender::QMesh* mesh = new Qt3DRender::QMesh();
mesh->setSource(QUrl::fromLocalFile(filepath));
I'm not sure if the "fbx geometry loader plugin is built and found" which according the Qt documentation is needed. I put the proper reference to the library in my .pro, but as far as I can tell setSource still doesn't know to utilize FBX files.

GLEW (OpenGL Extension Wrangler): Loading opengl dll at runtime?

I would like to load opengl32.dll at runtime (using LoadLibrary from Win32) and then load OpenGL2/3/4 functions. I tried to use glew for that, but it can't resolve some wgl functions.
So is there an easy way I can use glew to import OpenGL functionalities while loading opengl dynamically ?
It is possible to do what you are asking for, but you will have to go about it differently. Typically, when a shared library (or dll) is manually loaded at runtime, you will have to search, by symbol, for the functions you want to use and assign them to handles so you can call them.
What you are doing now will never compile because you are explicitly using symbol names that the linker cannot find. You have to replace all of these unresolved function calls with queries into your manually loaded shared library (opengl32.dll).
There's some good code you can use for reference in the glfw project. Take a look at both the _glfwInitWGL and loadWGLExtensions functions.

Create a Qt library to be used in a non-Qt application

I created a Qt static library following the instruction here:
http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application
Then I tried to link the library with my own (non-Qt) application, and GCC complained about undefined references. Examining the library content using Linux nm utilty I found the function I intend to call has cryptic letters added before and after it.
Reading the instruction from the instruction link more closely, it suggests that I need to use use an import define so the right Qt macro can be called to import the function (which I assume renames the function to match the naming scheme in the library). But I don't really want to introduce Qt dependency in my main application.
What I really want to do is to build a UI frontend library with Qt, and my main application will simply link to it without having any Qt dependency. Is this possible? Or am I using Qt in an unintended manner?
Thanks.
It sounds like you're running into C++ namespace mangling. Try adding an 'extern "C" {}' block around your libraries export.
The main point of the QLibrary::resolve function is to provide an abstraction layer so you don't have to worry about the win32 command or the linux command for resolving a symbol. It shouldn't be necessary to use a library created with Qt.

Qt using shared COM Object

I have an shared dll file (COM, registered with regsvr32.exe) written by (I think with delphi) 3rd party company. But I havent .lib or any header file about this library. This library have a few objects, interfaces and functions. I can't find how to use exported objects, interfaces and functions on internet. Can anybody explain this with example? I can use this library with c# with success.
EDIT:
I think, I must use this http://doc.qt.nokia.com/4.7/activeqt-dumpcpp.html
Check the QAxContainer classes.
The QAxContainer module is a Windows-only extension for accessing
ActiveX controls and COM objects.
Also check the Using ActiveX Controls and COM in Qt page from the Qt documentation

Runtime error when compiling flex application with ANT

I'm using a licensed version of Flex Builder Pro to develop an application.
I compiled the swc and generated swf successfully using ANT tasks.
It contains an Advanced Data Grid also. When this application is accessed, I get a runtime error and it fails to load.
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.controls::AdvancedDataGridBaseEx/getSeparator()
at mx.controls::AdvancedDataGridBaseEx/createHeaderSeparators()
at mx.controls::AdvancedDataGrid/createHeaderSeparators()
at mx.controls::AdvancedDataGridBaseEx/drawSeparators()
at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()
at mx.controls::AdvancedDataGrid/updateDisplayList()
at mx.controls.listClasses::AdvancedListBase/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()
I'm adding datavisualization.swc and datavisualization_rb.swc in the build paths.
How can I successfully compile the application without any runtime errors?
Please help.
Include the swcs in the library path as shown here.
Maybe this helps: http://kb2.adobe.com/cps/403/kb403121.html
By coincidence I had the same error a couple of days ago. The source of this problem was a library against I built, which was linked statically against an older version of the datavisualization libraries. Normally libraries should only be compiled against other libraries using the external-library-path compiler option, but this library was compiled incorrectly.
So that library contained older parts of datavisualization that were referenced by code in the library, while my code referenced newer parts from the datavisualization library itself. The result was a mix of older and newer datavisualization classes at runtime.
So check the SWCs that you include in your library path. You can extract these with a ZIP tool. You will then find a catalog.xml file in there. Search for mx/controls/AdvancedDataGrid in this file. In case you can see it included in the catalog, you've found the bogus library.

Resources