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 SUSE
xkblibraryversion
XkbLibraryVersion(3) XKB FUNCTIONS XkbLibraryVersion(3)
NAME
XkbLibraryVersion - Determines the compatibility of a library at runtime.
SYNOPSIS
Bool XkbLibraryVersion (int *lib_major_in_out, int *lib_minor_in_out);
ARGUMENTS
lib_major_in_out
Specifies and returns the major Xkb library version.
lib_minor_in_out
Specifies and returns the minor Xkb library version.
DESCRIPTION
If an application is dynamically linked, both the X server and the client-side X library must contain the Xkb extension in order for the
client to use the Xkb extension capabilities. Therefore a dynamically linked application must check both the library and the server for
compatibility before using Xkb function calls. A properly written program must check for compatibility between the version of the Xkb
library that is dynamically loaded and the one used when the application was built. It must then check the server version for compatibility
with the version of Xkb in the library.
If your application is statically linked, you must still check for server compatibility and may check library compatibility. (It is possi-
ble to compile against one set of header files and link against a different, incompatible, version of the library, although this should not
normally occur.)
Pass the symbolic value XkbMajorVersion in lib_major_in_out and XkbMinorVersion in lib_minor_in_out. These arguments represent the version
of the library used at compile time. The XkbLibraryVersion function backfills the major and minor version numbers of the library used at
run time in lib_major_in_out and lib_minor_in_out. If the versions of the compile time and run time libraries are compatible, XkbLi-
braryVersion returns True, otherwise, it returns False.
In addition, in order to use the Xkb extension, you must ensure that the extension is present in the server and that the server supports
the version of the extension expected by the client. Use XkbQueryExtension to do this, as described in the next section.
RETURN VALUES
True The XkbLibraryVersion returns True if the versions of the compile time and run time libraries are compatible.
False The XkbLibraryVersion returns False if the versions of the compile time and run time libraries are not compatible.
SEE ALSO
XkbMajorVersion(3), XkbMinorVersion(3), XkbQueryExtension(3)
X Version 11 libX11 1.3.2 XkbLibraryVersion(3)