Solved

easy g++ question

Posted on 2004-08-27
1
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

726 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