LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 05-20-2005, 05:41 AM   #1
mukund_desh
LQ Newbie
 
Registered: May 2005
Location: Bangalore
Posts: 1

Rep: Reputation: 0
Trying to create a shared library


Hi,

I have a Java Program which utilizes the native C Code on Red Hat Linux. When I compile the C code to produce a shared library using the following command:
cc -I <header_file_Location> -I <platformspecific_Headerfile> <programname>.c -o <shared_lib_name>.so

I get the below error:

/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

This is certain 'coz <programname>.c doesn't have a main function.

Later I tried with an alternate option:
cc -I /space/j2sdk/include -I /space/j2sdk/include/linux -c HelloWorldImp.c
This produced the object file.

Now I used the option:
cc <programname>.o -o libxyz.so

But still I get the same error.

Can any1 help me out.

Thanks in advance.

Thanks,
Mukund
 
Old 05-24-2005, 05:41 AM   #2
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
google can.

http://www.google.com/linux?hl=en&lr...es&btnG=Search
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write makefile to create shared library in 2.6 kernel yogeshwar_s Linux - Software 1 12-29-2004 12:39 AM
help shared library jingle_mj Linux - Newbie 1 08-13-2004 04:36 PM
help shared library jingle_mj Programming 4 08-13-2004 04:13 AM
help shared library jingle_mj Linux - General 1 08-13-2004 03:11 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM


All times are GMT -5. The time now is 01:35 PM.

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