public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compiler problem
@ 2005-07-24 19:48 Fred J.
  2005-07-24 20:50 ` Alex J. Dam
  2005-07-25 16:09 ` Travis Spencer
  0 siblings, 2 replies; 9+ messages in thread
From: Fred J. @ 2005-07-24 19:48 UTC (permalink / raw)
  To: gcc-help

Hello

I asked this question in other mailing lists, emacs,
gnu gdb, gnu make, and it may well be a compiler
problem. 
my compiler is gcc 3.3.5-3, the debian testing
package.

I read that "Executable programs sometimes do not
record the directories of the source files from which
they were compiled, just the names.

I have this arrangement

sam@debian:~/Exercies/ThinkingInC++/Vol1/C03$ tree
.
|-- makefile
|-- 13
|   |-- #rotation.cpp#
|   |-- bitwise.cpp
|   |-- makefile
|   |-- printBinary.cpp
|   |-- printBinary.h
|   |-- proj1
|   |-- rotation.cpp
|   `-- semantic.cache
|-- 14
|   |-- #makefile#
|   |-- main.cpp
|   |-- makefile
|   |-- proj1
|   |-- semantic.cache
|   `-- semantic.cache~

../14/makefile looks like this
**************************************************
include ../makefile

in the parent directory I have this makefile
**************************************************
OBJS = main.o
CFLAGS= -g -Wall
proj1 : $(OBJS)
	$(CXX) $(CFLAGS) -o $@ $(OBJS)		#CC -o proj1 $(OBJS)
the macro @ evaluates to the current target.

clean : 
	rm -f $(OBJS)

I did 
sam@debian:~/Exercies/ThinkingInC++/Vol1/C03/13$ make
which went ok.

how can I know if the executable programs did or did
not record the directories of the source files from
which it was compiled. and if it did what are they?

the reason I am asking is because when I 
Run gdb (like this): gdb
~/Exercies/ThinkingInC++/Vol1/C03/13/proj1 

I get
Current directory is
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13/
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are welcome to change it
and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i386-linux"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) break bitwise.cpp : 11
No source file named bitwise.cpp.  <-----this problem
Make breakpoint pending on future shared library load?
(y or [n]) 
(gdb) show directories 
Source directories searched: $cdir:$cwd
(gdb)

and while we are at it, how to fix this, because
(gdb) dir /home/sam/Exercies/ThinkingInC++/Vol1/C03/13

Source directories searched:
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13:$cdir:$cwd
(gdb) show directories 
Source directories searched:
/home/sam/Exercies/ThinkingInC++/Vol1/C03/13:$cdir:$cwd
(gdb) break bitwise.cpp : 11
No source file named bitwise.cpp.
Make breakpoint pending on future shared library load?
(y or [n]) 

thanks


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  2005-07-24 19:48 compiler problem Fred J.
@ 2005-07-24 20:50 ` Alex J. Dam
  2005-07-25 16:09 ` Travis Spencer
  1 sibling, 0 replies; 9+ messages in thread
From: Alex J. Dam @ 2005-07-24 20:50 UTC (permalink / raw)
  To: gcc-help

Hello.

On Sun, Jul 24, 2005 at 12:48:25PM -0700, Fred J. wrote:
> ../14/makefile looks like this
> **************************************************
> include ../makefile
> 
> in the parent directory I have this makefile
> **************************************************
> OBJS = main.o
> CFLAGS= -g -Wall
> proj1 : $(OBJS)
> 	$(CXX) $(CFLAGS) -o $@ $(OBJS)		#CC -o proj1 $(OBJS)
> the macro @ evaluates to the current target.
> 
> clean : 
> 	rm -f $(OBJS)
> 
> I did 
> sam@debian:~/Exercies/ThinkingInC++/Vol1/C03/13$ make
> which went ok.

How does 13/makefile look like?  Does 13/proj1 depend on 14/main.cpp?

> how can I know if the executable programs did or did
> not record the directories of the source files from
> which it was compiled. and if it did what are they?

These may help:

$ strings proj1 | grep bitwise.cpp
$ readelf --debug-dump=info proj1

> (gdb) break bitwise.cpp : 11
> No source file named bitwise.cpp.  <-----this problem
> Make breakpoint pending on future shared library load?
> (y or [n]) 

GDB does not look for the source file right now, when you're setting
the breakpoint.  This error seems to indicate that the executable
itself has no information about the source file.  In fact, you can set
breakpoint even on files you have already moved or deleted; GDB just
won't be able to show the line the breakpoint was set at.

-- 
Alex J. Dam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  2005-07-24 19:48 compiler problem Fred J.
  2005-07-24 20:50 ` Alex J. Dam
@ 2005-07-25 16:09 ` Travis Spencer
  2005-07-25 20:28   ` Fred J.
  1 sibling, 1 reply; 9+ messages in thread
From: Travis Spencer @ 2005-07-25 16:09 UTC (permalink / raw)
  To: Fred J.; +Cc: gcc-help

On 7/24/05, Fred J. <phddas@yahoo.com> wrote:
> the reason I am asking is because when I
> Run gdb (like this): gdb
> ~/Exercies/ThinkingInC++/Vol1/C03/13/proj1
> 
> I get
> Current directory is
> /home/sam/Exercies/ThinkingInC++/Vol1/C03/13/

What about starting the debugger like so:

sam@debian:~/Exercies/ThinkingInC++/Vol1/$ gdb -d 13 -d 14

-- 

Regards,

Travis Spencer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  2005-07-25 16:09 ` Travis Spencer
@ 2005-07-25 20:28   ` Fred J.
  2005-07-26  6:08     ` Travis Spencer
  0 siblings, 1 reply; 9+ messages in thread
From: Fred J. @ 2005-07-25 20:28 UTC (permalink / raw)
  To: Travis Spencer; +Cc: gcc-help



--- Travis Spencer <travislspencer@gmail.com> wrote:

> On 7/24/05, Fred J. <phddas@yahoo.com> wrote:
> > the reason I am asking is because when I
> > Run gdb (like this): gdb
> > ~/Exercies/ThinkingInC++/Vol1/C03/13/proj1
> > 
> > I get
> > Current directory is
> > /home/sam/Exercies/ThinkingInC++/Vol1/C03/13/
> 
> What about starting the debugger like so:
> 
> sam@debian:~/Exercies/ThinkingInC++/Vol1/$ gdb -d 13
> -d 14
> 
> -- 
> 
> Regards,
> 
> Travis Spencer
> 

(gdb) break 13/bitwise.cpp:11
No symbol table is loaded. Use teh "file" command.
(gdb)file 13/proj1
Reading symbols from /home/.../13/proj1...done.
Using host libthread_db library
"/lib/libthread_db.so.1".
(gdb)break 13/bitwise.cpp:11
No source file name 13/bitwise.cpp.
Make breakpoint pending on future shared library
load?(y or [n])



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  2005-07-25 20:28   ` Fred J.
@ 2005-07-26  6:08     ` Travis Spencer
  0 siblings, 0 replies; 9+ messages in thread
From: Travis Spencer @ 2005-07-26  6:08 UTC (permalink / raw)
  To: Fred J.; +Cc: gcc-help

On 7/25/05, Fred J. <phddas@yahoo.com> wrote:
> (gdb) break 13/bitwise.cpp:11
> No symbol table is loaded. Use teh "file" command.
> (gdb)file 13/proj1
> Reading symbols from /home/.../13/proj1...done.
> Using host libthread_db library
> "/lib/libthread_db.so.1".
> (gdb)break 13/bitwise.cpp:11
> No source file name 13/bitwise.cpp.
> Make breakpoint pending on future shared library
> load?(y or [n])

Is that the output of gdb after starting it the way I suggested?  From
the man page:

 -d directory
               Add directory to the path to search for source files.

If it can't find the source file for bitwise.cpp, it seems to me that
the `13' directory may not be in it search path.

-- 

Regards,

Travis Spencer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  1999-12-02 13:44 ` Arthur Gold
@ 1999-12-31 22:24   ` Arthur Gold
  0 siblings, 0 replies; 9+ messages in thread
From: Arthur Gold @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

Nicole Bogeajis wrote:
> 
> I have these programs writen in C that were running on our DG systems.  We
> recently moved them to our Sun system.  When i try to run them from this new
> location, i get the error
> 
> ksh: qw_check.run: cannot execute
> 
> It was suggested to me that the reason we are getting this error is that the
> program needs to be re-compiled on the Sun.  I was "man"-ing the compile
> command cc on the Sun to try to come up with a compile command on this
> system.  The programs were originally compiled with an executable file that
> contained the commands.
> 
> esqlc $1.sc
> cc -o $1.run $1.c -L /usr/opt/ingres/lib -l ingres -l sd -l m
> cp $1.run /jaxrpt/RUN/.
> ~
> 
Should be: cc -o $1.run $1.c -L/usr/opt/ingres/lib -lingres -lsd -lm
[i.e. lose the spaces]
(assuming the existence of libingres and libsd in /usr/opt/ingres/lib or
somewhere in your path)

HTH,
--ag

> This compile command does not work on the Sun.  I get the error:
> 
> $ ./make qw_check_new
> ESQL qw_check_new.sc:
> cc1: Invalid option `-L'
> cc1: Invalid option `-l'
> cc1: Invalid option `-l'
> cc1: Invalid option `-l'
> cc1: m: No such file or directory
> cp: cannot access qw_check_new.run
> 
> do you know what changes i
> need to make to fix this problem...it was suggested that i use gcc as a
> compiler...sorry for my vagueness on the
> subject...thats about all i know about it.
> 
> Thank you for any help or suggestions you could give me
> 
> Nicole
> bogeajis@usgs.gov

-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more info)
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* compiler problem
  1999-12-02  5:42 Nicole Bogeajis
  1999-12-02 13:44 ` Arthur Gold
@ 1999-12-31 22:24 ` Nicole Bogeajis
  1 sibling, 0 replies; 9+ messages in thread
From: Nicole Bogeajis @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

I have these programs writen in C that were running on our DG systems.  We
recently moved them to our Sun system.  When i try to run them from this new
location, i get the error

ksh: qw_check.run: cannot execute

It was suggested to me that the reason we are getting this error is that the
program needs to be re-compiled on the Sun.  I was "man"-ing the compile
command cc on the Sun to try to come up with a compile command on this
system.  The programs were originally compiled with an executable file that
contained the commands.

esqlc $1.sc
cc -o $1.run $1.c -L /usr/opt/ingres/lib -l ingres -l sd -l m
cp $1.run /jaxrpt/RUN/.
~

This compile command does not work on the Sun.  I get the error:

$ ./make qw_check_new
ESQL qw_check_new.sc:
cc1: Invalid option `-L'
cc1: Invalid option `-l'
cc1: Invalid option `-l'
cc1: Invalid option `-l'
cc1: m: No such file or directory
cp: cannot access qw_check_new.run


do you know what changes i
need to make to fix this problem...it was suggested that i use gcc as a
compiler...sorry for my vagueness on the
subject...thats about all i know about it.

Thank you for any help or suggestions you could give me

Nicole 
bogeajis@usgs.gov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: compiler problem
  1999-12-02  5:42 Nicole Bogeajis
@ 1999-12-02 13:44 ` Arthur Gold
  1999-12-31 22:24   ` Arthur Gold
  1999-12-31 22:24 ` Nicole Bogeajis
  1 sibling, 1 reply; 9+ messages in thread
From: Arthur Gold @ 1999-12-02 13:44 UTC (permalink / raw)
  To: help-gcc

Nicole Bogeajis wrote:
> 
> I have these programs writen in C that were running on our DG systems.  We
> recently moved them to our Sun system.  When i try to run them from this new
> location, i get the error
> 
> ksh: qw_check.run: cannot execute
> 
> It was suggested to me that the reason we are getting this error is that the
> program needs to be re-compiled on the Sun.  I was "man"-ing the compile
> command cc on the Sun to try to come up with a compile command on this
> system.  The programs were originally compiled with an executable file that
> contained the commands.
> 
> esqlc $1.sc
> cc -o $1.run $1.c -L /usr/opt/ingres/lib -l ingres -l sd -l m
> cp $1.run /jaxrpt/RUN/.
> ~
> 
Should be: cc -o $1.run $1.c -L/usr/opt/ingres/lib -lingres -lsd -lm
[i.e. lose the spaces]
(assuming the existence of libingres and libsd in /usr/opt/ingres/lib or
somewhere in your path)

HTH,
--ag

> This compile command does not work on the Sun.  I get the error:
> 
> $ ./make qw_check_new
> ESQL qw_check_new.sc:
> cc1: Invalid option `-L'
> cc1: Invalid option `-l'
> cc1: Invalid option `-l'
> cc1: Invalid option `-l'
> cc1: m: No such file or directory
> cp: cannot access qw_check_new.run
> 
> do you know what changes i
> need to make to fix this problem...it was suggested that i use gcc as a
> compiler...sorry for my vagueness on the
> subject...thats about all i know about it.
> 
> Thank you for any help or suggestions you could give me
> 
> Nicole
> bogeajis@usgs.gov

-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more info)
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* compiler problem
@ 1999-12-02  5:42 Nicole Bogeajis
  1999-12-02 13:44 ` Arthur Gold
  1999-12-31 22:24 ` Nicole Bogeajis
  0 siblings, 2 replies; 9+ messages in thread
From: Nicole Bogeajis @ 1999-12-02  5:42 UTC (permalink / raw)
  To: help-gcc

I have these programs writen in C that were running on our DG systems.  We
recently moved them to our Sun system.  When i try to run them from this new
location, i get the error

ksh: qw_check.run: cannot execute

It was suggested to me that the reason we are getting this error is that the
program needs to be re-compiled on the Sun.  I was "man"-ing the compile
command cc on the Sun to try to come up with a compile command on this
system.  The programs were originally compiled with an executable file that
contained the commands.

esqlc $1.sc
cc -o $1.run $1.c -L /usr/opt/ingres/lib -l ingres -l sd -l m
cp $1.run /jaxrpt/RUN/.
~

This compile command does not work on the Sun.  I get the error:

$ ./make qw_check_new
ESQL qw_check_new.sc:
cc1: Invalid option `-L'
cc1: Invalid option `-l'
cc1: Invalid option `-l'
cc1: Invalid option `-l'
cc1: m: No such file or directory
cp: cannot access qw_check_new.run


do you know what changes i
need to make to fix this problem...it was suggested that i use gcc as a
compiler...sorry for my vagueness on the
subject...thats about all i know about it.

Thank you for any help or suggestions you could give me

Nicole 
bogeajis@usgs.gov


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-07-26  6:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-24 19:48 compiler problem Fred J.
2005-07-24 20:50 ` Alex J. Dam
2005-07-25 16:09 ` Travis Spencer
2005-07-25 20:28   ` Fred J.
2005-07-26  6:08     ` Travis Spencer
  -- strict thread matches above, loose matches on Subject: below --
1999-12-02  5:42 Nicole Bogeajis
1999-12-02 13:44 ` Arthur Gold
1999-12-31 22:24   ` Arthur Gold
1999-12-31 22:24 ` Nicole Bogeajis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).