Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 644261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:22:19+00:00 2026-05-13T21:22:19+00:00

I’m having trouble debugging a C++ program in Eclipse (the latest RC of Helios,

  • 0

I’m having trouble debugging a C++ program in Eclipse (the latest RC of Helios, updated with latest CDT from within itself) on OSX.

The program is very simple (esentially Lesson 2 from NeHe’s OpenGL tutorials), consisting of one cpp file and, using OpenGL and Cocoa frameworks, and linking with libSDL.a and libSDLmain.a.

The structure of the project is very simple: the source file(s) are in a subdirectory of the project called src/ and the executable is built to the project’s root directory.

The problem is that whenever I try to add breakpoints and debug it, the breakpoints seem to get hit perfectly but no source is displayed – instead I just get a “No source available for main()” error in the code window.

The compiler flags have optimisations set to none, and both the compiler and linker have the debug symbols flag set (-g).

The debugging setting in Eclipse is set to “Standard spawn progess” and the debugger is set to “gdb”.

Now the strangest thing is that if I try to debug the exact same executable – ie. the exact same one that was built by Eclipse – using gdb from the Terminal (shell) then everything works fine. Breakpoints are hit, source code is displayed, no problems at all.

I’ve made sure that both Eclipse and the shell are using the same gdb executable, and they are (it’s /usr/bin/gdb).

Now I may be wrong, but this all suggests to me that there can’t be a problem with the compiler and linker flags (because the same executable is debuggable from the shell), so presumably the problem must be with how gdb is being invoked from within Eclipse? Perhaps when run from Eclipse gdb is picking up different config files or something than when it’s run from the shell? (Anyone know?)

I’d really appreciate any help with this because it’s slowly driving me loopy!

Please let me know if there are any other details that would be useful – exact version numbers of Eclipse/cdt/gdb, exact linker/compiler command lines, etc. – and I’ll very gladly update this post with them.

Many thanks in advance,

thoughton.

— edited @ “14 hours ago” —

I tried the “add filesystem path” (with “search sub-folders”) option, but that didn’t work. I also tried creating a new completely flat project, but that didn’t work either.
I even tried getting a Galileo release (eclipse-SDK-3.5.2RC4 with CDT update), but that made no difference (apart from gdb being slower to launch).

And here’s something else strange I noticed: once I get the “No source available” message, if I then switch Eclipse’s Console to display the “gdb” console, and also turn on “Verbose console mode” so I can communicate it, I can then issue “l” and “bt” commands and have them work succesfully, showing the correct source and stack where my breakpoint was hit. Which, correct me if I’m wrong, must mean that the information is there and gdb is being invoked correctly – so why will Eclipse not see this information?

I’m getting close to giving up on Eclipse to be honest… I came to it with such high hopes, too.

Any additional help or thoughts would be hugely appreciated.

t.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:22:19+00:00Added an answer on May 13, 2026 at 9:22 pm

    I found the answer! And it’s embarrassingly simple.

    The problem was that I was using the Release version of SDL instead of the Debug version! (I had ‘libsdl’ from MacPorts whereas I should have had ‘libsdl-devel’.)

    So my generic answer is: make sure the libs you’re linking against were compiled with debug flags set too, it’s not always enough to just make sure your own code has them set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 375k
  • Answers 375k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As nobody has fired off the link yet, it seems… May 14, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer Sadly the reason this is not working is because gvim… May 14, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer In MySQL, you can limit the number of results using… May 14, 2026 at 8:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.