Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. <SOLVED>error in basic C++ program
QtWS25 Last Chance

<SOLVED>error in basic C++ program

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TechnologistT Offline
    TechnologistT Offline
    Technologist
    wrote on last edited by Technologist
    #1

    Am programming in C++ and made a skeleton program to play around with. Just experimenting a bit.

    Wizard: Application--> Qt console app

     .pro
    
    QT       += core
    
    QT       -= gui
    
    QT       += widgets
    
    TARGET = Hello_World_console
    CONFIG   += console
    CONFIG   -= app_bundle
    
    TEMPLATE = app
    
    SOURCES += main.cpp
    

    main.cpp

    #include <QCoreApplication>
    #include <iostream>
    using namespace std;
    
    int main ()
    {
        int num1,num2;
       
        return 0;
    }
    

    Get this error:
    :-1: error: C:/Qt/Tools/mingw491_32/bin/../libexec/gcc/i686-w64-mingw32/4.9.1/liblto_plugin-0.dll: error loading plugin: "C:\Qt\Tools\mingw491_32\bin..\libexec\gcc\i686-w64-mingw32\4.9.1\liblto_plugin-0.dll":

    Any thoughts?

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Not really a straightforward answer but few things to notice:

      QT -= gui
      QT += widgets
      This makes little sense. If you want a console app don't add widgets.

      "C:\Qt\Tools\mingw491_32\bin..\libexec\gcc\i686-w64-mingw32\4.9.1\liblto_plugin-0.dll"
      There's a missing \ after bin. Is that the output you're getting or is it an output -> forum transfer mistake?

      The internet wisdom suggest two problems with the lto plugin in MinGW: one - it doesn't like spaces in paths. Does your project live in such location? A longshot but there's also a bug report on packaging of some versions of MinGW where they would add a 64bit plugin to a 32 bit compiler. Can you share some bittness info of your build and OS? In any case a workaround is to remove the -flto from the compiler command line so you might try that.

      1 Reply Last reply
      0
      • TechnologistT Offline
        TechnologistT Offline
        Technologist
        wrote on last edited by Technologist
        #3
        "C:\Qt\Tools\mingw491_32\bin..\libexec\gcc\i686-w64-mingw32\4.9.1\liblto_plugin-0.dll"
        

        \bin..\ - this goes down the tree terminating in the bin folder; then goes back up a directory and finds libexec then back down to liblto_plugin-0.dll which is there. You probably already see that - just thought I would verify.

        This is a copy and paste -- no transfer error. OS Win 8.1 current on updates, 32gb ram, 64 bit sys. If you suggest that I do the workaround might need a few instructions. Also, I am not aware of any whitespaces. Fresh install of QT and Qt Creator. Could reinstall and see if the problem goes away (sorry abt the magical thinking). Interestingly when I install it never makes a shortcut for me.

        Oddly the first few times I ran this it would work. I don't know what's changed since.
        Would a direct include path to the location be helpful?

        1 Reply Last reply
        0
        • TechnologistT Offline
          TechnologistT Offline
          Technologist
          wrote on last edited by
          #4

          Ok, works fine now. The only thing I am aware of doing is installing Eclipse and updating Java. Have no idea.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved