Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Undefined reference error

Undefined reference error

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 514 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.
  • G Offline
    G Offline
    gabor53
    wrote on last edited by gabor53
    #1

    Hi,
    I have a simple program in which I am planning to add data to an SQLite db.
    main.qml:

    import Felgo 3.0
    import QtQuick 2.0
    import QtQuick.LocalStorage 2.0
    import QtQuick 2.5
    //import "ImgCode.js" as ICode
    
    App {
    
        NavigationStack {
    
            Page {
                title: qsTr("Using SQLite DB in QML")
    
                AppButton {
                    id: createTable
                    text: "Create Table"
                    onClicked: ICode.dbInit()
                }
    
    //            AppButton {
    //                id: insertToDb
    //                text: "Inserting Data"
    //                anchors.top: createTable.bottom
    
    //                onClicked: {
    //                    //                    var pID = "3"
    //                    var pImage = "This is the image. "
    
    //                    ICode.dbInsert(pImage)
    //                }
    //            }
            }
        }
    }
    
    

    ImgCode.js:

    //opening the db or creating it if not exists
    function dbInit() {
        var db = LocalStorage.openDatabaseSync("FolkFriends", "1.0",
                                               "The example image storage!",
                                               10000000)
    
        try {
            db.transaction(function (tx) {
                tx.executeSql(
                            'CREATE TABLE IF NOT EXISTS friends(id INTEGER PRIMARY KEY AUTOINCREMENT, img BLOB)')
    
                console.log("Table friends is created.")
            })
        } catch (err) {
            console.log("Error creating table in Folkfriends. " + err)
        }
    }
    
    //opening db
    function dbGetHandle() {
        try {
            var db = LocalStorage.openDatabaseSync("FolkFriends", "1.0",
                                                   "The example image storage!",
                                                   10000000)
        } catch (err) {
            console.log("Error opening FolkFriends db." + err)
        }
        return db
    }
    
    //Adding ID and image code64 to db
    //function dbInsert(pImage) {
    //    try {
    //        var db = dbGetHandle()
    //        var rowid = 0
    //        pImage = "imagegggggggg"
    //        db.transaction(function (tx) {
    //            tx.executeSql('INSERT INTO friends (img) VALUES ("oisvu i yid")')
    //            var result = tx.executeSql(
    //                        'SELECT * FROM friends WHERE ID = (SELECT MAX(ID) FROM friends)')
    //            //        console.log("pID: " + pID)
    //            console.log("pImage: " + pImage)
    
    //            rowid = result.insertedId
    //            console.log("The inserted ID is ", +rowid)
    //        })
    //    } catch (err) {
    //        console.log("Insert error: " + err)
    //    }
    //}
    
    

    When I run (or build it) I get the following error message:
    system.cpp:-1: error: undefined reference to _imp____acrt_iob_func' system.cpp:-1: error: undefined reference to _imp____acrt_iob_func'
    system.cpp:-1: error: undefined reference to _imp____acrt_iob_func' b2Settings.cpp:-1: error: undefined reference to _imp____acrt_iob_func'

    I have the same error message with even a brand new QML project so I believe it is something related to Qt.
    How can I fix this?
    Thank you for help.

    ODБOïO 1 Reply Last reply
    0
    • G gabor53

      Hi,
      I have a simple program in which I am planning to add data to an SQLite db.
      main.qml:

      import Felgo 3.0
      import QtQuick 2.0
      import QtQuick.LocalStorage 2.0
      import QtQuick 2.5
      //import "ImgCode.js" as ICode
      
      App {
      
          NavigationStack {
      
              Page {
                  title: qsTr("Using SQLite DB in QML")
      
                  AppButton {
                      id: createTable
                      text: "Create Table"
                      onClicked: ICode.dbInit()
                  }
      
      //            AppButton {
      //                id: insertToDb
      //                text: "Inserting Data"
      //                anchors.top: createTable.bottom
      
      //                onClicked: {
      //                    //                    var pID = "3"
      //                    var pImage = "This is the image. "
      
      //                    ICode.dbInsert(pImage)
      //                }
      //            }
              }
          }
      }
      
      

      ImgCode.js:

      //opening the db or creating it if not exists
      function dbInit() {
          var db = LocalStorage.openDatabaseSync("FolkFriends", "1.0",
                                                 "The example image storage!",
                                                 10000000)
      
          try {
              db.transaction(function (tx) {
                  tx.executeSql(
                              'CREATE TABLE IF NOT EXISTS friends(id INTEGER PRIMARY KEY AUTOINCREMENT, img BLOB)')
      
                  console.log("Table friends is created.")
              })
          } catch (err) {
              console.log("Error creating table in Folkfriends. " + err)
          }
      }
      
      //opening db
      function dbGetHandle() {
          try {
              var db = LocalStorage.openDatabaseSync("FolkFriends", "1.0",
                                                     "The example image storage!",
                                                     10000000)
          } catch (err) {
              console.log("Error opening FolkFriends db." + err)
          }
          return db
      }
      
      //Adding ID and image code64 to db
      //function dbInsert(pImage) {
      //    try {
      //        var db = dbGetHandle()
      //        var rowid = 0
      //        pImage = "imagegggggggg"
      //        db.transaction(function (tx) {
      //            tx.executeSql('INSERT INTO friends (img) VALUES ("oisvu i yid")')
      //            var result = tx.executeSql(
      //                        'SELECT * FROM friends WHERE ID = (SELECT MAX(ID) FROM friends)')
      //            //        console.log("pID: " + pID)
      //            console.log("pImage: " + pImage)
      
      //            rowid = result.insertedId
      //            console.log("The inserted ID is ", +rowid)
      //        })
      //    } catch (err) {
      //        console.log("Insert error: " + err)
      //    }
      //}
      
      

      When I run (or build it) I get the following error message:
      system.cpp:-1: error: undefined reference to _imp____acrt_iob_func' system.cpp:-1: error: undefined reference to _imp____acrt_iob_func'
      system.cpp:-1: error: undefined reference to _imp____acrt_iob_func' b2Settings.cpp:-1: error: undefined reference to _imp____acrt_iob_func'

      I have the same error message with even a brand new QML project so I believe it is something related to Qt.
      How can I fix this?
      Thank you for help.

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @gabor53 Hi,
      Your Felgo has no link with your Qt install,AFAIK
      Try uninstall/reinstall Felgo. Or send an email to Felgo suport, they will support even if you have free License

      1 Reply Last reply
      1

      • Login

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