I'm using Qt Creator 3.5.1 (opensource) with Qt 5.5.1. There I've created a shared library, and I can successfully build it. In the resulting build folder I find the so-file as expected, but I can't find the header files which are needed to use the library. Are the header files not expected to turn up here? I though the build folder would contain everything needed in order to make use of the library. Is that not the case?
I don't think they should be placed there. That is the build directory, not the installation directory. You can however also define the installation behaviour; see Advanced Usage - Installing Files. You choose which headers to distribute and which are private and place the public ones in the proper position.
Related
I have multiple targets in my project and I added a package dependency on the project that has a binaryTarget to a zip that contains my xcframework. It adds it to my project, my main target has it but when I try to add it to my other targets via General > Frameworks and Libraries it's not listed in the dialog for me to choose (nor is it in Link Binary with Libraries either.
Xcode 14.1
I can replicate this with other packages that just have binaryTarget as well like https://github.com/PSPDFKit/PSPDFKit-SP. Packages that just have source are fine.
I have tried deleting the package and then adding again after having added my new targets, tried shutting down xcode and restarting.
I had the same issue, and the solution for me was a small hack in the project.pbxproj file, as follows:
Navigate in the Finder to the project directory -> Right click on the .xcodeproj file -> Show Package Content. You will find the project.pbxproj file there.
Search for the productDependencies key. You will find as many as targets you have in your project with Embedded/Linked frameworks. If your second target does not have framework yet, just try to add a generic Swift package, so Xcode will make the necessary changes for you in the project.pbxproj
Copy the line with the given binary linked library to the required target section/list.
I hope this helps, for me it was finally working. However I think it is still some kind of bug in Xcode/SPM.
I am trying to create a project assosiated with the SimConnect SDK.
I am new to QT, and in Visual Studio, I just had a SimConnect.h file, a .lib file, and a .dll file, and I managed to make it work. Now I am trying to create a C++ widget project, using the same SDK, but in QT.
I put the header file in my QT project's folder, where the other default code and header files are located, and then I went to the project and added them as existing files, as I read in Google. I'm having problems with the actual library.
I've been searching Google for a guide on how to add a library file to the project, I did some things I saw on the internet, like the LIBS line for example, but I probably did it wrong, even though it looked very simple.
I am not sure where to drop my dll/library files in the project directory, maybe the problem is I always put them in the wrong spot.
The furthest I got to, was an error message saying "Unresolved external symbol", and a red writing saying ".obj file not found" on every function I tried to use from the SimConnect functions, which probably means QT couldn't find my library/dll file.
I also tried to add the libraries from the "Add library" option in the project, but that didn't work too.
EDIT: it also warns "warning: LNK4272: library machine type 'X86' conflicts with target machine type 'x64'" maybe it has to do something with it.
(Posted on behalf of the OP).
Solved! My problem was my machine was set to 64bit, while the library was set to 32bit, so I downloaded the 32bit kit, and ran the project through that, and it worked!
So I have been working with the free version of JWrapper for some time now and have been quite pleased with the results; however, I have now purchased a license and would like to use it but I am unable to find the method with which to activate my JWrapper. I do not use the graphical interface version of JWrapper; rather I have created a xml installation file and pass that directly via commandline to JWrapper for building. Is there a special xml tag for specifying the license location? I was unable to find this information on JWrapper's homepage or support docs.
I received an answer from the support team. In order to use the license without using the JWrapperApp gui to build your application you will simply have to have the jwlicense.txt file in the same directory as your jwrapper.jar
After some tests it appears that the jwlicence.txt file must be in the current directory. So the best is to have all the files (jwrapper jar, jwrapper.xml and jwlicence.txt) in the same folder and run the compiler from that folder.
Guys I've written app in qt and when trying to run it (double click on *.exe) I'm getting error that this application cannot start because qtnetwork4.dll isn't available. I've searched my drive and I found few files with this name (and copied one by one every time trying to run my app) but none of them seems to work. How can I solve it?
place into your *.exe - folder appropriate dll-s from %QT_PATH%\bin\
There is an app called Dependency Walker that will let you know what functions in qtnetwork4.dll are being used in your program. It can be found at the following:
http://www.dependencywalker.com/
All of the DLLs your program use will be from the same installation as the qmake.exe that is used to compile the program. If you are using Qt Creator you can see where the qmake.exe your using is located by going to:
tools->options->Qt4
Get the DLLs that are located at the path displayed here to make sure they will work with your program.
On windows, DLL are looked for in folder where executable lies, then using "PATH" environenment variable.
In your case, you want to put your dll along your executable, taking them from the sdk you're using to compile
The following page provides a lot of additional information on the subject (example, plugins, strategy for building installers)
To force using QtNetwork and linking it, you have to put
QT += network
in your poject file.
If you're sure you're not using it, you can use
QT -= network
I was successfully able to compile and run my Qt application. However, when I move the .exe file outside its original path, I found out that I have to manually copy the Qt DLLs (e.g. mingw10.dll, qtcore4.dll). Is there any dynamic way to link these libraries with my application?
I think you mean you want to "statically" link these libraries with your application.
Basically this means that everything will be rolled inside your exe, and you will have no need of those dlls anymore.
There are advantages to to static linking, but there are also disadvantages as well. You should be absolutely sure that this is what you want to do before you go this way.
Check out this link which explains the difference in depth Dynamic Linking vs Static Linking
As for your specific issue, if you are sure you want to use static linking you will have to change your Qt setup to be built statically. By default the Qt distribution is setup to use dynamic linking. There is a handy guide for that here.
Basically when you setup the build you have to run "configure -static" to change all the project settings to use static linking instead of dynamic linking. And then build Qt over again.
You should also verify your Qt license. If you are using the Qt LGPL license and you want to to link statically you will have to include all your object files (.o and .obj) as Mihai Limbășan wisely explained in his comment. If you have bought and paid for Qt, then you have no problem.
If the DLLs are on the PATH for the application, then they will be found and work. So, you could add where your Qt binaries/dlls are into the %PATH% environment variable. If you're going to create an installer for your application, you'll need to either package these libraries in so they're in the bin directory - or you'll have to expect every user to install and possibly compile Qt themselves (hint: go with the first option. :) )