Menu

Trouble compiling dream-mjf r1412

2024-06-17
2024-06-18
  • Steven Sostrom

    Steven Sostrom - 2024-06-17

    I tried to compile dream-mjf r1412 on my Raspberry Pi and it failed.
    I have Hamlib 4.5.5 installed.
    Is Hamlib 4.6 required for this version? If so, can it be made to also work on the current stable release?

    These are probably the messages we need to see.

    src/util/Hamlib.cpp: In constructor CHamlib::CHamlib():
    src/util/Hamlib.cpp:125:25: error: invalid conversion from int (*)(rig_caps*, void*) to int (*)(const rig_caps*, void*) [-fpermissive]
      125 |         rig_list_foreach(PrintHamlibModelList, this);
          |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                         |
          |                         int (*)(rig_caps*, void*)
    In file included from src/util/Hamlib.h:35,
                     from src/util/Hamlib.cpp:28:
    

    and at the end of the messages

    make: *** [Makefile:3414: obj/Hamlib.o] Error 1
    make: *** Waiting for unfinished jobs....
    src/sourcedecoders/fdk_aac_codec.cpp:223:13: warning: void logNumbers(const CStreamInfo&) defined but not used [-Wunused-function]
      223 | static void logNumbers(const CStreamInfo& info) {
          |             ^~~~~~~~~~
    
     
  • Mark J. Fine

    Mark J. Fine - 2024-06-17

    Read my comments in the Compiling section.

     
  • Steven Sostrom

    Steven Sostrom - 2024-06-17

    I don't see 'const' in the line where where PrintHamlibModelList is defined.
    I may not understand what you were saying.

    In Hamlib.cpp I see

    int
    CHamlib::PrintHamlibModelList(struct rig_caps *caps, void *data)
    

    In Hamlib.h I see

    static int          PrintHamlibModelList(struct rig_caps* caps, void* data);
    
     
  • Steven Sostrom

    Steven Sostrom - 2024-06-17

    Since I have Hamlib 4.5.5, I restored the 'const' where PrintHamlibModelList is defined.

    It compiled and receives stations.

    I hope it is possible to do something to make this work with both Hamlib 4.5 and Hamlib 4.6.

     
    • Mark J. Fine

      Mark J. Fine - 2024-06-18

      I hope it's possible for Hamlib to stop messing around with silly interface changes involving 'const' that break things here as well as in other apps...

      But my point was this was a compilation issue and should have been in the compilation section here, not general. You also would have found the answer quicker.

       
    • jcoles

      jcoles - 2024-06-18

      Since I have Hamlib 4.5.5, I restored the 'const' where PrintHamlibModelList is defined.

      Let's be more specific. Code is precise. People would need to know exact changes to specific lines in specific files. I have worked out the following required changes:

      change src/util/Hamlib.cpp line 344

      CHamlib::PrintHamlibModelList(struct rig_caps *caps, void *data)
      

      to

      CHamlib::PrintHamlibModelList(const struct rig_caps *caps, void *data)
      

      change src/util/Hamlib.h line 116

      static int          PrintHamlibModelList(struct rig_caps* caps, void* data);
      

      to

      static int          PrintHamlibModelList(const struct rig_caps* caps, void* data);
      
       

      Last edit: jcoles 2024-06-18

Log in to post a comment.