Announcement

Collapse
No announcement yet.

How to use #LINK ?

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

  • #21
    Originally posted by Michael Mattias View Post
    ???
    The version of the compiler used to complie the EXE or any DLL is immaterial.
    Any application version incompatibility is 100 percent a function of the application.
    I think he is talking about "DLL Hell". If you application is compiled to use a particular DLL version but ends up trying to use a different version, you can get all sorts of problems (such as a called function not being available or behaving differently).





    Comment


    • #22
      Hi Mannish,

      A SLL file is actually a component that is included in an executable file, its something like a bundle of source code that you can add into your own source. The PB compilers both have what is called a "runtime" library, (all of those functions you can use) and with the design of being able to make your own SLL files, you can add to the PB runtime library with you own compiled code.
      hutch at movsd dot com
      The MASM Forum - SLL Modules and PB Libraries

      http://www.masm32.com/board/index.php?board=69.0

      Comment


      • #23
        > Any application version incompatibility is 100 percent a function of the application.

        This is not correct, the two compilers have incompatible capacities in compiler specific differences. A DDT example will not work in PBCC and a console based capacity will not work in PBWIN.
        hutch at movsd dot com
        The MASM Forum - SLL Modules and PB Libraries

        http://www.masm32.com/board/index.php?board=69.0

        Comment


        • #24
          MCM,

          Stuart is correct. But . . .

          What is the the question I am responding to? Or, even the subject of the thread?

          Learn to read and and my brief replies will be obvious, even to you.

          Cheers,
          Dale

          Comment


          • #25
            I think he is talking about "DLL Hell". If you application is compiled to use a particular DLL version but ends up trying to use a different version, you can get all sorts of problems (such as a called function not being available or behaving differently).
            That IS application-specific.



            This is not correct, the two compilers have incompatible capacities in compiler specific differences. A DDT example will not work in PBCC and a console based capacity will not work in PBWIN.
            I was talking about DLLs - compiled code. You are talking about source-level stuff.

            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #26
              I was talking about DLLs - compiled code. You are talking about source-level stuff.
              Well, yes! This thread is about #LINK, which means SLL/PBLib, which means source level and pre-compiled source.

              A library created in either PBWin or PBCC will work in either if DDT nor console functions are used in the library. I haven't tried it yet, but a compete popup dialog in a library should be able to called when linked into PBCC code.

              Why are you talking about compiled DLLs here? I was just comparing why to use SLL versus DLL. Adding tangent to not reading! I'm quitting while you're only a little behind. Sorry Mannish.
              Dale

              Comment


              • #27
                Come on guys, a member asked a technical question about a PB library, he hardly needs all of this FUD.
                hutch at movsd dot com
                The MASM Forum - SLL Modules and PB Libraries

                http://www.masm32.com/board/index.php?board=69.0

                Comment


                • #28
                  Thanks Steve on the .sll file

                  Comment


                  • #29
                    A library created in either PBWin or PBCC will work in either if DDT nor console functions are used in the library. I haven't tried it yet, but a compete popup dialog in a library should be able to called when linked into PBCC code.
                    and

                    This is not correct, the two compilers have incompatible capacities in compiler specific differences. A DDT example will not work in PBCC and a console based capacity will not work in PBWIN.
                    That there may be some kind of limitation on which functions may be used in a static link library created with either PB/CC or PB/Win is not documented.

                    Granted, you may not use PB/CC syntax if you are creating an SLL with PB/Win..nor may you use Pb/Win syntax when creating an SLL using PB/CC.... but as far as I can tell from the doc (the same doc is used for Pb/Win and PB/CC) once you have created the SLL it may be linked using PB/WIn or PB/CC into whatever forms those compilers will create.

                    I am going to send this in to support to clarify the rules.

                    Michael Mattias
                    Tal Systems (retired)
                    Port Washington WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #30
                      '
                      Code:
                      'File name  SLLtestExe1.bas
                      #compiler pbwin 10
                      #compile exe "SLLtestExe1.exe"
                      #dim all
                      #link "SLLtestLib1.sll"
                      function pbmain () as long
                      
                        msgbox Trivial(123)
                      
                      end function '
                      '
                      Code:
                      'file name  SLLtestLib1.bas
                      'compile with PBCC 6
                      #compile sll "SLLtestLib1.sll"
                      
                      
                      function Trivial (byval A_number as long) common as string
                        local In_Lib as long
                        In_Lib = 321
                        In_Lib += A_number
                        function = "Stage one, no DDT or CON dot commands works!" + $crlf + _
                                 "Sum with passed number is " + dec$(In_Lib)
                      end function '
                      Cheers,
                      Dale

                      Comment


                      • #31
                        From my post 26 -
                        A library created in either PBWin or PBCC will work in either if DDT nor console functions are used in the library. I haven't tried it yet, but a compete popup dialog in a library should be able to called when linked into PBCC code
                        First sentence proved in post 30.

                        Now I have tried second, and it does not work, as Steve said. Error 637 to be specific.

                        In any case, just leave user interface to which ever compiler is being used. Sorts, hashes, arithmetic, etc, etc, etc procedures from either compiler can be LINKed in. I call that useful!

                        Cheers,
                        Dale

                        Comment


                        • #32
                          and it does not work, as Steve said. Error 637 to be specific.

                          I looked up that error.

                          Error 637 - SLL mismatch with this compiler


                          SLL mismatch with this compiler - This SLL requires CONSOLE or DDT (PB/Win only) support which is not available.
                          This requirement is not documented in the help pages dedicated to "static link libraries" in either PB/CC or PB/Win help.

                          But it surely is good to know. (Before counting on being able to freely 'mix and match' the SLL and EXE/DLL compilers).

                          I think by the time Mr. Drake reads this post (linked in my PM) he'll see this and add something to his "Documentation 'to do' " list.

                          Probably should go on the help page for #LINK as a "Restriction" or "Limitation"

                          MCM







                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                          • #33
                            FWIW, A few tests show that if you don't use a compiler specific statement/function, an SLL compiled with one version links with the other version with no problem.
                            As a trivial example, this SLL
                            '
                            Code:
                            #COMPILE SLL
                            #DIM ALL
                            FUNCTION GetTxt()  COMMON AS STRING
                                FUNCTION = "abcde"
                            END FUNCTION
                            '
                            works fine when compiled in this with either PBCC or PBWin

                            '
                            Code:
                            #COMPILE EXE 'PBWin10 OR PBCC6
                            #LINK "SLLGetTxt.SLL"
                            #DIM ALL
                            FUNCTION PBMAIN() AS LONG
                                LOCAL lDebug AS LONG: TXT.WINDOW EXE.FULL$, 200,50,40,85 TO lDebug
                                TXT.PRINT GetTxt
                                TXT.COLOR = %RGB_BLUE
                                TXT.PRINT
                                TXT.PRINT "  ....Press any key to exit": TXT.WAITKEY$: TXT.END
                            END FUNCTION
                            '
                            Note that even a simple MSGBOX() compiled in a DLL by PBWin prevents PBCC from linking. since PBCC doesn't have that statement.
                            (I haven't bothered to try, but I assume that an SDK style Dialog would work in both.)


                            Comment


                            • #34
                              That is pretty much the case, normal Windows API code runs fine in both compilers. For PBWIN 10, DDT dialogs will work fine and are in fact a good target for compiled SLL files. If you only use PBWIN and want to do console type apps, you can also use Windows API functions to work with a console, its just that PBCC is easier to use for console apps.

                              For a bit more typing,
                              Code:
                                  MessageBox hWnd,ByVal ptxt,ByVal pTitle,%MB_OK
                              Note : multiple variation of how you put text into a MessageBox.
                              hutch at movsd dot com
                              The MASM Forum - SLL Modules and PB Libraries

                              http://www.masm32.com/board/index.php?board=69.0

                              Comment


                              • #35
                                Just sayin... the doc needs to be better about listing restrictions BEFORE you plan to use an SLL created with one compiler and #LINKed into the other. Compile time error 637 is a little late.

                                Then again... I believe I may have said before "planning before writing that first line of code" is not exactly ubiquitous among our members' preferred techniques.
                                Michael Mattias
                                Tal Systems (retired)
                                Port Washington WI USA
                                [email protected]
                                http://www.talsystems.com

                                Comment

                                Working...
                                X