Results 1 to 4 of 4

Thread: Creating MySQL and Oracle (OCI) plugins.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Location
    Lexington, KY
    Posts
    7
    Qt products
    Qt4 Qt Jambi
    Platforms
    Windows
    Thanks
    1

    Unhappy Re: Creating MySQL and Oracle (OCI) plugins.

    I think I have already done this.

    Starting from scratch just trying to build OCI.

    Qt Code:
    1. cd c:\Qt\4.6.2\sql\plugins\sqldrivers\oci
    2. qmake oci.pro
    To copy to clipboard, switch view to plain text mode 
    • Results in: "Cannot open include file: 'oci.h' ...." <---GOOD

    Qt Code:
    1. nmake distclean
    2. set include=%include%c:\Oracle\sdk\include;
    3. qmake oci.pro
    4. nmake
    To copy to clipboard, switch view to plain text mode 
    • Results in: "fatal error LNK1104: cannot open file 'oci.lib'......" <---GOOD

    Finally,
    Qt Code:
    1. nmake distclean
    2. set lib=%lib%c:\Oracle\sdk\lib\msvc;
    3. qmake oci.pro
    4. nmake
    To copy to clipboard, switch view to plain text mode 
    • ..\..\..\..\plugins\sqldrivers\qsqlocid4.dll : fatal error LNK1120: 29 unresolved externals
      NMAKE : fatal error U1077: '"c:\My Programs\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return c
      ode '0x460'
      Stop.
      NMAKE : fatal error U1077: '"c:\My Programs\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return
      code '0x2'
      Stop.



    I'm not sure what else I need to do. I have done everything in the documentation.
    I also added c:\Oracle to PATH and still get the 29 unresolved externals problem.

    I am using the Oracle Instant Client Basic (c:\Oracle) and Oracle Instant Client SDK (c:\Oracle\sdk)

    I believe if I can get this resolved then I will be able to fix MySQL as well. Similar issues for both.

    A foot in the right direction would be great.

    Thanks.
    -Blando

  2. #2
    Join Date
    May 2010
    Location
    Lexington, KY
    Posts
    7
    Qt products
    Qt4 Qt Jambi
    Platforms
    Windows
    Thanks
    1

    Wink Re: Creating MySQL and Oracle (OCI) plugins.

    Marvelous.

    SOLVED:

    My problem was that I wasn't using the correct version and/or I had a version mismatch.

    I deleted my entire c:\Oracle and started fresh.

    I followed The Oracle God, Mark Williams, tutorial here.

    I did exactly what he stated, using the older version 11.1.0.6.0
    • Download Oracle Instant Client BASIC x32 11.1.0.6.0

    • Download Oracle Instant Client SDK x32 11.1.0.6.0

    • Download Oracle C++ Call Interface Visual C++ 9 (VS 2008) x32


    I built his sample code to make sure everything was right. Once I was able to build successfully then I went to Qt.


    Visual Studio Command Line
    cd c:\Qt\4.6.2\src\plugins\sqldrivers\oci
    set include=%include%c:\Oracle\sdk\include;
    set lib=%lib%c:\Oracle\sdk\lib\msvc\vc9;
    set path=%path%c:\Oracle\vc9; <--directory you will create from Mark Williams instructions posted above.
    set path=%path%c:\Oracle;
    qmake oci.pro
    nmake
    Error Free!!

    Created sample Qt app to test.
    Qt Code:
    1. #include "oci_test_app.h"
    2. #include <QtGui/QApplication>
    3. #include <QSqlDatabase>
    4. #include <QSqlError>
    5. #include <QMessageBox>
    6.  
    7. bool createConnection()
    8. {
    9. QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");
    10. db.setHostName("test");
    11. db.setDatabaseName("test");
    12. db.setUserName("test");
    13. db.setPassword("test");
    14. if(!db.open())
    15. {
    16. QMessageBox::critical(0, QObject::tr("Database Error"), db.lastError().text());
    17. return false;
    18. }
    19.  
    20. }
    21. int main(int argc, char *argv[])
    22. {
    23. QApplication a(argc, argv);
    24. if(!createConnection())
    25. return 1;
    26. OCI_TEST_APP w;
    27. w.show();
    28. return a.exec();
    29. }
    To copy to clipboard, switch view to plain text mode 
    No errors on build. Error free compilation.
    Got the Oracle Error Message on run. <-- GOOD
    Now we are set to go.

    -Blando

Similar Threads

  1. problem creating a mysql database
    By TonyB in forum Qt Programming
    Replies: 10
    Last Post: 23rd July 2010, 16:39
  2. Replies: 5
    Last Post: 25th September 2009, 15:03
  3. Issues creating MySql Plugin on Windows
    By NicholasSmith in forum Installation and Deployment
    Replies: 2
    Last Post: 29th April 2009, 10:04
  4. Problem with nmake and mysql plugins
    By raken in forum Installation and Deployment
    Replies: 1
    Last Post: 7th July 2007, 09:20
  5. Need to compile with MySQL drivers/plugins
    By mongenix in forum Newbie
    Replies: 5
    Last Post: 6th January 2007, 21:24

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
  •  
Qt is a trademark of The Qt Company.