Solved

easy g++ question

Posted on 2004-08-27
1
192 Views
Last Modified: 2010-04-21
hi, i'm a total beginner in Linux so this might be easy:

i have a cpp file that includes 3 h files
src.cpp
header1.h
header2.h
header3.h
and i would like to compile them into a library (a .so file). g++ is very complicated to me - a simple windows guy :)
can you please tell me exactly the commands i need to type in ?

thanks
0
Comment
Question by:hapciu
1 Comment
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 50 total points
ID: 11918919
g++ -Wall -fPIC -shared -o scr.so src.cpp

-Wall      Generate warnings for most questionable constructs
-fPIC      Generate Position-Independent code
-shared      Create a shared library
-o scr.so      Name the output shared library scr.so

http://vergil.chemistry.gatech.edu/resources/programming/c-tutorial/libraries.html

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysql server issue in linux server 5 64
yum remove leaves empty directories 1 93
linux / python expert needed 3 98
linux $PWD 2 656
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question