12-27-2012
Some prefer to do it in two lines, one for .cc.o and one for .o.exe or whatever, so the first also supports code going into libraries, and there is just one place for those options in make definitions.
I usually see the compiler options, -D's, -I's (preprocess is before compile, is before link), the -L right before the -l's it supports, -l's for each linked library and source or local object at the right end. I like to use dynamic linking, so no -L's, just a good LD_LIBRARY_PATH (or whatever your system likes to use, see man ld() for rules).
Sometimes I would -c compile all the .c or .cc into .o and ar them all into one library .a file, as order does not matter within a library, and finally compile with the .a file explicitly only. Only good for one main()! One best practice says put only one subroutine/function in each source file, and then the order is tricky. You can have one .a for each main() and it's "private" functions/methods/subroutines, and then link in any common code libraries.
The -I path must support the entry name or relative path in the source #include's (-I/a/b/c and #include "d/e.h" is for /a/b/c/d/e.h).
Last edited by DGPickett; 12-27-2012 at 06:07 PM..
7 More Discussions You Might Find Interesting
1. Linux
Hi All,
I installed Linux recently on my PC and finding it difficult to boost its performance.
It takes hell lot of time to open Mozilla, text pad , & even the booting process is too slow, many a times I got to manually power off to shutdown the computer.
I will be glad if you could help me... (18 Replies)
Discussion started by: jayfriend
18 Replies
2. Solaris
Is it possible to build Boost 1.35 using Sun Studio 10?
I can build Boost 1.35 using Sun Studio 11 successful. However, i'm unable to build it using Sun Studio 10 using the exact method.
I really apprecaite if any expert can help on this.
Thanks, (2 Replies)
Discussion started by: shingpui
2 Replies
3. Solaris
Hi All
I am working unders Sun Solaris and I am not
"/opt/boost/boost/thread/detail/thread.hpp", line 344: Error: boost::thread::thread(boost::thread&) is not accessible from boost::move(boost::detail::thread_move_t<boost::thread>).
Do you know if there are other solutions other than... (2 Replies)
Discussion started by: manustone
2 Replies
4. Programming
Hi,
Based on the following example in the Boost C++ website:
www. boost.org/doc/libs/1_47_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp]doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp
I tried to create a similar TCP server that waits to accept a client connection... (0 Replies)
Discussion started by: tanlccc
0 Replies
5. Solaris
hi guys,
i downloaded boost1_49_0 tar.gz... then unzip and untar...
how to install boost 1_49_0 in solaris
plz help me (1 Reply)
Discussion started by: coolboys
1 Replies
6. UNIX for Dummies Questions & Answers
Hello all,
I am trying to "make" a database system, VDB (Veritas Data Base), and when I run "make" I receive the following error:
VDBException.h:19: error: expected `)' before '*' token
VDBException.h:20: error: expected `)' before '*' token
VDBException.h:43: error: expected `)' before '*'... (4 Replies)
Discussion started by: Tyler_92
4 Replies
7. Programming
Hi,
I just started using CMake and the Boost Libraries. In this progress I encountered some problems.
One of these problems is combining Boost unit tests with cmake. I don't know how to set the whole project up. I tried to set up a simple test project. This contains a main.cpp a comp.cpp and the... (0 Replies)
Discussion started by: ElCoyote
0 Replies
LEARN ABOUT LINUX
apr-1-config
APR-1-CONFIG(1) User Commands APR-1-CONFIG(1)
NAME
apr-1-config - Return metainformation about apr library
SYNOPSIS
apr-1-config [OPTION]
DESCRIPTION
The apr-1-config program is used to retrieve information about the apr library in the system. It is typically used to compile and link
against the library.
When linking with libtool, an application should do something like:
APR_LIBS="`apr-1-config --link-libtool --libs`"
or when linking directly:
APR_LIBS="`apr-1-config --link-ld --libs`"
An application should use the results of --cflags, --cppflags, --includes, and --ldflags in their build process.
OPTIONS
Known values for OPTION are:
--prefix[=DIR]
change prefix to DIR
--bindir
print location where binaries are installed
--includedir
print location where headers are installed
--cc print C compiler name
--cpp print C preprocessor name and any required options
--cflags
print C compiler flags
--cppflags
print C preprocessor flags
--includes
print include information
--ldflags
print linker flags
--libs print additional libraries to link against
--srcdir
print APR source directory
--installbuilddir print APR build helper directory
--link-ld
print link switch(es) for linking to APR
--link-libtool
print the libtool inputs for linking to APR
--shlib-path-var
print the name of the shared library path env var
--apr-la-file
print the path to the .la file, if available
--apr-so-ext
print the extensions of shared objects on this platform
--apr-lib-target
print the libtool target information
--apr-libtool
print the path to APR's libtool
--version
print the APR's version as a dotted triple
--help print the help
AUTHOR
This manual page was written by Vincent Danjean <Vincent.Danjean@ens-lyon.org> for the Debian project (but may be used by others).
apr-1-config 1.2.2 March 2006 APR-1-CONFIG(1)