Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-07-2006, 10:27 PM   #1
Registered: Mar 2005
Posts: 59

Rep: Reputation: 15
ld or bash not working (or simply bad syntax on my part)

consider the following:
two obj files, a.o and b.o
ld a.o b.o && echo "success"
produces a.out with no output to stdout except for 'success'
ls -l a.out confirms that a.out exists with the proper permissions, but:
./a.out produces the output:
'bash: ./a.out: No such file or directory'
yet a hexdump a.out confirms the file exists...
i've also tried ld a.o b.o -lc (as performed in the man page)

a.o is a file compiled with gcc -o a.o --shared a.c
and b.o is a file compiled with nasm -felf -o b.o b.c

any help would be greatly appreciated...
Old 05-07-2006, 10:56 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You compiled the gcc file incorrectly. Use the gcc -c option to produce a .o file. Then in the ld command you are trying to produce a shared library which you later try to run directly in the shell.

If ld and bash didn't work, your system would be pretty hosed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
explanation on some bash syntax slzckboy Programming 2 10-02-2005 06:06 AM
very bad permission advice on my part onelung02 Slackware 7 05-12-2005 06:21 AM
sendmail > bad address syntax xushi Slackware 7 03-31-2005 01:42 PM
A Simple MySQL Query Question (I have Bad Syntax) bpk General 1 12-02-2003 09:04 PM
grab - Simply a useless bash script to take a screen shot; Required command: import micxz Programming 2 10-08-2003 07:59 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration