Tackling error /usr/bin/ld: cannot find -lgnustep-base

I installed GNUstep from the package downloaded from GNUstep official website.
After installation , when i tried to compile any program

command used to compile my program:

]$. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh

[ this is a one time environment setting command, one time for one terminal ]

gcc `gnustep-config --objc-flags` -o main *.m -lobjc -lgnustep-base

it exited with error like this,

/usr/bin/ld: cannot find -lgnustep-base
collect2: ld returned 1 exit status

Now i cleared the error, even though i don’t know how to explain what the error was.

What i did was just install gnustep-base from the ubuntu repositories, just by doing,

apt-get install gnustep-base-common gnustep-base-doc gnustep-base-examples- gnustep-base-runtime libgnustep-base-dev libgnustep-base1.19 libgnustep-base1.19-dbg

when it is asked to change the file /etc/GNUstep/GNUstep.conf
give Y

the do the above mentioned environment setting command and then compile your application.
Now my program works fine.
I’m putting it here, just in case someone encounters any error of this kind, he can do it correct.

Simple solution: ( Sorry, I could find it lately only.)

compile the program , liking with the Libraries, like this,

gcc `gnustep-config --objc-flags` -L/usr/GNUstep/Local/Library/Libraries -lgnustep-base *.m -o out

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s