[QBS] How to use linking dependences of the third-party libraries [part2]

Denis Shienkov denis.shienkov at gmail.com
Sun Feb 1 20:35:02 CET 2015


Ahhh... Seems, it works with "dynamiclibrary_copy" instead of 
"dynamiclibrary_import ",
but I'm not sure that it is correctly..


01.02.2015 22:22, Denis Shienkov пишет:
> Hi all.
>
> I want to create a wrapper around of existing 3rd DLL on windows as a 
> separate product.
> This solution works only with the MSVC compiler, as says in here (in 
> previous thread):
>
> http://lists.qt-project.org/pipermail/qbs/2014-May/000807.html
>
> My current snippet:
>
> = dllwrap.qbs =
>
> importqbs
> import  qbs.FileInfo
> import  qbs.File
> DynamicLibrary  {
>      name:  "mhstcan"
>      Transformer  {
>          Artifact  {
>              filePath:  product.targetName  +  ".dll"  << existing runtime library
>              fileTags:  "dynamiclibrary"
>          }
>          Artifact  {
>              filePath:  product.targetName  +  ".lib"  << existing import library
>              fileTags:  "dynamiclibrary_import"
>          }
>          prepare:  {
>              var  commands  =  []
>              for  (var  tag  in  outputs)  {
>                  for  (var  index  in  outputs[tag])  {
>                      var  artifact  =  outputs[tag][index];
>                      var  cmd  =  new  JavaScriptCommand();
>                      cmd.sourceFile  =  product.sourceDirectory  +  "/"  +
>                              FileInfo.fileName(artifact.filePath);
>                      cmd.description  =  "copying  "  +
>                              FileInfo.fileName(cmd.sourceFile);
>                      cmd.highlight  =  "codegen";
>                      cmd.targetFilePath  =  artifact.filePath;
>                      cmd.sourceCode  =  function()  {
>                          File.copy(sourceFile,  targetFilePath);  }
>                      commands.push(cmd);
>                  }
>              }
>              return  commands;
>          }
>      }
> }
>
> == app.qbs ==
>
> import  qbs
>
>
> Application  {
>      name:  "app"
>      Depends  {  name:  "cpp"  }
>      Depends  {  name:  "mhstcan"  }
>
>
>      files:  [
>          "app.cpp",
>      ]
> }
>
>
> Briefly: I want to wrap the existing shared library mhstcan.dll (with import
> mhstcan.lib), which is compiled in MSVC, but to using in MinGW compiler. But all
> attempts are fails, because the linker does not called never.
>
> Seems, that "dynamiclibrary_import"  is defined only for the MSVC compiler.
> But the MinGW has nothing similar.
>
> I tried to:
>
> * use the "staticlibrary" instead of "dynamiclibrary_import"
> * convert the *.lib import file to the *.a import file and to pass to Artifact with
>    the "*.a" suffix
>
> but nothing successfully - no linker called.
>
> So, my question: is any trick for it?
>
> PS: I use QBS from the QtCreator 3.3.0 + Qt 4.8.6
>
> BR,
> Denis
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20150201/955e15ea/attachment.html>


More information about the Qbs mailing list