PDA

View Full Version : Got some not-understandable error while compiling library



Momergil
20th December 2012, 03:31
Hello!

i'm trying to cimplie a library that creates and send e-mails and I got some errors while building it:


c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib/libqtmaind.a(qtmain_win.o): In function `WinMain@16':
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:131: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [debug\SMTPEmail.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
01:26:10: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project SMTPEmail (target: Desktop)
When executing build step 'Make'

I have no clue about what does it mean. Could somebody help please?

Thanks,

Momergil

ChrisW67
20th December 2012, 04:46
Seems related to ActiveQt controls but we don't have any useful information to go on. What does your pro file look like?

Momergil
20th December 2012, 13:19
What does your pro file look like?



#-------------------------------------------------
#
# Project created by QtCreator 2011-08-11T20:59:25
#
#-------------------------------------------------

QT += core gui network

TARGET = SMTPEmail
TEMPLATE = app


SOURCES += \
src/emailaddress.cpp \
src/mimeattachment.cpp \
src/mimefile.cpp \
src/mimehtml.cpp \
src/mimeinlinefile.cpp \
src/mimemessage.cpp \
src/mimepart.cpp \
src/mimetext.cpp \
src/smtpclient.cpp \
src/quotedprintable.cpp

HEADERS += \
src/emailaddress.h \
src/mimeattachment.h \
src/mimefile.h \
src/mimehtml.h \
src/mimeinlinefile.h \
src/mimemessage.h \
src/mimepart.h \
src/mimetext.h \
src/smtpclient.h \
src/SmtpMime \
src/quotedprintable.h

OTHER_FILES += \
LICENSE \
README.md

FORMS +=


Looking on the web I found some comentaries about a possible incompatibility problem given the project is a little bit old, but as far as I know it should work with Qt4 which is what I have.

d_stranz
20th December 2012, 15:56
I don't see a main.cpp file listed in your source files. Is that included by default, or is the linker complaining because it hasn't found the entry point in your app code?

Momergil
20th December 2012, 20:02
I don't see a main.cpp file listed in your source files. Is that included by default, or is the linker complaining because it hasn't found the entry point in your app code?

Yeah, I noticed that and your question is the same as a point somebody made in another case where I found a similiar question to mine (as I mentioned in my previous post). So no, there is no main.cpp file either in the project or else on its folders, but that is by default (it was dowloaded so).

To make things easier, here is the link to the library:

https://github.com/bluetiger9/SmtpClient-for-Qt

wysota
20th December 2012, 21:06
Change TEMPLATE=app to TEMPLATE=lib in the .pro file.

d_stranz
21st December 2012, 00:01
<headslap>Whack!</headslap>

Didn't notice from the original post that it mentioned building a library. That's why there's no main.cpp, and why the link fails, as wysota said.

Momergil
21st December 2012, 03:47
Change TEMPLATE=app to TEMPLATE=lib in the .pro file.

Yep, now it works fine! :)

Thanks guys,

Momergil