开发者

What are the concepts I need to learn to completely use all features of gcc/g++ compiler? [closed]

It's difficult to tell 开发者_JAVA百科what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Can you explain to me what the options mean in the following g++ command to build a boost.python object?

# location of the Python header files
PYTHON = /usr/include/python2.7

# location of the Boost Python include files and library

BOOST_INC = /usr/include
BOOST_LIB = /usr/lib

# compile mesh classes
TARGET = ex1

$(TARGET).so: $(TARGET).o
        g++ -shared -Wl,--export-dynamic \
        $(TARGET).o -L$(BOOST_LIB) -lboost_python \
        -L/usr/lib/python2.7/config -lpython2.7 \
        -o $(TARGET).so

$(TARGET).o: $(TARGET).c
        g++ -I$(PYTHON) -I$(BOOST_INC) -c $(TARGET).c

What do:

  • Wl
  • --export-dynamic
  • shared

mean?

What other concepts should I learn to make the most of the gcc/g++ compilers as well as build utilities? EDIT: I won't need all of them but what the most commonly used features to learn?

Is there a better way to know exactly, which required library I need to link to build? Currently, I can only do guesswork to figure out what to link, i.e. if I used date time library from Boost, I did things like -lboost_date_time and it just works, but sometimes not for other libraries.

Also, for boost.python, I don't want to use Bjam, because it would take much time to learn and the documentation seems vague. The make utility seems more universal to me. However, is there an ide which can automate the build process like MSVS in Windows? Code::Block? What are the advantages of manually written makefile over IDE managed? It seems to save a lot of time with build automation.


GCC has probably more options than any other existing program - literally thousands of them. You certainly are never going to need them all, but you will need to understand some, so you need to read the GCC documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜