Results 1 to 3 of 3

Thread: Undefined reference

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    Netherlands
    Posts
    54
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Undefined reference

    Thanks, that problem is now fixed, but i still can't seem to load my plugin.

    K Fixed the problem that was stated below. Forgot the Q_EXPORT_PLUGIN2 line.


    When i try to load the plugin i get the error:
    Qt Code:
    1. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll' is not a valid Qt plugin."
    To copy to clipboard, switch view to plain text mode 

    I load the plugins with the following code:
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6.  
    7. QDir pluginsDir(qApp->applicationDirPath());
    8.  
    9. qDebug() << pluginsDir;
    10. foreach (QString filename, pluginsDir.entryList(QDir::Files))
    11. {
    12. qDebug() << filename;
    13. qDebug() << pluginsDir.absoluteFilePath(filename);
    14. QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(filename));
    15. QObject *plugin = pluginLoader.instance();
    16. qDebug() << pluginLoader.errorString();
    17. if (plugin) {
    18. qDebug() << "2";
    19. scrapperInterface = qobject_cast<ScrapperInterface *>(plugin);
    20. if(scrapperInterface)
    21. {
    22. qDebug() << "3";
    23. }
    24. }
    25. }
    26. }
    To copy to clipboard, switch view to plain text mode 

    which gives the following output:
    Qt Code:
    1. QDir( "G:/projects/DuneInterface-build-desktop/movieWall/debug" , nameFilters = { * }, QDir::SortFlags( Name | IgnoreCase ) , QDir::Filters( Dirs|Files|Drives|AllEntries ) )
    2. "main.o"
    3. "G:/projects/DuneInterface-build-desktop/movieWall/debug/main.o"
    4. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/main.o' is not a valid Qt plugin."
    5. "mainwindow.o"
    6. "G:/projects/DuneInterface-build-desktop/movieWall/debug/mainwindow.o"
    7. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/mainwindow.o' is not a valid Qt plugin."
    8. "moc_mainwindow.cpp"
    9. "G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.cpp"
    10. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.cpp' is not a valid Qt plugin."
    11. "moc_mainwindow.o"
    12. "G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.o"
    13. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/moc_mainwindow.o' is not a valid Qt plugin."
    14. "movieWall.exe"
    15. "G:/projects/DuneInterface-build-desktop/movieWall/debug/movieWall.exe"
    16. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/movieWall.exe' is not a valid Qt plugin."
    17. "scrapperplugind.dll"
    18. "G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll"
    19. "The file 'G:/projects/DuneInterface-build-desktop/movieWall/debug/scrapperplugind.dll' is not a valid Qt plugin."
    20. G:\projects\DuneInterface-build-desktop\movieWall\debug\movieWall.exe exited with code 0
    To copy to clipboard, switch view to plain text mode 

    Here scrapperplugind.dll is the plugin i wish to load.

    I was looking the code while debugging and think i found why it doesn't work.

    In the isPlugin function Qt loads the settings from the library and should load with which version of Qt it is build. But it doesn't find that information and i don't know why.
    Last edited by eekhoorn12; 6th January 2011 at 18:18.

Similar Threads

  1. undefined reference
    By digidas in forum Newbie
    Replies: 9
    Last Post: 19th May 2010, 13:04
  2. undefined reference
    By jayreddy in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2009, 13:45
  3. Undefined reference to crt
    By derektaprell in forum Installation and Deployment
    Replies: 0
    Last Post: 20th October 2009, 08:34
  4. Undefined Reference To...
    By ManuMies in forum Qt Programming
    Replies: 6
    Last Post: 10th February 2009, 12:14
  5. Undefined reference
    By Salazaar in forum Newbie
    Replies: 12
    Last Post: 23rd May 2007, 10:21

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.