Solved

easy g++ question

Posted on 2004-08-27
1
190 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now