Some beginners MUI programming questions
  • Just looking around
    Bastiaan
    Posts: 18 from 2014/8/7
    From: Amsterdam, The...
    Hi,

    As i didn't want to flood the forum with multiple threads, i started this thread. Maybe i have some more similar noob question in the future But for now i'm stuck on this:

    I started working on a MUI application in C++ Except i thought i was working in C++, but i found out that in the make file GCC was defined as compiler so i was in C mode. So i switched to G++. After that i got some small compiler warnings which i solved already. But there is one warning which is more difficult:

    main.cpp:144: implicit declaration of function `int set(...)'

    I found this topic on stackoverflow:

    http://www.amiga.org/forums/archive/index.php/t-41334.html

    This guy has the same issue, but didnt come up with the solution. As said in the topic it looks like, MUI's set method conflicts with C++ set method. Does anybody know how to solve this conflict?

    Thanks.

    [ Edited by Bastiaan 18.04.2015 - 20:51 ]
  • »18.04.15 - 20:47
    Profile Visit Website
  • Just looking around
    Bastiaan
    Posts: 18 from 2014/8/7
    From: Amsterdam, The...
    Already got the answer from Geit, will post the solution here for future reference when i got it to work.

    Edit:
    So it worked. The solution was fairly simple..you have to undefine "set" right after loading the mui header file:

    #include <libraries/mui.h>
    #undef set

    Then use SetAttr instead of Set, so for example:

    Set(MUIA_Window_Open,FALSE)

    Becomes:

    SetAttrs(window,MUIA_Window_Open,FALSE,TAG_DONE);




    [ Edited by Bastiaan 18.04.2015 - 21:13 ]
  • »18.04.15 - 20:59
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    If you ensure

    __cplusplus

    is defined, than all problems should be gone automatically without any nasty undefines.
  • »18.04.15 - 21:52
    Profile