Results 1 to 8 of 8

Thread: Got some not-understandable error while compiling library

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Got some not-understandable error while compiling library

    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

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Got some not-understandable error while compiling library

    Seems related to ActiveQt controls but we don't have any useful information to go on. What does your pro file look like?

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Got some not-understandable error while compiling library

    Quote Originally Posted by ChrisW67 View Post
    What does your pro file look like?
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2011-08-11T20:59:25
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui network
    8.  
    9. TARGET = SMTPEmail
    10. TEMPLATE = app
    11.  
    12.  
    13. SOURCES += \
    14. src/emailaddress.cpp \
    15. src/mimeattachment.cpp \
    16. src/mimefile.cpp \
    17. src/mimehtml.cpp \
    18. src/mimeinlinefile.cpp \
    19. src/mimemessage.cpp \
    20. src/mimepart.cpp \
    21. src/mimetext.cpp \
    22. src/smtpclient.cpp \
    23. src/quotedprintable.cpp
    24.  
    25. HEADERS += \
    26. src/emailaddress.h \
    27. src/mimeattachment.h \
    28. src/mimefile.h \
    29. src/mimehtml.h \
    30. src/mimeinlinefile.h \
    31. src/mimemessage.h \
    32. src/mimepart.h \
    33. src/mimetext.h \
    34. src/smtpclient.h \
    35. src/SmtpMime \
    36. src/quotedprintable.h
    37.  
    38. OTHER_FILES += \
    39. LICENSE \
    40. README.md
    41.  
    42. FORMS +=
    To copy to clipboard, switch view to plain text mode 

    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.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Got some not-understandable error while compiling library

    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?

  5. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Got some not-understandable error while compiling library

    Quote Originally Posted by d_stranz View Post
    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
    Last edited by Momergil; 20th December 2012 at 21:18.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Got some not-understandable error while compiling library

    Change TEMPLATE=app to TEMPLATE=lib in the .pro file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Got some not-understandable error while compiling library

    <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.

  8. #8
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Got some not-understandable error while compiling library

    Quote Originally Posted by wysota View Post
    Change TEMPLATE=app to TEMPLATE=lib in the .pro file.
    Yep, now it works fine!

    Thanks guys,

    Momergil

Similar Threads

  1. Qt application Compiling with ATL library Plroblem
    By a.srikant.reddy in forum Newbie
    Replies: 4
    Last Post: 1st September 2011, 21:56
  2. Replies: 3
    Last Post: 29th March 2010, 14:41
  3. Compiling QCA as static library
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 7th December 2008, 18:32
  4. Replies: 1
    Last Post: 25th October 2008, 20:18
  5. Having problems compiling QtXmlPatternsd library
    By zorro68 in forum Installation and Deployment
    Replies: 2
    Last Post: 26th May 2008, 07:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.