[Qt-interest] (vista, visual studio 2010) can't compile a simple project

lolveley lolveley at yahoo.fr
Tue Jun 2 15:03:31 CEST 2009


hello,

I'm trying visual studio 2010 (but my problem don(t depend specifically 
to this version of visual studio I presume), with Qt : I compiled debug 
libraries (was it well done? I'm not sure), with the mysql plugin option.
all seems to be good : I managed to create a empty project under visual 
studio, I added to its property page the links to the lib, include, and 
bin paths of Qt.
the completion run fine, but when I try to compile the project I have an 
error :

here is my sample project:
**************************************************************
#include <QtGui/QApplication>
#include <QtGui/QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QPushButton bouton("Quitter");
    bouton.show();

    QObject::connect(&bouton, SIGNAL(clicked()), &app, SLOT(quit()));

    return app.exec();
}

**************************************************************



and here is the error:
***************************************************************
1>------ Build started: Project: test_cpp_1, Configuration: Debug Win32 
------
1>Build started 02/06/2009 14:48:36.
1>IsProjectFileNewer:
1>Skipping target "IsProjectFileNewer" because all output files are 
up-to-date with respect to the input files.
1>_PrepareForBuild:
1>  Touching "Debug\lastbuild.timestamp".
1>ClCompile:
1>  Skipping task because its outputs are up-to-date.
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: virtual __thiscall 
QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE at XZ) 
referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: virtual __thiscall 
QPushButton::~QPushButton(void)" (__imp_??1QPushButton@@UAE at XZ) 
referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: static int __cdecl 
QApplication::exec(void)" (__imp_?exec at QApplication@@SAHXZ) referenced 
in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: static bool __cdecl 
QObject::connect(class QObject const *,char const *,class QObject const 
*,char const *,enum Qt::ConnectionType)" 
(__imp_?connect at QObject@@SA_NPBV1 at PBD01W4ConnectionType@Qt@@@Z) 
referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) char const * __cdecl qFlagLocation(char const *)" 
(__imp_?qFlagLocation@@YAPBDPBD at Z) referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: void __thiscall QWidget::show(void)" 
(__imp_?show at QWidget@@QAEXXZ) referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: __thiscall QString::~QString(void)" 
(__imp_??1QString@@QAE at XZ) referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: __thiscall QPushButton::QPushButton(class 
QString const &,class QWidget *)" 
(__imp_??0QPushButton@@QAE at ABVQString@@PAVQWidget@@@Z) referenced in 
function _main
1>FileTracker : warning : Attempt to load UI satellite dll from 
C:\Windows\Microsoft.NET\Framework\v4.0.20506\1036\FileTrackerUI.dll failed.
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: __thiscall QString::QString(char const 
*)" (__imp_??0QString@@QAE at PBD@Z) referenced in function _main
1>fichier_test.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: __thiscall QApplication::QApplication(int 
&,char * *,int)" (__imp_??0QApplication@@QAE at AAHPAPADH@Z) referenced in 
function _main
1>C:\Users\lolveley\Documents\Visual Studio 
10\Projects\test_cpp_1\Debug\test_cpp_1.exe : fatal error LNK1120: 10 
unresolved externals
1>FileTracker : warning : Attempt to load UI satellite dll from 
C:\Windows\Microsoft.NET\Framework\v4.0.20506\1036\TrackerUI.dll failed.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.11
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

***************************************************************

can you help me?

olivier.



	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com




More information about the Qt-interest-old mailing list