* gcc -static -ggdb not working
@ 2005-10-26 5:39 fabio
2005-10-26 7:31 ` Steve Graegert
0 siblings, 1 reply; 3+ messages in thread
From: fabio @ 2005-10-26 5:39 UTC (permalink / raw)
To: linux-c-programming
Hello, I wonder why I cant dbug C programs on Solaris/sparc with gcc:
-bash-3.00$ cat 1.c;\gcc -static -ggdb 1.c -o 1
main(){
printf("hello world\n");
}
ld: fatal: library -lc: not found
ld: fatal: library -lc: not found
ld: fatal: File processing errors. No output written to 1
collect2: ld returned 1 exit status
-bash-3.00$
I use the "\" to avoid bash aliases.
Thanks for the help,
fabio
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: gcc -static -ggdb not working
2005-10-26 5:39 gcc -static -ggdb not working fabio
@ 2005-10-26 7:31 ` Steve Graegert
2005-10-26 7:28 ` fabio
0 siblings, 1 reply; 3+ messages in thread
From: Steve Graegert @ 2005-10-26 7:31 UTC (permalink / raw)
To: fabio; +Cc: linux-c-programming
On 10/26/05, fabio <fabio@crearium.com> wrote:
> Hello, I wonder why I cant dbug C programs on Solaris/sparc with gcc:
>
> -bash-3.00$ cat 1.c;\gcc -static -ggdb 1.c -o 1
> main(){
> printf("hello world\n");
> }
> ld: fatal: library -lc: not found
> ld: fatal: library -lc: not found
> ld: fatal: File processing errors. No output written to 1
> collect2: ld returned 1 exit status
Fabio,
First of all, what's the GCC version and what does your
LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 look like? Secondly, does it
work without -g or -ggdb options? Looks like gcc is looking for
64-bit libs in the place where 32-bit libs are usually found. You may
also want to check where libc.so.1 is located.
\Steve
PS: Please note, that this is a Linux C programming list. It's very
likely that input on problems concerning other Unices or Unix-like
OSes will be very reduced.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: gcc -static -ggdb not working
2005-10-26 7:31 ` Steve Graegert
@ 2005-10-26 7:28 ` fabio
0 siblings, 0 replies; 3+ messages in thread
From: fabio @ 2005-10-26 7:28 UTC (permalink / raw)
To: Steve Graegert; +Cc: linux-c-programming
Steve Graegert wrote:
>On 10/26/05, fabio <fabio@crearium.com> wrote:
>
>
>>Hello, I wonder why I cant dbug C programs on Solaris/sparc with gcc:
>>
>>-bash-3.00$ cat 1.c;\gcc -static -ggdb 1.c -o 1
>>main(){
>> printf("hello world\n");
>>}
>>ld: fatal: library -lc: not found
>>ld: fatal: library -lc: not found
>>ld: fatal: File processing errors. No output written to 1
>>collect2: ld returned 1 exit status
>>
>>
>
>Fabio,
>
>First of all, what's the GCC version and what does your
>LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 look like? Secondly, does it
>work without -g or -ggdb options? Looks like gcc is looking for
>64-bit libs in the place where 32-bit libs are usually found. You may
>also want to check where libc.so.1 is located.
>
>
>
-bash-3.00$ find / -name "libc.so.1" -print 2>/dev/null
/usr/lib/sparcv9/libc.so.1
/usr/lib/libc.so.1
/usr/lib/libp/libc.so.1
/usr/lib/libp/sparcv9/libc.so.1
/lib/sparcv9/libc.so.1
/lib/libc.so.1
-bash-3.00$ echo $LD_LIBRARY_PATH ; \gcc -v
/usr/lib:/usr/local/lib:/usr/dt/lib:/opt/csw/lib:/usr/sfw/lib:/usr/local/ssl/lib:/usr/apache2/lib:/usr/sfw/lib
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.2
-bash-3.00$ uname -srm
SunOS 5.10 sun4u
-bash-3.00$
The option -g works fine but I need the option ggdb. Option -static
doesnt work either. But It compiles ok if no option is given.
Sorry for the offtopic, any help will be appreciatted.
Thanks,
fab.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-10-26 7:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26 5:39 gcc -static -ggdb not working fabio
2005-10-26 7:31 ` Steve Graegert
2005-10-26 7:28 ` fabio
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 NNTP newsgroup(s).