| | |
c shared libraries
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 409
Reputation:
Solved Threads: 77
Actually, it is simply to use
Have a look at the gcc manual. http://gcc.gnu.org/onlinedocs/.
The only thing that you will need to be a little careful of is were to put it so that it is system wide. That is normally defined as directories in /etc/ld.so.conf. That means if you put you lib in /usr/local/lib it normally works.
However, you can get round that by using it as
There are a few more options in the manual but really that covers just about everything. (obviously, you put that in your Makefile appropiately)
C Syntax (Toggle Plain Text)
gcc -shared -o libmyshared.so file1.o file2.o
Have a look at the gcc manual. http://gcc.gnu.org/onlinedocs/.
The only thing that you will need to be a little careful of is were to put it so that it is system wide. That is normally defined as directories in /etc/ld.so.conf. That means if you put you lib in /usr/local/lib it normally works.
However, you can get round that by using it as
C Syntax (Toggle Plain Text)
gcc -Wl,-rpath,/home/serk/yourlocallibpath -o finishedProg file.o libmyshared.so
There are a few more options in the manual but really that covers just about everything. (obviously, you put that in your Makefile appropiately)
Well seeing as it took you 3 days to post some actual useful information about the problem, perhaps you could point us to an online manual for the compiler which you're having trouble reading.
Better yet, show us that you've tried to understand the manual by pasting some actual commands tried, and the results you got.
Better yet, show us that you've tried to understand the manual by pasting some actual commands tried, and the results you got.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
--
If your code lacks code tags, you will be IGNORED
--
If your code lacks code tags, you will be IGNORED
•
•
Join Date: Jan 2008
Posts: 2,058
Reputation:
Solved Threads: 124
•
•
•
•
Well seeing as it took you 3 days to post some actual useful information about the problem, perhaps you could point us to an online manual for the compiler which you're having trouble reading.
Better yet, show us that you've tried to understand the manual by pasting some actual commands tried, and the results you got.
I think your estimation of C and C++'s imminent demise is overrated.
Nobody is going to be writing an entire OS / mobile phone / any other handheld consumer electronic device entirely in C# any time soon.
Nobody is going to be writing an entire OS / mobile phone / any other handheld consumer electronic device entirely in C# any time soon.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
--
If your code lacks code tags, you will be IGNORED
--
If your code lacks code tags, you will be IGNORED
•
•
Join Date: Jan 2008
Posts: 2,058
Reputation:
Solved Threads: 124
sooner or later OS can be written in c# using some special frameworks.
![]() |
Similar Threads
- how to create and load shared libraries in fedora 7? (Java)
- How do you make a Program instal something inside a folder. (C++)
- C++ linking problem (C++)
- samba deleted?!? (*nix Hardware Configuration)
- Playing with shared memory - problem with non 'simple' data types (C++)
- How do you install files in general on linux any operating system (*nix Software)
- how long does it take to learn assembler and how difficult is it? (Assembly)
- Which components of Visual C++ should i install (C++)
Other Threads in the C Forum
- Previous Thread: Replace using POSIX regular expressions
- Next Thread: Need Graphics in C...
Views: 845 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for C
api array arrays binary binarysearch bit c++ centimeter char code coke command conversion convert database decimal dice directory drawing dude dynamic error exec executable factorial fgets file fork free function functions getline givemetehcode givemetehcodez grade graphics gtkwinlinux haiku highest histogram homework i/o input insert int integer lazy line linked linkedlist linux linuxsegmentationfault list lists loop malloc match matrix memory mysql no-effort output parallel path permutations pointer pointers problem process profile program programming read readfile recursion recursive recursiveloop recv reverse scanf scheduling socket socketprograming spoonfeeding string strings strtok structures student subscript system testautomation turbo-c unix user variable whythiscodecausesegmentationfault win32 windows _getdelim






