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. Manually built OCI plugin for Win7-64 crashes

Manually built OCI plugin for Win7-64 crashes

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 4.6k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    Please enclose your code in coding tags so it's readable.

    Now to your problem, you have an access violation, so is it the only code you have in your software ?

    What happens if you run it through a debugger ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soniamitruka
      wrote on last edited by
      #3

      thanks for warm welcome..

      Here is the code:-

      @QSqlDatabase cldb_database = QSqlDatabase::addDatabase(“QOCI”); cldb_database.setHostName(“localhost”);
      cldb_database.setDatabaseName(“orcl”);
      cldb_database.setUserName(“scott”);
      cldb_database.setPassword(“xyz”);
      if(!cldb_database.open()) qDebug()<<“Could not open Database Connection “;
      else qDebug()<<“database opened”;@

      yes, it is the only code in my software..

      i am debugging it using x86_64-w64-mingw32-gdb-7.1.90.20100730 debugger.

      dubugger is throwing SIGSEGV in function

      @QOCIDriver::QOCIDriver(QObject* parent): QSqlDriver(parent)@

      of qsql_oci.cpp while making following call :

      @int r = OCIEnvCreate(&d->env,
      mode,
      NULL,
      NULL,
      NULL,
      NULL,
      0,
      NULL);@

      Thanks in advance..

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Ok, in that case, what does QSqlDatabase::drivers() return ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          soniamitruka
          wrote on last edited by
          #5

          QSqlDatabase::drivers() returns

          "QSQLITE", "QODBC3", "QODBC", "QOCI8", "QOCI"

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            That's strange, but wait, why do you use such an old version of Qt ? Since you are on the 4 series why not use the 4.8.4 version ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MadMax411
              wrote on last edited by
              #7

              Is a TNSPING to your database successful? (shell command: tnsping orcl)

              And don't set the hostname for Oracle-DBs. You have to configure the database connections in the file "tnsnames.ora"

              1 Reply Last reply
              0
              • S Offline
                S Offline
                soniamitruka
                wrote on last edited by
                #8

                I found following on Mingw bug tracker and i am facing exactly the same problem:

                "I wrote qt application that uses qsqloci driver to connect to Oracle. Plugin is built agains 11gR2 OCI. 32bit plugin works fine, but 64bit crashes on OCIEnvCreate function. The same plugin (and qt, and my app) compiled with Visual Studio works fine. Attaching backtrace. Note: Oracle OCI supplied with Oracle 11gR2 client is built with Visual Studio."

                solution provided by Sezero is

                " attempting to use x64 versions of VC libraries isn't supported and is well known to cause runtime crashes. Solution is generating .def files from the corresponding dlls using gendef and then making lib*.dll.a import libraries out of them using dlltool."

                I have not checked the plugin with VS and I am not able to understand which dll Sezero is talking about.

                plz help....

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  soniamitruka
                  wrote on last edited by
                  #9

                  [quote author="MadMax411" date="1367937167"]Is a TNSPING to your database successful? (shell command: tnsping orcl)

                  And don't set the hostname for Oracle-DBs. You have to configure the database connections in the file "tnsnames.ora"[/quote]

                  yes ,tnsping orcl is successful....

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    soniamitruka
                    wrote on last edited by
                    #10

                    @all :

                    the problem is solved now...

                    solution can be found "here":http://sourceforge.net/tracker/index.php?func=detail&aid=3466815&group_id=202880&atid=983354

                    Thanks every1 :)

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      Great !

                      Please update the thread's title to solved so other forum users may know that a solution has been found :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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