Results 1 to 2 of 2

Thread: Qt Creator - error: call of overloaded 'QMatrix4x4(const qreal*&)' is ambiguous

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Qt Creator - error: call of overloaded 'QMatrix4x4(const qreal*&)' is ambiguous

    I have a project in Qt Creator in Windows,When compiled I got this Error, I Googled a few, But I couldn't find the solution :

    \application\src\helpers.cpp:99: error: call of overloaded 'QMatrix4x4(const qreal*&)' is ambiguous
    QMatrix4x4 matrix(a);
    ^

    the line that has error:

    QMatrix4x4 matrix(a);so what should I do?

    helpers.cpp corresponded to the error:

    #include <iostream>
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include "helpers.h"
    #include <QMatrix4x4>
    #include <QtGui>

    Helpers :: Helpers()
    {
    }

    Helpers :: ~Helpers()
    {
    }

    //====================================================================
    // Normalize
    //====================================================================

    void Helpers::normalize(qreal *a)
    {
    double b;

    b = vlen(a);
    a[0] /= b;
    a[1] /= b;
    a[2] /= b;
    }

    //====================================================================
    // Length
    //====================================================================

    qreal Helpers::vlen(qreal *a)
    {
    return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]);
    }

    //====================================================================
    // Cross product
    //====================================================================

    void Helpers::crossProduct(qreal *a, qreal *b, qreal *c)
    {
    c[0] = a[1]*b[2] - a[2]*b[1];
    c[1] = a[2]*b[0] - a[0]*b[2];
    c[2] = a[0]*b[1] - a[1]*b[0];
    }

    //====================================================================
    // Invert 4x4 matrix (for visualiztion only)
    //====================================================================
    //commented by John
    // pre start cooment
    void Helpers::invertMatrix(const qreal *a, qreal *inva)
    {

    QMatrix4x4 matrix(a);

    bool ok(true);

    QMatrix4x4 inverse(matrix.transposed().inverted(&ok));

    if(!ok) fprintf(stderr, "Error: Singular 4x4 matrix\n");

    for(int i = 0; i < 16; ++i)
    inva[i] = double(inverse.data()[i]);
    }
    //*/ pre end comment

    This is all errors that I see,after lots of debugging... I think the problem maybe about command syntax format or libraries definition and usage or something else...
    Last edited by hasanbaghal; 15th December 2017 at 07:59.

Similar Threads

  1. Replies: 4
    Last Post: 25th September 2010, 12:58
  2. Replies: 2
    Last Post: 7th July 2009, 17:44
  3. Replies: 1
    Last Post: 10th February 2009, 09:42
  4. virtual overloaded functions and base class function call...
    By nouknouk in forum General Programming
    Replies: 7
    Last Post: 11th March 2006, 21:26
  5. ambiguous call to overloaded function
    By :db:sStrong in forum Qt Programming
    Replies: 18
    Last Post: 10th February 2006, 09:36

Tags for this Thread

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.