How to use a precompiled library in a project with Arduino-IDE












0















I'm discovering the Arduino development and after quite some googling, I can't find an answer to the following question.



I'd like to distribute some code as mylib.h + precompiled mylib.o (this will be code ported from sources which I can't divulgate).

How is it possible to build a sketch using this precompiled mylib.o in the Arduino-IDE environment?

Do I simply have to put this mylib.o in a specific path and include the mylib.h in the sketch? If yes, which path? If no, what specific configuration steps do I have to follow?



Thanks in advance.










share|improve this question













migrated from stackoverflow.com Nov 15 '18 at 16:01


This question came from our site for professional and enthusiast programmers.























    0















    I'm discovering the Arduino development and after quite some googling, I can't find an answer to the following question.



    I'd like to distribute some code as mylib.h + precompiled mylib.o (this will be code ported from sources which I can't divulgate).

    How is it possible to build a sketch using this precompiled mylib.o in the Arduino-IDE environment?

    Do I simply have to put this mylib.o in a specific path and include the mylib.h in the sketch? If yes, which path? If no, what specific configuration steps do I have to follow?



    Thanks in advance.










    share|improve this question













    migrated from stackoverflow.com Nov 15 '18 at 16:01


    This question came from our site for professional and enthusiast programmers.





















      0












      0








      0








      I'm discovering the Arduino development and after quite some googling, I can't find an answer to the following question.



      I'd like to distribute some code as mylib.h + precompiled mylib.o (this will be code ported from sources which I can't divulgate).

      How is it possible to build a sketch using this precompiled mylib.o in the Arduino-IDE environment?

      Do I simply have to put this mylib.o in a specific path and include the mylib.h in the sketch? If yes, which path? If no, what specific configuration steps do I have to follow?



      Thanks in advance.










      share|improve this question














      I'm discovering the Arduino development and after quite some googling, I can't find an answer to the following question.



      I'd like to distribute some code as mylib.h + precompiled mylib.o (this will be code ported from sources which I can't divulgate).

      How is it possible to build a sketch using this precompiled mylib.o in the Arduino-IDE environment?

      Do I simply have to put this mylib.o in a specific path and include the mylib.h in the sketch? If yes, which path? If no, what specific configuration steps do I have to follow?



      Thanks in advance.







      arduino-ide






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 13:57









      fpierratfpierrat

      1033




      1033




      migrated from stackoverflow.com Nov 15 '18 at 16:01


      This question came from our site for professional and enthusiast programmers.









      migrated from stackoverflow.com Nov 15 '18 at 16:01


      This question came from our site for professional and enthusiast programmers.
























          1 Answer
          1






          active

          oldest

          votes


















          5














          See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification




          library.properties file format
          [...]
          precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag.




          So with the correct metadata and file layout the precompiled objects should be available.
          You'll need to set the architectures property to indicate you're using esp8266 as your tag suggests.



          More info on the library manager here https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ including how to add to the public library list.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("schematics", function () {
            StackExchange.schematics.init();
            });
            }, "cicuitlab");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "540"
            };
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2farduino.stackexchange.com%2fquestions%2f57891%2fhow-to-use-a-precompiled-library-in-a-project-with-arduino-ide%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









            5














            See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification




            library.properties file format
            [...]
            precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag.




            So with the correct metadata and file layout the precompiled objects should be available.
            You'll need to set the architectures property to indicate you're using esp8266 as your tag suggests.



            More info on the library manager here https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ including how to add to the public library list.






            share|improve this answer




























              5














              See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification




              library.properties file format
              [...]
              precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag.




              So with the correct metadata and file layout the precompiled objects should be available.
              You'll need to set the architectures property to indicate you're using esp8266 as your tag suggests.



              More info on the library manager here https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ including how to add to the public library list.






              share|improve this answer


























                5












                5








                5







                See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification




                library.properties file format
                [...]
                precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag.




                So with the correct metadata and file layout the precompiled objects should be available.
                You'll need to set the architectures property to indicate you're using esp8266 as your tag suggests.



                More info on the library manager here https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ including how to add to the public library list.






                share|improve this answer













                See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification




                library.properties file format
                [...]
                precompiled - (available from Arduino IDE 1.8.6/arduino-builder 1.4.0) (optional) set to true to allow the use of .a (archive) and .so (shared object) files. The .a/.so file must be located at src/{build.mcu} where {build.mcu} is the architecture name of the target the file was compiled for. Ex: cortex-m3 for the Arduino DUE. The static library should be linked as an ldflag.




                So with the correct metadata and file layout the precompiled objects should be available.
                You'll need to set the architectures property to indicate you're using esp8266 as your tag suggests.



                More info on the library manager here https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ including how to add to the public library list.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 14:23









                Pete KirkhamPete Kirkham

                1963




                1963






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Arduino Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f57891%2fhow-to-use-a-precompiled-library-in-a-project-with-arduino-ide%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







                    Popular posts from this blog

                    List item for chat from Array inside array React Native

                    Thiostrepton

                    Caerphilly