ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Warning when creating a program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warning when creating a program

    Welcome all! I have a stink problem, if you can call it that, when using the CRTPGM command. Here's the thing. I created the simplest C ++ application (the classic "Hello world!"), Consisting of one module and using only one iostream header file. Module creation was successful and was not accompanied by warnings. Further, using the CRTPGM command, I created a program from this single module. The program was created, but in the task log I saw the following warning:

    Message ID . . . . . . : CPD5D1E Severity . . . . . . . : 10
    Message type . . . . . : Diagnostic
    Date sent . . . . . . : 16/06/20 Time sent . . . . . . : 09:44:19

    Message . . . . : Definition collision has occurred.

    Cause . . . . . : Definition "__dftbdt__Q2_3std10ctype_baseFv" from *MODULE
    object POLIGON in library CSNTST was used instead of the later definition
    from *SRVPGM object QYPPSL510 in library QSYS. The later definition is more
    fitting, but it came from an object referred to by a binding directory and
    cannot override the first definition found which came from an object
    specifically specified on the command line.

    Recovery . . . : If the later definition is the preferred one, try the
    Create Program (CRTPGM) or Create Service Program (CRTSRVPGM) command again
    and specify *SRVPGM object QYPPSL510 in library QSYS on the command line. If
    the definition found first is the preferred one, then rename it to avoid the
    collision. If no action is taken, the later definition is skipped and a
    program or service program may still be created. In this case, the program
    or service program may be unreliable.
    The initial warning states that "if a second definition is preferable, invoke the CRTPGM command, specifying the QYPPSL510 object directly on the command line." But how can I know which of the definitions is preferable? After all, both definitions are in the system library and the service program (that is, I did not write any of the definitions). How to understand what to use here?

    My module code is as follows:
    Code:
    #include <iostream>
    
    int main() {
      std::cout << "Hello world" << std::endl;
    }

  • #2
    I tried your 'Hello world' code and it worked fine for me. I did not receive any warnings. I tried both using CRTCPPMOD/CRTPGM and CRTBNDCPP, both worked without problems.

    You appear to have a module named CSNTST/POLIGON that has an export that is the same as an export in the standard C++ class library (QYPPSL510). I don't know what CSNTST/POLIGON is, I do not have this on my system. Is it possible that someone else in your shop created this and added it to your standard binding directory so that it would always be bound?

    Comment


    • #3
      Scott, thank you for the answer. CSNTST is the name of my library where the source code file with the POLIGON member is located. This member is the code that is given in the first post. After executing the CRTCPPMOD command, the POLIGON module is placed in the CSNTST library. Then a program is created from this module.
      Let me show you in the pictures the sequence of my actions to create a program using the CRTBNDCPP command.
      Attached Files

      Comment


      • #4
        Yes, you are doing the same thing that I am.

        I also tried all of the TGTRLS parameters from V6R1M0 - V7R4M0 (using two machines at different releases). I tried doing it within PDM as you have done (I don't normally use PDM, but I tried it for this), I tried naming my library CSNTST and my source file CPPSRC and my member/program POLIGON.

        None of this matters, it works perfectly for me.

        Something seems wrong on your machine. Please consider contacting IBM for support.

        Comment


        • #5
          The error mentions a binding directory. Is it possible that the CRTBNDCPP/CRTCPPMOD commands have been modified to include this? Are you using the IBM commands or have others been created higher in the LIBL?

          Comment


          • #6
            john.sev99, it is possible, of course, that the default parameters of the commands used by me were changed in the system by our administrators (as earlier, for example, we forced the TGTRLS = * PRV parameter). But I definitely use the commands from the QSYS library. In addition, read below.

            Scott, I have an account on PUB400.COM and I tried to reproduce the error there. And it is reproduced there! I do not understand why this error (more correctly, of course, the warning) is not on your machines.

            I made a short video demonstrating the reproduction of an warning on PUB400.COM.
            Attached Files

            Comment

            Working...
            X