• Post Reply Bookmark Topic Watch Topic
  • New Topic

Shared objects in linux

 
shoeb shaikh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have 2 write two shared object files. suppose 1.so and 2.so each hv 2 functions f1(char*) and f2().
Write a main prog such dat it takes 2 arguments say '1' & '2'. In this case the 1.so must get linked dynamically and call f1 (char*) - which is present in 1.so file (coz '1' is da first parameter) and '2' must be passed to it (which is present as a second command line parameter for main). Now f1(char *) should dynamically link 2.so and call f2() from it.

If the commandline parameters are '2' & '1' den in dat case 2.so must get linked dynamically and call f1(char*) - which is present in 2.so file (coz '2' is da first parameter) and '1' must be passed to it(which is present as a second command line parameter for main ). Now f1(char *) should dynamically link 1.so and call f2() from it.

Give me 3 source files and 3 make files.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch. We love to help people, but our site is Not A Code Mill.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... especially for code that would not be written in Java!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!