Reputation: 8572
I installed cygwin (the latest 1.7.xx?), and then installed eclipse cdt (Juno).
When I tried to build a hello world project, despite eclipse identifying that cygwin was installed, it didn't work.
So I manually added c:\cygwin\bin to the path, which found all the executables in cygwin, including g++, make ld, etc.
Now, eclipse can build the project, but when debugging, gdb starts up and can't find the source code. It claims that it can't find:
/cygdrive/c/users/me/workspace/test1/test1.cc . even though that's exactly where it is. It's as though cygwin's directory system doesn't work.
I can manually load the source from:
c:\users\me\workspace\test1\test1.cc
and the debugger works, but the next time I start a new project, I have to do it again. How do you instruct the eclipse/cygwin combo to correctly find source code?
Alternatively, is Mingw any easier? I have experienced similar problems with eclipse seeing that mingw is there, but build failing because it doesn't find the executable.
Upvotes: 13
Views: 18596
Reputation: 1
I replaced gdb with msys gdb. For example:
Current configuration:
... Application Configuration .. Debug .. Debug
GDB Debugger gdb
to
GDB Debugger path to msys gdb (like for example c:\msys\bin\gdb.exe
Upvotes: 0
Reputation: 2201
Although Above are given good answers but still it might not solve the problem sometimes phew!!!!
Suppose you install Cygwin in C: but your eclipse workspace is in D: then there is a problem in your mounting
all you should do is, open the cygwing shell & type "mount" to get the following :
Ritvika@Ashutosh ~
$ ls
Ritvika@Ashutosh ~
$ mount
C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin64 on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
Ritvika@Ashutosh ~
$
here my Projects are all under D:\ECWorkSpace, so my mapping needs to be present in Eclipse as: /cygdrive/d d:/
Hence, now Armed with this knowledge do what PathM says
1. goto Window ==> Preferences ==> C/C++ ==> Debug ==> Source Lookup Path
2. Add a Path Mapping: Project Source
3. On the left side put "cygdrive\d", & on the right put : "D:\"
This should work. ( It did for me :) ) You can Check this FAQ as well : https://wiki.eclipse.org/CDT/User/FAQ#I.27m_using_cygwin_and_when_launching_the_debugger.2C_it_complains_that_it_can.27t_find_the_source_file
Upvotes: 3
Reputation: 131
Go to Windows->Preference->C/C++ -> Debug -> Source Lookup Path. Add following 'Path mapping'.
\cygdrive\c -> c:\
Upvotes: 13
Reputation: 176
Here is how I made it work.
Then when I debug it finds the source file fine.
Upvotes: 16
Reputation: 11
Look at set-up of "Common Source Lookup Path" here: http://wyding.blogspot.dk/2009/04/setup-cygwin-toolchain-in-eclipse-cdt.html
Upvotes: 0
Reputation: 10262
I use MinGW + CDT, and it is giving me great satisfaction. I installed it many times and never had any disagreement. No much to configure than what you did with cygwin. Download the Eclipse for C/C++ developers (probably what you did) to get CDT
(MinGW Tool Chain -> gdb + gcc) directly operational. Set your \\MinGW\bin\
directory into your PATH
and you should be good to go...
Note : Like Cygwin, MinGW provides a Linux-like Shell.
For MinGW-64, ready-made builds are a little bit more difficult to locate. See here.
Upvotes: 2