LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-09-2004, 09:22 AM   #1
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
help creating .so and linking into other applications (c++)


Hey guys n gurls, before i get told to RTFM, i did, and TFM went over my head.

im on a computer science course.
at the start of the year, i wrote an amasing memory management class that allows the dynamic allocation of memory, addressable as smaller than char (byte) arrays.

for example, i could declair an array of 100 3 bit wariables, and address each 3bit variable as an array index, whereas a normal char array would have wasted 5 bits in each array index. ANYWAYS.

i find myself copying and pasting this code into almost off my my AI porgrams,
i would like ot compile it once as a .so (shared object)
and link it into my other aplications, saving compile time, and generally keeping my code clean.

i know i need a g++ compiler option to compile the code as a shared object, but i cant find it... (honestly, i did (skim) read the entire gcc man page {SRTFM}) lol

then write a header file with funcrion / class prototypes to #include into the main program.

then compile the main program with a parameter to link in an .so that is not stored in the normal library folder.

any tips or advice, or a link to a tutorial on the basics ?

all the online how-to's go into too much depth, explaining interprocess cominucation and all the lot.

thanX
 
Old 12-09-2004, 09:27 AM   #2
damien
Member
 
Registered: Sep 2003
Location: Calgary, Canada
Distribution: Slackware 10.0
Posts: 90

Rep: Reputation: 15
Try this:

http://www-106.ibm.com/developerworks/library/l-shobj/

Damien
 
Old 12-09-2004, 09:31 AM   #3
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
perfect.... love the title.
Quote:
Shared objects for the object disoriented!
thanks.
 
Old 12-09-2004, 09:32 AM   #4
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
Replace gcc with g++ since you are compiling C++ source code.

http://www.csfalcon.com/index.jsp?to...time%20Library
 
  


Reply



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
Creating Applications Moogey Linux - Software 4 10-30-2005 03:22 PM
Who is Knowing about daemon applications and how to develop these applications? ms_890 Linux - Software 0 04-14-2004 02:04 AM
creating shortcuts for WINE applications? cloids Linux - General 2 01-11-2004 04:51 PM
HELP w/ creating link in "Applications" xiojqwnko Linux - Newbie 6 12-10-2003 10:17 AM
Creating Shortcuts for Applications Creole Red Hat 1 09-24-2003 08:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration