<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: Help on setting up CMake project</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732330#M54248</link>
    <description>&lt;P&gt;Obviously, you have multiple definitions of main() present. Check your source files, if you have more than one.&lt;/P&gt;&lt;P&gt;Additionally, you could turn on more verbose messages with&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Optional: print out extra messages to see what is going on. Comment it to have less verbose messages
set(CMAKE_VERBOSE_MAKEFILE ON)&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 01 Oct 2023 05:54:21 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2023-10-01T05:54:21Z</dc:date>
    <item>
      <title>Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732327#M54247</link>
      <description>&lt;P&gt;Hello, I am trying to make a CMake project to use&amp;nbsp;&lt;A href="https://www.jetbrains.com/es-es/clion/" target="_self"&gt;Clion&lt;/A&gt;&amp;nbsp;as an IDE.I have a LPC845 which is cortex-m0,&amp;nbsp; I've found &lt;A href="https://gist.github.com/elmot/3b4f0e9f8b23864fdf8bb509c329d051" target="_self"&gt;this CMakeLists.txt&lt;/A&gt;&amp;nbsp;for generic cortex CPUs but I cannot make it work.&lt;BR /&gt;As linker script what I did is merging all .ld files that mcuexpresso generated on Debug directory. And added every "TODO" except the "definition" one which I don't know how to fill. When I try to build the target I get a huge error which says&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CMakeFiles/3.26.4/CompilerIdCXX/CMakeCXXCompilerId.o: in function `main':
CMakeCXXCompilerId.cpp:(.text+0x0): multiple definition of `main'; CMakeFiles/3.26.4/CompilerIdC/CMakeCCompilerId.o:CMakeCCompilerId.c:(.text+0x0): first defined here&lt;/LI-CODE&gt;&lt;P&gt;Or variants saying main was already defined&lt;BR /&gt;&lt;BR /&gt;I also tried with &lt;A href="https://mcuoneclipse.com/2023/04/19/building-a-triumvirate-from-eclipse-cdt-to-cmake-cmd-and-visual-studio-code/" target="_self"&gt;this post&lt;/A&gt;&amp;nbsp;and couldn't make it work either&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 00:30:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732327#M54247</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-01T00:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732330#M54248</link>
      <description>&lt;P&gt;Obviously, you have multiple definitions of main() present. Check your source files, if you have more than one.&lt;/P&gt;&lt;P&gt;Additionally, you could turn on more verbose messages with&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Optional: print out extra messages to see what is going on. Comment it to have less verbose messages
set(CMAKE_VERBOSE_MAKEFILE ON)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 01 Oct 2023 05:54:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732330#M54248</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-10-01T05:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732351#M54250</link>
      <description>&lt;P&gt;Yes, those were some CMake's autogenerated ones, i didn't realize I was including /* instead of /*.*&lt;BR /&gt;I now have another issue which reports as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/home/dioswilson1/Programs/clion-2022.1.2/bin/cmake/linux/x64/bin/cmake --build /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm --target LPC845Test.elf -j 6
[1/1] Linking CXX executable LPC845Test.elf
FAILED: LPC845Test.elf
: &amp;amp;&amp;amp; /usr/bin/arm-none-eabi-g++ -Wno-register -Wl,-gc-sections,--print-memory-usage,-Map=/home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm/LPC845Test.map -mcpu=cortex-m0plus -mthumb -mthumb-interwork -T /home/dioswilson1/CodeStuff/TestARMClion/LinkerScripts/LPC845_Debug.ld CMakeFiles/LPC845Test.elf.dir/src/main.cpp.obj -o LPC845Test.elf &amp;amp;&amp;amp; cd /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm &amp;amp;&amp;amp; arm-none-eabi-objcopy -Oihex /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm/LPC845Test.elf /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm/LPC845Test.hex &amp;amp;&amp;amp; arm-none-eabi-objcopy -Obinary /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm/LPC845Test.elf /home/dioswilson1/CodeStuff/TestARMClion/cmake-build-debug-arm/LPC845Test.bin
/usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: cannot find crt0.o: No such file or directory
/usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lm: No such file or directory
/usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lc: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what ld is looking for, I cannot find any "-lc", "-lm" or "crt0.o" neither on CmakeLists or in LinkerScript&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 16:55:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732351#M54250</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-01T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732358#M54251</link>
      <description>&lt;P&gt;'ld' is the GNU linker.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 16:19:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732358#M54251</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-10-01T16:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732359#M54252</link>
      <description>I know, i just realized i misspelled and said "-ld" instead of "-lc" my bad, I will edit previous post</description>
      <pubDate>Sun, 01 Oct 2023 16:31:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732359#M54252</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-01T16:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732360#M54253</link>
      <description>&lt;P&gt;Here is Linker script:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pastebin.com/QxWahvTD" target="_blank"&gt;https://pastebin.com/QxWahvTD&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 16:56:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732360#M54253</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-01T16:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732361#M54254</link>
      <description>&lt;P&gt;-lc looks for a library named libc.a, see &lt;A href="https://mcuoneclipse.com/2017/07/23/how-to-use-custom-library-names-with-gnu-linker-and-eclipse/" target="_blank"&gt;https://mcuoneclipse.com/2017/07/23/how-to-use-custom-library-names-with-gnu-linker-and-eclipse/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 17:11:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732361#M54254</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-10-01T17:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732362#M54255</link>
      <description>What about the other 2? Also I have multiple libc files, but none libc.a</description>
      <pubDate>Sun, 01 Oct 2023 18:03:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732362#M54255</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-01T18:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732396#M54257</link>
      <description>&lt;P&gt;crt0.o is the startup code.&lt;/P&gt;&lt;P&gt;-lm means libm.a, the math library.&lt;/P&gt;&lt;P&gt;You have to check your linker files and tool setup, especially the linker command line.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 03:45:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732396#M54257</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-10-02T03:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732754#M54260</link>
      <description>&lt;P&gt;I am testing both on linux and on windows, crt0.o, libm.a and libc.a exist on both systems.&lt;BR /&gt;On linux I am still getting the same error, it is probably some configuration I am missing and on windows I am getting the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cmd.exe /C "cd . &amp;amp;&amp;amp; C:\PROGRA~1\ARM-GN~1.REL\bin\AR10B2~1.EXE -Wno-register -g -Wl,-gc-sections,--print-memory-usage,-Map=D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/cmake-build-debug-arm/LPC845Test.map -mcpu=cortex-m0plus -mthumb -mthumb-interwork -T D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/LinkerScripts/LPC845_Debug.ld CMakeFiles/LPC845Test.elf.dir/src/main.cpp.obj -o LPC845Test.elf   &amp;amp;&amp;amp; cmd.exe /C "cd /D D:\Users\Usuario\Desktop\Agus\CodeStuff\TestLPC845\cmake-build-debug-arm &amp;amp;&amp;amp; arm-none-eabi-objcopy -Oihex D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/cmake-build-debug-arm/LPC845Test.elf D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/cmake-build-debug-arm/LPC845Test.hex &amp;amp;&amp;amp; arm-none-eabi-objcopy -Obinary D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/cmake-build-debug-arm/LPC845Test.elf D:/Users/Usuario/Desktop/Agus/CodeStuff/TestLPC845/cmake-build-debug-arm/LPC845Test.bin""
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\libg.a(libc_a-closer.o): in function `_close_r':
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\libg.a(libc_a-lseekr.o): in function `_lseek_r':
lseekr.c:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\libg.a(libc_a-readr.o): in function `_read_r':
readr.c:(.text._read_r+0x10): warning: _read is not implemented and will always fail
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\libg.a(libc_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x10): warning: _write is not implemented and will always fail
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\crti.o: in function `_init':
(.init+0x0): multiple definition of `_init'; c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crti.o:(.init+0x0): first defined here
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\crti.o: in function `_fini':
(.fini+0x0): multiple definition of `_fini'; c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crti.o:(.fini+0x0): first defined here
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\crtbegin.o:(.data.__dso_handle+0x0): multiple definition of `__dso_handle'; c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crtbegin.o:(.data.__dso_handle+0x0): first defined here
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp\crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'; c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v6-m/nofp/crtend.o:(.tm_clone_table+0x0): first defined here
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: Linker CRP Enabled, but no CRP_WORD provided within application
c:/progra~1/arm-gn~1.rel/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol ResetISR; defaulting to 00000000
Memory region         Used Size  Region Size  %age Used
        MFlash64:        1236 B        64 KB      1.89%
        RamLoc16:         460 B        16 KB      2.81%
collect2.exe: error: ld returned 1 exit status&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Here is a pastebin from &lt;A href="https://pastebin.com/QbT7xFmK" target="_self"&gt;CmakeLists.txt&lt;/A&gt; and also the &lt;A href="https://pastebin.com/Hh6Hwc1t" target="_self"&gt;linker file&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 19:51:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1732754#M54260</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-02T19:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help on setting up CMake project</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1735364#M54296</link>
      <description>&lt;P&gt;Hey any recomendations on what to do? I couldn't find the reason of the 2 errors I have&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2023 13:15:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Help-on-setting-up-CMake-project/m-p/1735364#M54296</guid>
      <dc:creator>AgustinOrdonez</dc:creator>
      <dc:date>2023-10-08T13:15:13Z</dc:date>
    </item>
  </channel>
</rss>

