{"id":64,"date":"2017-02-23T22:47:07","date_gmt":"2017-02-23T22:47:07","guid":{"rendered":"http:\/\/marcjuneau.ca\/?p=64"},"modified":"2017-02-23T22:51:00","modified_gmt":"2017-02-23T22:51:00","slug":"ajouter-un-fichier-source-dans-un-projet-smt32-sous-eclipse","status":"publish","type":"post","link":"https:\/\/marcjuneau.ca\/?p=64","title":{"rendered":"Ajouter un fichier source dans un projet SMT32 sous Eclipse"},"content":{"rendered":"<p>Apr\u00e8s la cr\u00e9ation d&rsquo;un projet, tous les fichiers d&rsquo;ent\u00eate seront disponibles automatiquement, mais, si le fichier source n&rsquo;est pas explicitement ajout\u00e9 au projet, le <em><strong>linker<\/strong> <\/em>donnera une erreur lors de la compilation, car il ne trouvera pas le code \u00e0 associer aux fonctions.<\/p>\n<p>Par exemple, dans ce projet,\u00a0nous d\u00e9sirons utiliser les fonctions du adc. Le fichier smt32f4xx_hal_adc.h est disponible dans les fichiers inclus mais pas le\u00a0smt32f4xx_hal_adc.c qui contient le code des fonctions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-73\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl1-300x289.jpg\" alt=\"incl1\" width=\"300\" height=\"289\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl1-300x289.jpg 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl1-768x739.jpg 768w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl1-1024x986.jpg 1024w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl1.jpg 1075w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-74\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-1-300x254.jpg\" alt=\"inc2\" width=\"300\" height=\"254\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-1-300x254.jpg 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-1-768x651.jpg 768w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-1.jpg 938w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Il est possible d&rsquo;ajouter des fichiers sources, selon les besoins du projet. Il faut aller dans les propri\u00e9t\u00e9s du projet, sous <strong><em>C\/C++General&gt;&gt;Paths and Symbols&gt;&gt;Source Location<\/em><\/strong>\u00a0puis cliquer sur <strong><em>Edit Filter<\/em><\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-70 aligncenter\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl4.jpg\" alt=\"incl4\" width=\"761\" height=\"516\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl4.jpg 813w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl4-300x203.jpg 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl4-768x521.jpg 768w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/p>\n<p>Dans la fen\u00eatre du filtre, il est maintenant possible de retirer le fichier d\u00e9sir\u00e9 de la liste des fichiers exclus \u00e0 la compilation. S\u00e9lectionner le fichier et appuyer sur <strong><em>Remove<\/em> <\/strong>ajoute ce dernier \u00e0 la liste des sources.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-72 aligncenter\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl3.jpg\" alt=\"incl3\" width=\"455\" height=\"294\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl3.jpg 455w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/incl3-300x194.jpg 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/p>\n<p>La liste des sources inclut maintenant le fichier.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-71 aligncenter\" src=\"http:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-300x254.jpg\" alt=\"inc2\" width=\"300\" height=\"254\" srcset=\"https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-300x254.jpg 300w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2-768x651.jpg 768w, https:\/\/marcjuneau.ca\/wp-content\/uploads\/2017\/02\/inc2.jpg 938w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Voil\u00e0!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apr\u00e8s la cr\u00e9ation d&rsquo;un projet, tous les fichiers d&rsquo;ent\u00eate seront disponibles automatiquement, mais, si le fichier source n&rsquo;est pas explicitement ajout\u00e9 au projet, le linker donnera une erreur lors de la compilation, car il ne trouvera pas le code \u00e0 associer aux fonctions. Par exemple, dans ce projet,\u00a0nous d\u00e9sirons utiliser<span class=\"more-link\"><a href=\"https:\/\/marcjuneau.ca\/?p=64\">Continue Reading<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,9,10],"tags":[],"class_list":["entry","author-mjuneau","post-64","post","type-post","status-publish","format-standard","category-cc","category-eclipse","category-stm32"],"_links":{"self":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":3,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marcjuneau.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}