Solved

easy g++ question

Posted on 2004-08-27
1
191 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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…

776 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