473,396 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Convert Program to Shared Library

I have a program that sends and receives data via a TCP/IP socket, but I would like to convert this application to a Shared Library so that other programs can use this library to send() and receive() data.

This is on a Unix platform using a gcc compiler.

Forgetting about the send option for the present, I have the typically:-

Expand|Select|Wrap|Line Numbers
  1. // The client program for the application.
  2. #include "initComms.h"
  3.  
  4. int main (int argc, char **argv)
  5. {
  6.    // This is the main driver program for the Client.
  7.  
  8.    static DataStruct     dData;
  9.    InitComms();
  10.  
  11.    printf("******** Into Client Main Loop    ********\n");
  12.    while(true)
  13.    {
  14.     ACE_TRY
  15.     dData = getData();
  16.     usleep(2000);
  17.    }
  18.    return 0;
  19. }
So my question is what type of Shared Libray would I convert to (Static or Dynamic) and how would you make the getData() available to the calling program.

Many thanks,

Andy.
Oct 27 '08 #1
0 1355

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tim Fuehner | last post by:
Dear Newsgroup, I have a problem that is somewhat related to Alexandre Gillet's ones: "build a static python executable". I would like to make a C program scriptable. Therefor, I have included...
1
by: AH | last post by:
I have two functions in my shared library which are declared as follows: void setName(const std::string& str); std::vector<std::string> getInfo(); Since the code is compiled and in shared...
2
by: santa19992000 | last post by:
Confusing th eword with "library", "shared library" and how to use these things in real C project, is there any small example I can take a look. Thanks.
3
by: QuocSi | last post by:
Hi all, I have a bitsfield Structure MyBits a as boolean b as boolean c as boolean d as boolean end structure
2
by: Martin | last post by:
I would like to convert this code to VB.NET. Can someone help. Thanks. Dim X() Dim i As Long Dim objShell, objFolder, objFolderItem Dim FSO, oFolder, Fil Sub MainExtractData()
3
by: convert a Class Library to web service | last post by:
can i convert a Class Library to be share in the internet as a web service i what thet all my classes in the Class Library will be shared
5
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
1
by: Jim Langston | last post by:
Windows. Situation: Using a Python program called OpenRPG. I have a program that displays form data (a character sheet) in C++. I am able in the C++ program to build a string and copy it into the...
2
by: blackbiscuit | last post by:
Dear All, Now in my current developing project, I have defined a global object in the main program . In dlls, there are also some static object whose constructor will use the global object in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.