Qt issue for Visual Studio 2010

I spent the weekend trying to figure it out, and I'm in the last step. My goal: get visual studio 2010 and Qt 4.7.3 to work together.

I installed Qt from the source, specifying the following configuration for the assembly:

configure.exe -debug-and-release -opensource -platform win32-msvc2010 -no-webkit -no-phonon -no-phonon-backend -no- script -no-scripttools -no-qt3support -no- multimedia -no-ltcg

After setup, I started nmake, no problem.

In my visual studio 2010 solution, I have two projects. Image He complains that he cannot link the Qt libraries. In general properties

AssetIO Qt IDE, Qt visual studio . AssetIO . Short : Linkererrrors "", . AssetIO . , V++ Directories, Include:

Include directories , : Library directories , , include AssetIO: C:\qt_source\4.7.3\

AssetIO: C:\qt_source\4.7.3\Bin

, ( )

main.cpp
int main(int argc, char* argv[])
{
    AssetIO::LevelLoader a;
    a.dostuff();

    return 0;
}

LevelLoader.h

#ifndef LEVELLOADER_HPP
#define LEVELLOADER_HPP

namespace AssetIO
{
    class LevelLoader {
    public:
        explicit LevelLoader();
        ~LevelLoader();

        void dostuff();
    };
}

#endif // LEVELLOADER_HPP

LevelLoader.cpp

#include "LevelLoader.hpp"
#include <QDomDocument>
#include <QFile>
#include <QDebug>
#include <QString>

using namespace AssetIO;

enum ComponentType { Drawable = 0, Position };

// This will definitely be changed, to return a full-blown component. Passing the tagname directly to the
// component factory.
ComponentType ConvertToComponentType(QString tagName)
{
if(tagName.toLower() == "Drawable") {
    return Drawable;
}
else if(tagName.toLower() == "Position") {
    return Position;
}
else {
    // LOG
    exit(EXIT_FAILURE);
}
}

LevelLoader::LevelLoader()
{
}

LevelLoader::~LevelLoader()
{
}

void LevelLoader::dostuff()
{
QDomDocument doc("la");
QFile file("../../../Resources/input.sto");

if(!file.open(QIODevice::ReadOnly)) {
    // TODO: log this, something
    exit(EXIT_FAILURE);
}

if( !doc.setContent(&file)) {
    // TODO: log
    file.close();
}
// we close the file now the doc has control (i think)
file.close();

// Read the root element
QDomElement root = doc.documentElement();
if(root.tagName() != "Root") {
    // TODO: log
    exit(EXIT_FAILURE);
}

// Read the Header Info
QDomNode headerNode = root.firstChild();

QDomElement e = headerNode.toElement();
if(e.tagName().toLower() != "HeaderInfo") {
    // LOG
}

QDomNodeList componentNode = headerNode.childNodes();
int s = componentNode.count();

QString componentTag(componentNode.at(0).toElement().tagName());
QDomNamedNodeMap a = componentNode.at(0).attributes();
}

, . - ? .

+5
3

Qt lib VS ? , , QtCored4.lib, QtGuid4.lib(d "debug", config ) , , . , , .exe- - Properties- > Linker- > Command Line {Qored4.lib QtGuid4.lib} .

. S. : -, Qt Creator . qmake -tp vc -r - VS . , , .

+5

, C:\qt_source\4.7.3\lib, .

QtCored4.lib QtGuid4.lib Qt

. "Release version"

QtCore4.lib QtGui4.lib Qt

+4

u Qt class QDomDocument. "QtXml4.lib". Visual Studio, .. Project->properties->Linker->Input====> Additional Dependencies.

+1

All Articles