qt cannot open input file 'c:\Qt\qt\lib\qtmaind.lib' - qt

I am using qt 4.5
I have created a project and I want to compile on visual studio 2008 for windows mobile 6.0
So I have created the project files doing this:
D:\Projects\Phone_PDA\Phone_PDA>set QMAKESPEC=win32-msvc2008
D:\Projects\Phone_PDA\Phone_PDA>qmake -tp vc
The VS project was created. However, when I try and compile I get this error:
LINK : fatal error LNK1181: cannot open input file 'c:\Qt\qt\lib\qtmaind.lib'
However, when I check my librarys and includes under project properties in visual studio. I have this:
Additional Include Directories
c:\Qt\qt\include\QtCore
c:\Qt\qt\include\QtGui
c:\Qt\qt\include
c:\Qt\qt\include\ActiveQt
debug
c:\Qt\qt\mkspecs\win32-msvc2008
Additional Library Directories
c:\Qt\qt\lib
Additional Dependencies
c:\Qt\qt\lib\qtmaind.lib
c:\Qt\qt\lib\QtGuid4.lib
c:\Qt\qt\lib\QtCored4.lib
However, when I browse to the directory c:\Qt\qt\lib all I have is:
qtmain.prl and qtmaind.prl
However, I don't have qtmaind.lib or qtmain.lib
Many thanks for any suggestions,

Are you sure you are using the correct QMAKESPEC?
I would think you would need to use wince*-msvc2008
See Qt: Supported Platforms

Open the Visual Studio command prompt (you can find a shortcut in the start menu). It has all the appropriate environment variables set. Go to C:\Qt\20****\qt. Type configure and then nmake.

Did you download the source distribution? If so you would need to compile Qt before you get the libs.
See:
http://doc.qtsoftware.com/4.5/install-win.html
http://doc.qtsoftware.com/4.5/install-wince.html
My commercial version comes precompiled. If I remember correctly, when I used the open source version I needed to compile everything myself.

First you have to configure the Qt to your machine to get the libs! It will takes several minutes. Follow the steps in: http://portfolio.delinkx.com/files/Qt.pdf

in properties -> linker -> input
remove ANY path for qt libraries such qtmaind.lib
sometime you need remove :
/SUBSYSTEM:WINDOWS%40QMAKE_SUBSYSTEM_SUFFIX%40) from the VS project (under Properties --> Linker --> Command Line).
this is known BUG in VS addin

Related

Cannot find c:\Users\qt\work\install\lib\Qt5Widgetsd.lib when compiling QtWebEngine examples

I downloaded Qt5.6 VS2013 32bit and try to run the official example of QtWebEngine.
I just followed the instruction but
When linking it gives out an error of
LNK1104 file not found c:\Users\qt\work\install\lib\Qt5Widgetsd.lib.
However, I have no idea of where this path c:\Users\qt\work\install\lib\ comes from.
I did text search in all directories of example folder and no hits other than generated files(makefiles and pdbs).
I also checked system environment variables but no hits.
Furthermore, I checked Qt Creator'r Projects panel and its Build Environment and still no hits.
Did I miss something?
P.S. this error was given out by linking DemoBrowser example of QtWebEngineWidgets pro
The link is generated by qmake when it generates the build scrip from the qt project file (*.pro). It is based from the qmake application path that is generaly installed together with the libraries (check you qt kit setup to change it if needed: Jst browse to qmake.exe application).
Then try regenerate the build script. It should fix the issue.
You may also have issue with installation not being in debug mode; you are trying to use Qt5Widgetsd.lib library instead of the non-debug one Qt5Widgets.lib

make qt5.3.1 .pro file from Visual Studio 2013 project

I wrote a little Qt utility in VS2013. It works fine when running from IDE - even debugging is great. But VS doesn't generate usable exe (error 0xc000007b - "The application was unable start to work correctly", after I've installed all required qt's dll's).
Is there any way to compile everything and correctly from VS? To make really runnable exe?
Or - How can I write correct pro file for qmake?
I tried to write some. qmake generated from it makefile without any erros, but running VS's nmake it gives a "fatal error: U1077 return code '0x2'".
As I think it is problem with linker - even I wrote for all used modules all required QT += lines.
Can anybody help? I think I'm not alone who met this problem.
Thanks.
When you get an error like you got it means you have some dlls missing. You can only find out what dlls are missing using DependencyWalker.
*.pro files can be generated from Visual Studion using the Visual Studio Add-in for Qt4 or with Visual Studio Add-in for Qt5 depending on your Qt version.
If you have a Qt/VS application you want to deploy, AFAIK the following dlls are needed:
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
platforms (folder)
qminimal.dll
qoffscreen.dll
qwindows.dll
icuin52.dll
icudt52.dll
icuuc52.dll
YourApplication.exe
For more information see http://qt-project.org/doc/qt-4.8/deployment-windows.html

PLCrashReporter in XCode 4 - won't compile in Simulator

I must be doing something totally stupid here, but I can't get the PLCrashReporter framework included in my project. Here are the steps I took to get the framework:
Downloaded the .dmg file from the official project site on google code
Copied the CrashReporter.framework folder to the root directory of my project
Added the framework by going to my project, selecting the target, going to the Build Phases tab, opening the Link Binary With Libraries section, clicking the plus sign, and adding the CrashReporter.framework folder
I am pulling in the framework in my class file by using
#import <CrashReporter/CrashReporter.h>
When I try to compile under 4.3 simulator, I get the following errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PLCrashReporter", referenced from:
objc-class-ref in AppDelegate+CrashReporting.o
"_OBJC_CLASS_$_PLCrashReport", referenced from:
objc-class-ref in AppDelegate+CrashReporting.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I compile under the device, everything is fine. Is there some sort of header or library search path I need to include?
The app compiles under XCode 3 without issues under all configurations.
I had the same issue and was able to resolve it. Here are the steps I completed...
Download the PLCrashReporter source release and unzip.
Open the PLCrashReporter xcode project. This project is setup to use an old SDK, update all the required SDKs for each target to get rid of the warnings. This is also required to compile in the next step.
Navigate to the CrashReporter-iPhoneSimulator Target. Under the Build Settings: a) set "Perform Single-Object Prelink" to "No", b) set "Mach-O Type" to "Static Library".
Select CrashReport-iPhoneSimulator : [IOS simulation (ie iPhone 4.3 Simulator)] and click build.
Navigate to your build directory for the PLCrashReporter. For me, it was /Users/username/Library/Developer/Xcode/DerivedData/CrashReporter-(random characters)/Build/Products/Debug-iphonesimulator
Copy the libCrashReporter-iphonesimulator.a from the build directory in step 5 to the iphone application project directory you want to add the crash reporter to.
Open the your iphone application project in xcode.
Download the PLCrashReporter binary release and extract the framework to a local directory.
Add the CrashReporter framework to your project using this SO post.
Following the same procedure as step 9, add the libCrashReporter-iphonesimulator.a static library to the "Link Binary with Libraries" section of the build phases. No *.framework directory is needed when adding a static library.
Review the "Link Binary with Libraries" in the Target. Make sure the libCrashReporter-iphonesimulator.a is listed above the CrashReporter framework. You can drag and drop to reorder.
I hope this helps.
For anyone else looking for this information:
I followed the same steps given above however I was getting errors. I deleted the static library and only included the framework (which you can get from their dmg).
It worked perfectly for me. I think the process of creating static library by building the project was old (before they created a framework).
Thanks.
Don't forget to include
libstdc++.dylib
in "Link Binary With Libraries".

How to create a libJSON library?

I downloaded C++ libJSON from this link:
And they suggest me to use it as a library. How can I create library using the code they have provided?
you must have installed g++ and make in console/terminal just compile it type make, it will produce libjson.a which is static libary. When you create you C/C++ program you can link it with it g++ -l libjson.a
and in your code include libJSON.h header file.
#include "libJSON.h"
and you can use all functions from that header file.
On windows you must Install MinGW (GNU utilities for Windows), or IDE like DevC++ or Code::Blocks (Code::Blocks use MinGW). You can also use Cygwin unix like environment for windows (but when you compile file in cygwin you can run it only in Cygwin)
In Code::Blocks when you create project you can set additinal library which will be linked with your executable.
i was trying to compile libjson 7.6.1 for Visual Studio 2010. And was facing some difficulties in compiling it. What i did was
Download Libjson
open libjson.vcproj and goto line 240. You will find a missing ">". Type it in and save the file.
Now this can be used to build dynamic and static lib.
A simple thing wasted my couple of hours. Hope it saves some of yours.
This solution also works for more recent versions of Visual studio (e.g. 2015) which otherwise fail to complete the conversion to the mare recent project format.

How to build Qwt on Windows

Here's what I've done:
Downloaded qwt-4.2.0-setup-qt230nc.exe from sourceforge
Unpack to C:\Program Files\Qwt
Go to Qt Command Prompt
Run msvc-qmake.bat.
Get the output.
Now the lib directory is created, but it's empty. Also tried opening VS project file, but it doesn't converse to VS2008, because there are no vcproj files. I also tried to do it qmake way:
qmake qwt.pro and then make, but it says make is not recognized. I figured that I could use mingw32-make, but I gave me a lot of compiler errors.
I was hoping I would use Qwt within QtCreator, but sadly failed. Any help appreciated.
I think I've come up with easy solution:
Open QtCreator.
Open project... -> C:\Program Files\Qwt\qwt.pro
Build.
...
PROFIT!!!
Do I guess correctly it's valid way to do this?
Now I need to figure out how to marry it with QtDesigner since there is no Designer Plugin in here...
If you have Visual Studio you must to do next steps (according to file "INSTALL"):
run console
change directory to directory where you installed QWT
type "qmake qwt.pro"
type "nmake"
You must be ensured that nmake.exe and qmake.exe in your PATH environment variable.
P.S. Easy way to add nmake.exe (its Visual Studio's make realization) is to run "tools/visual studio 2008 command prompt" from main menu of visual studio.

Resources