{"id":9192,"date":"2015-09-14T11:19:27","date_gmt":"2015-09-14T16:19:27","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=9192"},"modified":"2022-09-13T13:54:33","modified_gmt":"2022-09-13T18:54:33","slug":"mlinux-software-development","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mlinux\/mlinux-software-development\/","title":{"rendered":"Application Development"},"content":{"rendered":"<p>Whether you are writing an application from scratch or porting some existing code, there are a number of basic steps that should be followed.<\/p>\n<h4>Building<\/h4>\n<p>Determine which external libraries are required.<\/p>\n<ul>\n<li>See if they exist as part of the\u00a0mLinux<sup>\u2122<\/sup> image. If they do, use them.<\/li>\n<li>If not found, see if BitBake recipes for them exist in the <a href=\"http:\/\/layers.openembedded.org\/layerindex\/branch\/daisy\/recipes\/?q=\">OpenEmbedded Recipe Index<\/a>.<\/li>\n<li>If you still can&#8217;t find the corresponding library, this may mean that you will have to get the source and make your own custom BitBake recipe.<\/li>\n<\/ul>\n<p>If no external libraries are required, the GCC toolchain can be used to compile stand-alone C\/C++ applications. See <a href='https:\/\/www.multitech.net\/developer\/software\/mlinux\/mlinux-software-development\/mlinux-c-toolchain\/' title='C\/C++ Toolchain'>C\/C++ Toolchain<\/a>. If your application does require an external library, try building it using bitbake if a recipe exists. This will install the library into the staging\/sysroot directory: <code>${OETREE}\/<\/code><code>build\/tmp\/sysroots\/mtcdt<\/code>. Headers and library files will be installed in the <code>usr\/include<\/code> and <code>usr\/lib<\/code> directories in the previously mentioned mtcdt sysroot area.<\/p>\n<p>Compiling and linking C\/C++ applications against external libraries is best accomplished by writing a BitBake recipe for your application and building it within the OpenEmbedded environment. <code>CFLAGS<\/code>, <code>LDFLAGS<\/code> and other variables will all be appropriately set for cross-compiling and linking against other libraries previously built by BitBake. Refer to the <a href=\"http:\/\/www.yoctoproject.org\/docs\/3.1\/bitbake-user-manual\/bitbake-user-manual.html\">Yocto BitBake documentation<\/a> and to <a href=\"http:\/\/www.yoctoproject.org\/docs\/3.1\/dev-manual\/dev-manual.html#extendpoky\">Yocto Common Tasks documentation<\/a> for writing custom recipes.<\/p>\n<h4>Running<\/h4>\n<p>Now that you have your application building, you will want to move it to the hardware platform and test it.<\/p>\n<ul>\n<li>Since you are developing on a complete Linux platform, you do not need to re-flash the entire image to perform application testing.<\/li>\n<li>Simply <code>scp<\/code> the resulting package (and dependencies) to the device and install it using <code>opkg<\/code>. Look for your package in <code>${OETREE}\/build\/tmp\/deploy\/ipk\/<\/code>.<\/li>\n<\/ul>\n<h4>Releasing<\/h4>\n<p>For a release, you may wish to create a custom firmware image, which will allow you to flash a device with firmware that includes your custom application. Refer to <a href='https:\/\/www.multitech.net\/developer\/software\/mlinux\/mlinux-building-images\/building-a-custom-linux-image\/' title='Building a Custom Linux Image  '>Building a Custom Linux Image  <\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whether you are writing an application from scratch or porting some existing code, there are a number of basic steps that should be followed. Building Determine which external libraries are required. See if they exist as part of the\u00a0mLinux\u2122 image. If they do, use them. If not found, see if BitBake recipes for them exist [&hellip;]<\/p>\n","protected":false},"author":1235,"featured_media":0,"parent":7861,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-9192","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1235"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=9192"}],"version-history":[{"count":10,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9192\/revisions"}],"predecessor-version":[{"id":33178,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9192\/revisions\/33178"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7861"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=9192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}