Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Undefined reference error



  • 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.



  • @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


Log in to reply