Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging a makefile project(New user's question)
Debugging a makefile project [message #1733500] Sat, 28 May 2016 21:10 Go to next message
James Petts is currently offline James PettsFriend
Messages: 5
Registered: May 2016
Junior Member
Apologies if I am missing something fundamental: I cannot find any information that would point to where I might find information on this subject.

I have worked on an open-source project (Simutrans-Experimental, a fork of Simutrans) for years, mainly on Windows, although I would occasionally compile and run it from the command line in Linux.

I am now keen to work with it in an IDE in Linux so that I can debug it in a Linux environment.

I have installed Eclipse, and am able to build the executable, which runs successfully, using Eclipse, when I set it to use the existing makefile for Simutrans-Experimental. I cannot, however, find any way of getting it to run from within Eclipse with this method: it will just compile the executable.

Trying to make it work with an internal builder does not work, but I get no comprehensible error message as to why: all I get is the following:
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 1: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: CFG: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 2: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: CFG: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 2: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: -include: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 5: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: BACKENDS: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 6: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: COLOUR_DEPTHS: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 7: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: OSTYPES: not found
/home/james/Documents/Simutrans/simutrans-experimental/Makefile: 9: /home/james/Documents/Simutrans/simutrans-experimental/Makefile: Syntax error: word unexpected (expecting ")")


which looks as though it is trying to execute the makefile, which makes no sense. If anyone has any ideas on how to make this make any sense, I should be very grateful.
Re: Debugging a makefile project [message #1733675 is a reply to message #1733500] Mon, 30 May 2016 23:25 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
My projects are all created as Existing Makefile Projects with imported code. External Builder as the only option.
Why do you want to use the internal builder? It's a make emulator and unlikely to recognizes all the nuances of make.
It may not actually use the makefile. The documentation is unclear.
You can't use make for some reason?

http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build.htm

Re: Debugging a makefile project [message #1733676 is a reply to message #1733675] Mon, 30 May 2016 23:36 Go to previous messageGo to next message
James Petts is currently offline James PettsFriend
Messages: 5
Registered: May 2016
Junior Member
Thank you very much for your reply. What I really want to do is use the debugger built into Eclipse so that I can set breakpoints, examine variable values, etc., in Eclipse. Do I need to use the built-in make for that?
Re: Debugging a makefile project [message #1733677 is a reply to message #1733676] Mon, 30 May 2016 23:51 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
No they are independent. CDT uses gdb to do this and only works with built executables.
Presumably your make file specifies generating debug information in the object files.

http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fgetting_started%2Fcdt_w_debug.htm&cp=10_1_7
Re: Debugging a makefile project [message #1733678 is a reply to message #1733677] Tue, 31 May 2016 00:21 Go to previous messageGo to next message
James Petts is currently offline James PettsFriend
Messages: 5
Registered: May 2016
Junior Member
The problem that I am having so far is that I cannot even get Eclipse to run the executable, although it will happily build it. I can only run it as I might run any binary executable (from outside Eclipse), and, of course, I do not then get to use Eclipse's debugging system (which I presume from what you have written is a front-end for GDB?).

The link that you included looked promising, but what is described there appears to differ markedly from the way in which the software that I have behaves: there is no "Debug configurations" option in the "Run" menu, only "External tools configuration", and that has no "C/C++ Application" option. Do I need to install a plugin of some sort to enable this?
Re: Debugging a makefile project [message #1733683 is a reply to message #1733678] Tue, 31 May 2016 02:07 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Did you install CDT with Eclipse?

It appears you may not have.
go to Help-About Eclipse

Do you see the left-most icon anywhere?
index.php/fa/26036/0/

If you don't then you will have to install CDT.
https://eclipse.org/cdt/downloads.php

If you do, click on it and tell us the versions of
CDT
and the Eclipse release

Note they aren't the same things.


Re: Debugging a makefile project [message #1733757 is a reply to message #1733683] Tue, 31 May 2016 13:09 Go to previous messageGo to next message
James Petts is currently offline James PettsFriend
Messages: 5
Registered: May 2016
Junior Member
Thank you very much for your reply. I do indeed see the CDT icon that you show in your message when I go to Help > About Eclipse. Furthermore, under "Installed software", I get:

  	1.0.0.dist	org.eclipse.license.feature.group	null
  C/C++ Common GDB Support	8.6.0.dist	org.eclipse.cdt.gdb.feature.group	Eclipse CDT
  C/C++ DSF GDB Debugger Integration	8.6.0.dist	org.eclipse.cdt.gnu.dsf.feature.group	Eclipse CDT
  C/C++ GCC Cross Compiler Support	8.6.0.dist	org.eclipse.cdt.build.crossgcc.feature.group	Eclipse CDT
  C/C++ GNU Toolchain Build Support	8.6.0.dist	org.eclipse.cdt.gnu.build.feature.group	Eclipse CDT
  C/C++ GNU Toolchain Debug Support	8.6.0.dist	org.eclipse.cdt.gnu.debug.feature.group	Eclipse CDT
  C/C++ Memory View Enhancements	8.6.0.dist	org.eclipse.cdt.debug.ui.memory.feature.group	Eclipse CDT
  C/C++ Multicore Visualizer	8.6.0.dist	org.eclipse.cdt.gnu.multicorevisualizer.feature.group	Eclipse CDT
  C/C++ Unit Testing Support	8.6.0.dist	org.eclipse.cdt.testsrunner.feature.feature.group	Eclipse CDT
  C/C++ Visualizer Framework	8.6.0.dist	org.eclipse.cdt.visualizer.feature.group	Eclipse CDT
  Eclipse CVS Client	1.3.200.dist-7B79FJJ9exZ_	org.eclipse.cvs.feature.group	Eclipse.org
  Eclipse CVS Client Resources	1.3.200.dist-7B79FJJ9exZ_	org.eclipse.cvs.source.feature.group	Eclipse.org
  Eclipse Help Developer Resources	1.4.1.dist-8v7oFRvFCmSPZkILLj597H	org.eclipse.help.source.feature.group	Eclipse.org
  Eclipse Java Development Tools	3.8.1.dist-8-8nFqrFFgQGJ	org.eclipse.jdt.feature.group	Eclipse.org
  Eclipse PDE Plug-in Developer Resources	3.8.1.dist-7c7vFiyFALX8A	org.eclipse.pde.source.feature.group	Eclipse.org
  Eclipse Platform	3.7.0.debbuild	org.eclipse.platform.ide	null
  Eclipse Plug-in Development Environment	3.8.1.dist-7c7vFiyFALX8A	org.eclipse.pde.feature.group	Eclipse.org
  Equinox p2 RCP Management Facilities Source	1.1.0.dist-785EoAUkckGofGLmS7BA7	org.eclipse.equinox.p2.rcp.feature.source.feature.group	Eclipse.org - Equinox


Is this the information that you needed?
Re: Debugging a makefile project [message #1733782 is a reply to message #1733757] Tue, 31 May 2016 18:18 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It doesn't help me but maybe someone here has had a similar problem.
This has occurred with earlier versions of CDT
https://www.eclipse.org/forums/index.php/t/203072/
My not exactly match your issue but perhaps one of the remedies mentioned will work.

Is it possible your project is not a C/C++ project? Do you have a .cproject file in your project? How did you create the project?

You are using an older version of Eclipse (3.7 apparently) and CDT (8.6),
The current versions Mars (Eclipse 4.5 and CDT 8.8 ) with Neon being released in June/July I think.
You could try upgrading.

I googled the problem but the link above was about the only thing I could find.
Re: Debugging a makefile project [message #1733788 is a reply to message #1733782] Tue, 31 May 2016 20:14 Go to previous messageGo to next message
James Petts is currently offline James PettsFriend
Messages: 5
Registered: May 2016
Junior Member
Hmm - that is odd. I downloaded the latest .deb packages that I could find.

The project was created by importing an existing Microsoft Visual Studio Express project; the program itself is one that has been developed using Visual Studio Express for many years, but I also want to be able to work on it when I am away from my main computer (which runs Windows) and using my NUC (which runs Ubuntu Linux), which is why I want also to be able to use Eclipse.

Do you happen to know where the latest versions of Eclipse and CDT for Ubuntu/Debian can be obtained?

Thank you very much for your help.
Re: Debugging a makefile project [message #1733798 is a reply to message #1733788] Wed, 01 June 2016 03:44 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Sorry, no. You're going to have to ask around unless someone here wants to jump in.

I use Fedora which is often behind the curve, too.
What I do is install in /opt to get the latest and greatest of packages that update frequently.
However, if you go that route you probably should remove Eclipse from the system first.

You could try to let Eclipse search for updates . Never did that myself.


Re: Debugging a makefile project [message #1733813 is a reply to message #1733788] Wed, 01 June 2016 07:19 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Check that you have a new enough Java on your system.
My Kubuntu 16.04LTS has OpenJDK 1.7.0_101, which works.

Dump the Eclipse installed from Ubuntu, and load the Eclipse installer from an Eclipse download site. Use it to install the version (C/C++) you need.

Check that your Ubuntu has the program development packages. To be sure, you can type from console:
sudo apt-get install build-essential



--

Tauno Voipio
Re: Debugging a makefile project [message #1799549 is a reply to message #1733813] Mon, 10 December 2018 06:03 Go to previous messageGo to next message
Dhirendra Shukla is currently offline Dhirendra ShuklaFriend
Messages: 1
Registered: December 2018
Junior Member
I am using Eclipse 4.9.0. on CentOs7 . Trying to import and debug as a makefile . but not able to debug . when clicking on Step into . It completely run the program . while creating and debugging a new project is happening .
Please suggest .
Re: Debugging a makefile project [message #1801311 is a reply to message #1733678] Wed, 16 January 2019 14:39 Go to previous messageGo to next message
DEVYN SISY is currently offline DEVYN SISYFriend
Messages: 6
Registered: November 2018
Junior Member
James Petts wrote on Tue, 31 May 2016 00:21
The problem that I am having so far is that I cannot even get Eclipse to run the executable, although it will happily build it. I can only run it as I might run any binary executable (from outside Eclipse), and, of course Torrent TurboTax Gogoanime, I do not then get to use Eclipse's debugging system (which I presume from what you have written is a front-end for GDB?).

The link that you included looked promising, but what is described there appears to differ markedly from the way in which the software that I have behaves: there is no "Debug configurations" option in the "Run" menu, only "External tools configuration", and that has no "C/C++ Application" option. Do I need to install a plugin of some sort to enable this?

Thank you very much for your reply. What I really want to do is use the debugger built into Eclipse so that I can set breakpoints, examine variable values, etc., in Eclipse. Do I need to use the built-in make for that?

[Updated on: Wed, 16 January 2019 19:41]

Report message to a moderator

Re: Debugging a makefile project [message #1801313 is a reply to message #1801311] Wed, 16 January 2019 15:16 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
No. Eclipse is simply an editor that can access external tools.
Make is a tool Eclipse/CDT uses to have other external tools build the executable.
It usually is GNU Make.
The internal make is a Make emulator.

CDT provides a GUI interface to GDB.
As long as your executable contains the debugging information needed by GDB it should work OK.

[Updated on: Wed, 16 January 2019 15:38]

Report message to a moderator

Re: Debugging a makefile project [message #1801464 is a reply to message #1801313] Sun, 20 January 2019 13:15 Go to previous messageGo to next message
Sayan Samanta is currently offline Sayan SamantaFriend
Messages: 1
Registered: January 2019
Junior Member
downloaded the latest .deb packages that I could find.
Re: Debugging a makefile project [message #1801811 is a reply to message #1733813] Sun, 27 January 2019 18:11 Go to previous messageGo to next message
DEVYN SISY is currently offline DEVYN SISYFriend
Messages: 6
Registered: November 2018
Junior Member
Tauno Voipio wrote on Wed, 01 June 2016 07:19
Check that you have a new enough Java on your system.
My Kubuntu 16.04LTS has OpenJDK 1.7.0_101, which works.

Dump the Eclipse installed from Ubuntu, and load the Eclipse installer from an Eclipse download site. Use it to install the version (C/C++) you need.

Check that your Ubuntu has the program development packages. To be sure, you can type from console:
sudo apt-get install build-essential


Thank you very much for your reply. I do indeed see the CDT icon that you show in your message when I go to Help > About Eclipse. Furthermore, under "Installed software", I get:
Re: Debugging a makefile project [message #1801812 is a reply to message #1733813] Sun, 27 January 2019 18:12 Go to previous message
DEVYN SISY is currently offline DEVYN SISYFriend
Messages: 6
Registered: November 2018
Junior Member
Tauno Voipio wrote on Wed, 01 June 2016 07:19
Check that you have a new enough Java on your system.
My Kubuntu 16.04LTS has OpenJDK 1.7.0_101, which works.

Dump the Eclipse installed from SarkariResultUbuntu, and load the Eclipse installer from an Eclipse download site. Use it to install the version (C/C++) you need.
https://downloader.vip/turbotax/ https://downloader.vip/rufus/
Check that your Ubuntu has the program development packages. To be sure, you can type from console:
sudo apt-get install build-essential


The project was created by importing an existing Microsoft Visual Studio Express project; the program itself is one that has been developed using Visual Studio Express for many years, but I also want to be able to work on it when I am away from my main computer (which runs Windows) and using my NUC (which runs Ubuntu Linux), which is why I want also to be able to use Eclipse.

[Updated on: Sun, 27 January 2019 19:36]

Report message to a moderator

Previous Topic:Can't run anything
Next Topic:LEON IDE
Goto Forum:
  


Current Time: Tue Apr 23 10:07:57 GMT 2024

Powered by FUDForum. Page generated in 0.04265 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top