?
Solved

easy g++ question

Posted on 2004-08-27
1
Medium Priority
?
197 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 150 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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 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…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

755 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