This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil C/C++ compiler in Eclipse IDE

Hello!

Can you help me?

How include Keil C/C++ compiler in Eclipse IDE?
Whether it is possible?
Whether debugging with OpenOCD will earn?

Parents
  • Hi Joldi,

    I haven't tried the third option of using a non-Keil debugger with the output from the Keil compiler. However, setting up Eclipse as an edit/build environment is pretty easy. You can use the "Import" menu and select "Existing code as Makefile project" under the C/C++ category. At that point you can use the normal Eclipse method of setting up include paths and symbols to match your project (that part is a little tedious).

    To launch a build from Eclipse you have to change to a custom build step and call a build script. I put mine in the same directory as the Keil project and call it build.cmd:

    c:\keil\uv4\uv4.exe -b RSN.uvproj -o errors.txt
    type errors.txt
    

    In the C/C++ Build settings for the project (right-click on the project) I uncheck "Use default build command" and enter "build.cmd" as the build command instead. Now, when I select "Build" for my project Eclipse will launch build.cmd and pipe errors.txt to the "Console" window.

    The last step is to define a custom error parser for the armcc compiler output, which is a little different from gcc. In "Window|Preferences|C/C++|Build" you add an error parser with these definitions:

    Error: (.*)\((\d+)\):\s+error:\s+(.*)
    Warning: (.*)\((\d+)\):\s+warning:\s+(.*)
    Info: (.*)\((\d+)\):\s+info(.*)
    

    Finally, back in the "C/C++ Build" settings for your project you enable the newly created error parser.

    Done!

    For additional goodness I also have Subversion integrated into Eclipse so the only thing I do in Keil is debugging.

    Andrew Q

Reply
  • Hi Joldi,

    I haven't tried the third option of using a non-Keil debugger with the output from the Keil compiler. However, setting up Eclipse as an edit/build environment is pretty easy. You can use the "Import" menu and select "Existing code as Makefile project" under the C/C++ category. At that point you can use the normal Eclipse method of setting up include paths and symbols to match your project (that part is a little tedious).

    To launch a build from Eclipse you have to change to a custom build step and call a build script. I put mine in the same directory as the Keil project and call it build.cmd:

    c:\keil\uv4\uv4.exe -b RSN.uvproj -o errors.txt
    type errors.txt
    

    In the C/C++ Build settings for the project (right-click on the project) I uncheck "Use default build command" and enter "build.cmd" as the build command instead. Now, when I select "Build" for my project Eclipse will launch build.cmd and pipe errors.txt to the "Console" window.

    The last step is to define a custom error parser for the armcc compiler output, which is a little different from gcc. In "Window|Preferences|C/C++|Build" you add an error parser with these definitions:

    Error: (.*)\((\d+)\):\s+error:\s+(.*)
    Warning: (.*)\((\d+)\):\s+warning:\s+(.*)
    Info: (.*)\((\d+)\):\s+info(.*)
    

    Finally, back in the "C/C++ Build" settings for your project you enable the newly created error parser.

    Done!

    For additional goodness I also have Subversion integrated into Eclipse so the only thing I do in Keil is debugging.

    Andrew Q

Children