LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 07-30-2015, 10:40 AM   #1
newhorizon101
LQ Newbie
 
Registered: Apr 2014
Posts: 16

Rep: Reputation: Disabled
Linux Dynamic Library


Greetings Folks,

I am trying to put a custom library together to be shared between 2 user programs.

When I compile my libarary with g++, program X can link to the libarary just fine and program Y cant.

When I compile my library with gcc, program Y can link to the library and program X cant.

How can I make it so that my libarary can be linked with both of my programs X & Y.

Thanks,
 
Old 07-30-2015, 12:31 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
You need to declare the functions with C calling conventions:
http://cmd.inp.nsk.su/old/cmd2/manua...ibtool_36.html
 
  


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
[SOLVED] Linking static library INTO dynamic library miguelg Programming 6 12-10-2012 09:56 AM
C/C++ library programming on Linux (Static and dynamic libraries) Marko-M Programming 1 04-10-2011 05:14 AM
LINUX - linking archive (static library) with shared (dynamic) library gurkama Programming 5 03-04-2007 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 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