0
votes

Downloadable address of full source code: http://cfile209.uf.daum.net/attach/267EAF4B5215CFDD0D951E

Hi. I am trying to create a console application which use a function coded in a lib file, which also call functions in a dll file. (console -> lib -> dll)

Dll file is QT Gui implementation. Lib file loads things from DLL using QLibrary.

Those lib and dll library are compiled on QT Creator via .pro file. (QT version is latest 5)

The Main console applications uses those two lib and dll is created on MSVS 2008.

Here I got an error when I compile it on MSVS 2008:

1>main.obj : error LNK2019: unresolved external symbol "int __cdecl CreateQt(int,char * * const)" (?CreateQt@@YAHHQAPAD@Z) referenced in function _main

I put lib and dll into Console application's folder, it seem like I get an linking error, any help?

Thank you

Here is my console application source code.

#include "main.h"

#pragma comment(lib,"./main.lib") //main.lib is library created on QT Creator

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

    CreateQt(argc,argv);

    return 0;
}
1

1 Answers

0
votes

Do you have

TEMPLATE = lib

In your lib's pro file?

In your console's pro file do you have something like

LIBS += -L../folder/path/to/libfile -lLibFileNameWithoutDotLib

It seems like you're not linking the lib file in your console app correctly. I assume that CreateQt is a function you have in your lib code.