Results 1 to 5 of 5

Thread: I'm going crazy, pointer problem .??

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default I'm going crazy, pointer problem .??

    I have a * object created as new();
    ascii_file * G_w_ascii_out = new ascii_file;

    I have a function that receive a pointer to this ascii_file :
    My call;
    w_comm_parent->w_export(G_w_ascii_out);

    I have the error :

    error: no matching function for call to 'W_comm::w_export(W_inpout::W_ascii*& )'
    candidate is: void W_comm::w_export(W_inpout::W_ascii* )

    I don't understand whats happen. I have an identical call at other place, and that compiles right .

    Aaaaahhhh!

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: I'm going crazy, pointer problem .??

    Without showing the definition of type ascii_file nobody can understand either, but it seems to be a referencr to W_ascii, whatever that is.

  3. #3
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: I'm going crazy, pointer problem .??

    Exactly, I have even a gut feeling that there is more parameters for "w_export" and the pointer is not a problem at all...

  4. #4
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I'm going crazy, pointer problem .??

    Can be the problem related to the next :
    The class A create an instance of classB, doing forwarding
    After I have inside ClassA the next function
    Qt Code:
    1. my_classB->write(string file_out, this); ( the my_classB declare is : my_classB(string a_file,ClassA *class_a_parent )
    To copy to clipboard, switch view to plain text mode 
    ( ClassA *class_a_parent is also using forwarding )

    ( Both clasess use forwarding to each other )

    And inside write method I have
    Qt Code:
    1. W_ascii * ascii = new W_ascii;
    2. class_a_parent->a_method_of_class_A(ascii)
    To copy to clipboard, switch view to plain text mode 

    Ok, I think class_a_parent->a_method_of_class_A is the guilty of pass W_inpout::W_ascii*& insteadof W_inpout::W_ascii*
    It happens with every object I create and want pass to the function, I have the same error *& expected *, &int, expected int ....
    (somebody appends & ....)
    What do you think ?
    Last edited by tonnot; 29th June 2011 at 11:45.

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: I'm going crazy, pointer problem .??

    I think there is not enough info to help you. I will repeat what is already posted in this thread - show the actual code, with related types and methods definitions.

Similar Threads

  1. Qt Designer QtDesigner Gone Crazy!
    By qtoptus in forum Qt Tools
    Replies: 6
    Last Post: 26th January 2011, 02:17
  2. Crazy QPlainTextEdit::document() behavior
    By Lykurg in forum Qt Programming
    Replies: 8
    Last Post: 11th March 2010, 22:36
  3. a crazy problem~~~who can help me : (
    By sunking_426 in forum Qt Programming
    Replies: 4
    Last Post: 2nd January 2009, 14:35
  4. Crazy over the QGraphicsScene/Item
    By Morea in forum Qt Programming
    Replies: 6
    Last Post: 20th November 2006, 09:18

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.