Generated C++ code using MATLAB Coder : Compilation Error “undefined reference to `rgb2gray_tbb_real64'”









up vote
1
down vote

favorite












Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64



One of the Generated code uses header file libmwrgb2gray_tbb.h. Screenschot It calls a function rgb2gray_tbb_real64, which is not defined anywhere.



How to sort this out?










share|improve this question



















  • 1




    Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
    – Cris Luengo
    Oct 31 at 5:17






  • 1




    Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
    – Cris Luengo
    Oct 31 at 5:28














up vote
1
down vote

favorite












Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64



One of the Generated code uses header file libmwrgb2gray_tbb.h. Screenschot It calls a function rgb2gray_tbb_real64, which is not defined anywhere.



How to sort this out?










share|improve this question



















  • 1




    Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
    – Cris Luengo
    Oct 31 at 5:17






  • 1




    Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
    – Cris Luengo
    Oct 31 at 5:28












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64



One of the Generated code uses header file libmwrgb2gray_tbb.h. Screenschot It calls a function rgb2gray_tbb_real64, which is not defined anywhere.



How to sort this out?










share|improve this question















Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64



One of the Generated code uses header file libmwrgb2gray_tbb.h. Screenschot It calls a function rgb2gray_tbb_real64, which is not defined anywhere.



How to sort this out?







c++ matlab matlab-coder






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 at 7:37









Clock Slave

2,11642249




2,11642249










asked Oct 31 at 4:45









Ritwick Mohan

61




61







  • 1




    Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
    – Cris Luengo
    Oct 31 at 5:17






  • 1




    Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
    – Cris Luengo
    Oct 31 at 5:28












  • 1




    Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
    – Cris Luengo
    Oct 31 at 5:17






  • 1




    Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
    – Cris Luengo
    Oct 31 at 5:28







1




1




Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
– Cris Luengo
Oct 31 at 5:17




Please don't post images of code and error messages. Instead, copy-paste them into your question. Images are not searchable, and not easy (or impossible) to read for people with visual disabilities.
– Cris Luengo
Oct 31 at 5:17




1




1




Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
– Cris Luengo
Oct 31 at 5:28




Regarding your question: did you follow the instructions in Coder related to linking in the appropriate libraries? It looks like a library needs to be linked in.
– Cris Luengo
Oct 31 at 5:28












1 Answer
1






active

oldest

votes

















up vote
2
down vote













Image Processing Toolbox code generation supports 2 distinct modes:



  1. Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.

  2. Generated code is standalone, independent of shared libraries, and portable

The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.



To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:



codegen myFunction -args 1,2,3 -config:lib -report
load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
packNGo(buildInfo, 'fileName', 'myFunction.zip');


That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53076455%2fgenerated-c-code-using-matlab-coder-compilation-error-undefined-reference-t%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Image Processing Toolbox code generation supports 2 distinct modes:



    1. Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.

    2. Generated code is standalone, independent of shared libraries, and portable

    The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.



    To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:



    codegen myFunction -args 1,2,3 -config:lib -report
    load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
    packNGo(buildInfo, 'fileName', 'myFunction.zip');


    That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.






    share|improve this answer


























      up vote
      2
      down vote













      Image Processing Toolbox code generation supports 2 distinct modes:



      1. Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.

      2. Generated code is standalone, independent of shared libraries, and portable

      The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.



      To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:



      codegen myFunction -args 1,2,3 -config:lib -report
      load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
      packNGo(buildInfo, 'fileName', 'myFunction.zip');


      That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.






      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        Image Processing Toolbox code generation supports 2 distinct modes:



        1. Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.

        2. Generated code is standalone, independent of shared libraries, and portable

        The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.



        To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:



        codegen myFunction -args 1,2,3 -config:lib -report
        load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
        packNGo(buildInfo, 'fileName', 'myFunction.zip');


        That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.






        share|improve this answer














        Image Processing Toolbox code generation supports 2 distinct modes:



        1. Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.

        2. Generated code is standalone, independent of shared libraries, and portable

        The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.



        To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:



        codegen myFunction -args 1,2,3 -config:lib -report
        load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
        packNGo(buildInfo, 'fileName', 'myFunction.zip');


        That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 11 at 0:50

























        answered Nov 2 at 19:28









        Ryan Livingston

        1,486616




        1,486616



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53076455%2fgenerated-c-code-using-matlab-coder-compilation-error-undefined-reference-t%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Barbados

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3