cygwin compiled tree successfully but no output - c++

Trying to compile tree from here (i uncommented appropriate section for cygwin in make script):
http://mama.indstate.edu/users/ice/tree/
$ make
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o tree.o tree.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o unix.o unix.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o html.o html.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o xml.o xml.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o hash.o hash.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o color.o color.c
gcc -O2 -Wall -fomit-frame-pointer -DCYGWIN -c -o strverscmp.o strverscmp.c
gcc -s -o tree.exe tree.o unix.o html.o xml.o hash.o color.o strverscmp.o
$ make install
install -d /usr/bin
install -d /usr/man/man1
if [ -e tree.exe ]; then \
install -s tree.exe /usr/bin/tree.exe; \
fi
install doc/tree.1 /usr/man/man1/tree.1
When i try to run however crickets
No output, no error, nothing. I'm using this compiler (running on 64bit cygwin):
/usr/bin/gcc -> i686-pc-cygwin-gcc.exe
What am i doing wrong, how can i resolve?
EDIT:
More on crickets:
i checked return code (echo $?) and it's 127
However, i also did
$ ls /usr/bin | grep tree
tree.exe

Related

Compiling GMP Library with Mingw on Linux

I try to compile my written C++ code G++ GMP on Windows. My program works fine on Ubuntu. I need to recompile and build the library with Mingw-G++ to eventually compile my final program with Mingw for Windows.
My problem now:
The configure file provided with the library does not look like it can set Mingw-GCC over GCC as compiler anywhere. You can set flags for build and host type but they don't bring the desired results (in my testing).
Im far from being an expert with makefiles and shell scripts, so it might seem like I can't set the compiler, but I think I just overlook something. I can imagine that i need so set the path to Mingw in the configure file myself, but i dont want to break anything YET.
I figured out that there is a CClist in the configure file, which is set to gcc / gcc icc etc... it determines which list of compilers to set depending on the CPU build type (arm/amd64/etc...).<
Another problem: the mingw gcc compiler on linux isn't named gcc unlike on windows but rather x86_64-w64-mingw32-gcc...so the script can't detect it as gcc
Thanks in advance
Edit
After some help from #SuperStormer i set the compiler as mingw32-gcc correctly as my config.status file show, however make check fails with the following warnings:
z.lo spinner.lo trace.lo ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-ar cq .libs/libtests.a memory.o misc.o refmpf.o refmpn.o refmpq.o refmpz.o spinner.o trace.o
libtool: link: x86_64-w64-mingw32-ranlib .libs/libtests.a
libtool: link: ( cd ".libs" && rm -f "libtests.la" && ln -s "../libtests.la" "libtests.la" )
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-bswap.o t-bswap.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-bswap.exe t-bswap.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-bswap.exe t-bswap.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-constants.o t-constants.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-constants.exe t-constants.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-constants.exe t-constants.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-count_zeros.o t-count_zeros.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-count_zeros.exe t-count_zeros.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-count_zeros.exe t-count_zeros.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-hightomask.o t-hightomask.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-hightomask.exe t-hightomask.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-hightomask.exe t-hightomask.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-modlinv.o t-modlinv.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-modlinv.exe t-modlinv.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-modlinv.exe t-modlinv.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-popc.o t-popc.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-popc.exe t-popc.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-popc.exe t-popc.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-parity.o t-parity.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-parity.exe t-parity.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-parity.exe t-parity.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I.. -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c -o t-sub.o t-sub.c
/bin/bash ../libtool --tag=CC --mode=link x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-sub.exe t-sub.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool: link: x86_64-w64-mingw32-gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -o t-sub.exe t-sub.o ./.libs/libtests.a /home/me/Downloads/gmp-6.2.1/.libs/libgmp.a ../.libs/libgmp.a
make[4]: Verzeichnis „/home/me/Downloads/gmp-6.2.1/tests“ wird verlassen
and this
FAIL: t-bswap.exe
FAIL: t-constants.exe
FAIL: t-count_zeros.exe
FAIL: t-hightomask.exe
FAIL: t-modlinv.exe
FAIL: t-popc.exe
FAIL: t-parity.exe
FAIL: t-sub.exe
============================================================================
Testsuite summary for GNU MP 6.2.1
============================================================================
# TOTAL: 8
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 8
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Test-suite-log says: it can't run the .exe file. It's clear to me why it can't, but is there any workaround to create a linux excutable instead? Or is make check expected to fail?
Solution
Quick guess is that make check can't succeed on linux with mingw.
I ran make install, and my program now runs fine (regarding my library issues)
This answer is mostly based on this mailing list post.
Commands ran:
export CC=x86_64-w64-mingw32-gcc
export CC_FOR_BUILD=x86_64-linux-gnu-gcc
./configure --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --enable-cxx
make
Tweak this however you want.

How to fix "fatal error: 'sys/epoll.h' file not found" in OSX?

I was trying to link uWebSocket in MacOs Xcode due to this guide https://medium.com/#tabvn/c-how-to-linking-uwebsocket-in-macos-xcode-9-ef3ffea880e4 but, when I tried to install uWebSocket, I got error EpollEvent.h not found! Can anybody help me with this?
You're right, it can be a bit tricky to compile uWebSockets. After some playing around I found out you need to use libuv instead of epoll, as epoll is part of the Linux kernel and is unavailable on MacOs.
Install with homebrew:
brew install libuv
optionally install openssl and zlib (the makefile below assumes they are installed)
brew install openssl zlib
Change the Makefile to
.PHONY: examples
examples:
# HelloWorld
clang -DLIBUS_USE_LIBUV -DLIBUS_USE_OPENSSL -flto -O3 -c -IuSockets/src uSockets/src/*.c uSockets/src/eventing/*.c
clang++ -flto -O3 -c -std=c++17 -Isrc -IuSockets/src examples/HelloWorld.cpp
clang++ -L/usr/local/lib -luv -lssl -lcrypto -lz -flto -O3 -s *.o -o HelloWorld
rm *.o
# HelloWorldThreaded
clang -DLIBUS_USE_LIBUV -DLIBUS_USE_OPENSSL -flto -O3 -c -IuSockets/src uSockets/src/*.c uSockets/src/eventing/*.c
clang++ -flto -O3 -c -std=c++17 -Isrc -IuSockets/src examples/HelloWorldThreaded.cpp
clang++ -L/usr/local/lib -luv -lssl -lcrypto -lz -lpthread -flto -O3 -s *.o -o HelloWorldThreaded
rm *.o
# EchoServer
clang -DLIBUS_USE_LIBUV -DLIBUS_USE_OPENSSL -flto -O3 -c -IuSockets/src uSockets/src/*.c uSockets/src/eventing/*.c
clang++ -flto -O3 -c -std=c++17 -Isrc -IuSockets/src examples/EchoServer.cpp
clang++ -L/usr/local/lib -luv -lssl -lcrypto -lz -flto -O3 -s *.o -o EchoServer
rm *.o
# EchoServerThreaded
clang -DLIBUS_USE_LIBUV -DLIBUS_USE_OPENSSL -flto -O3 -c -IuSockets/src uSockets/src/*.c uSockets/src/eventing/*.c
clang++ -flto -O3 -c -std=c++17 -Isrc -IuSockets/src examples/EchoServerThreaded.cpp
clang++ -L/usr/local/lib -luv -lssl -lcrypto -lz -lpthread -flto -O3 -s *.o -o EchoServerThreaded
rm *.o
and run make
the macOS don't support epoll, you should develop an unix environment if you want to use epoll.

gcc compile stages with debug options

I am trying to study different compilation stage from GCC.
Compile stage by stage manually
$ g++ -E main.cpp -o main.i # I1
$ g++ -S main.i -o main.s # S1
$ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
$ as main.s -o main.as.o # O1
$ as main.debug.s -o main.as.debug.o # O2
And compile again with "g++ only" completely
$ g++ -c main.cpp -o main.gcc.o # G1
$ g++ -c main.cpp -o main.gcc.debug.o -ggdb -g3 # G2
At the end
main.as.o is identical with main.gcc.o without debug info
but
main.as.debug.o is very different from main.gcc.debug.o
Why? do I miss anything?
here is the tool version
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++-7
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin13.4.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin13.4.0
Configured with: ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)
$ as -v
Apple Inc version cctools-862, GNU assembler version 1.38
UPDATE
with -v and -save-temps options here shows the equivalent commands
#####
# $ g++ -E main.cpp -o main.i # I1
$ cc1plus -E -quiet -v -D__DYNAMIC__ main.cpp -o main.i -fPIC -mmacosx-version-min=10.9.4 -mtune=core2
#####
# $ g++ -S main.i -o main.s # S1
$ cc1plus -fpreprocessed main.i -fPIC -quiet -dumpbase main.i -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.s -version -fdump-tree-all-graph -o main.s
#####
# $ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
$ cc1plus -fpreprocessed main.i -fPIC -quiet -dumpbase maini -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.debug.s -ggdb -g3 -version -o main.debug.s
#####
$ as main.s -o main.as.o # O1
$ as main.debug.s -o main.as.debug.o # O2
#####
# g++ -c main.cpp -o main.gcc.o # G1
$ cc1plus -E -quiet -v -D__DYNAMIC__ main.cpp -fPIC -mmacosx-version-min=10.9.4 -mtune=core2 -fpch-preprocess -o main.ii
$ cc1plus -fpreprocessed main.ii -fPIC -quiet -dumpbase main.cpp -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.gcc.o -version -o main.s
$ as -arch x86_64 -v -force_cpusubtype_ALL -o main.gcc.o main.s
#####
# g++ -c main.cpp -o main.gcc.debug.o -ggdb -g3 # G2
$ cc1plus -E -quiet -v -dD -D__DYNAMIC__ main.cpp -fPIC -mmacosx-version-min=10.9.4 -mtune=core2 -ggdb -g3 -fworking-directory -fpch-preprocess -o main.ii
$ cc1plus -fpreprocessed main.ii -fPIC -quiet -dumpbase main.cpp -mmacosx-version-min=10.9.4 -mtune=core2 -auxbase-strip main.gcc.debug.o -ggdb -g3 -version -o main.s
$ as -arch x86_64 -v -force_cpusubtype_ALL -o main.gcc.debug.o main.s
#####
Oooops, it is trivial failure by me.
Original post
$ g++ -E main.cpp -o main.i # I1
$ g++ -S main.i -o main.s # S1
$ g++ -S main.i -o main.debug.s -ggdb -g3 # S2
I need to call -E also with debug options and serve to the next stage....
Should change to...
$ g++ -E main.cpp -o main.debug.i -ggdb -g3 # I2
$ g++ -S main.debug.i -o main.debug.s -ggdb -g3 # S2'
then the following stages will generate same machine code...

Running HTTP server example from Boost Asio

I'm getting errors when trying to run the HTTP server example that comes with the source of the boost library, under the path: boost_1_59_0/libs/asio/example/cpp11/http/server/.
I already ran this following commands in the boost_1_59_0 directory:
$ ./bootstrap.sh
$ sudo ./bjam install
$ sudo ./b2 install
After installing all targets, i tried to compile the main.cpp and the server.cpp with this command: g++ -std=c++0x -o main main.cpp -I "/home/user/Desktop/boost_1_59_0" -L "/home/user/Desktop/boost_1_59_0/libs/" -lboost_system.
Any suggestion on how to compile this server example?
I linked all files from the boost_1_59_0/libs/asio/example/cpp11/http/server/ folder after the main.cpp, as #Richard Hodges suggested. It still didn't work, i got errors concerning lpthread, so i added it to the compiling options. The program compiled but it failed the execution, returning an error saying that it didn't find the library libboost_system.so.1.59.0. I tried linking the folders with -L /path/to/library but it didn't work.
Solution:
My compilation command:
g++ -std=gnu++0x -o main main.cpp server.cpp connection.cpp connection_manager.cpp reply.cpp mime_types.cpp request_handler.cpp request_parser.cpp -I "/home/user/Desktop/boost_1_59_0" -lboost_system -lpthread
I solved it with this commands:
$ LD_LIBRARY_PATH="/usr/local/lib/"
$ sudo ldconfig
And then I just ran the executable and it worked!
Here's a simple makefile I just concocted that works:
all:server
CPPFLAGS+=-std=c++11 -Wall -pedantic
CPPFLAGS+=-g -O2
CPPFLAGS+=-pthread
LDFLAGS+=-lboost_system
%.o:%.cpp
$(CXX) $(CPPFLAGS) $^ -c -o $#
server:$(patsubst %.cpp,%.o,$(wildcard *.cpp))
$(CXX) $(CPPFLAGS) $^ -o $# $(LDFLAGS)
It runs make:
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection.cpp -c -o connection.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection_manager.cpp -c -o connection_manager.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread main.cpp -c -o main.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread mime_types.cpp -c -o mime_types.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread reply.cpp -c -o reply.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread request_handler.cpp -c -o request_handler.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread request_parser.cpp -c -o request_parser.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread server.cpp -c -o server.o
g++ -std=c++11 -Wall -pedantic -g -O2 -pthread connection.o connection_manager.o main.o mime_types.o reply.o request_handler.o request_parser.o server.o -o server -lboost_system
And the test program runs:
$ ./server 0.0.0.0 9889 . &
$ GET http://localhost:9889/main.cpp > main.cpp.0
Check the files
$ md5sum main.cpp*
be5dc1c26b5942101a7895de6baedcee main.cpp
be5dc1c26b5942101a7895de6baedcee main.cpp.0
Don't forget to kill the server when you're done

C++ linking error when linking postgresql

When compiling my code I run into an issue as follows:
io.cpp:21: undefined reference to `PQconnectdb'
as well as all other instances of missing postgres function calls occurring in my code. Obviously this is a linking problem, I'm just not sure what the link issue is.
I'm compiling with the following:
mpiCC -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ decisioning_mpi.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ io.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ calculations.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ rules.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Instrument.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Backtest_Parameter_CPO.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Backtest_Trade_CPO.cpp
g++ -c -O2 -g -Wall -Werror -I /usr/include/postgresql/ Data_Bar.cpp
mpiCC -o decisioning_mpi -O2 -g -Wall -Werror -L/usr/lib -lm -lpq decisioning_mpi.o
io.o calculations.o rules.o Instrument.o Backtest_Parameter_CPO.o Backtest_Trade_CPO.o Data_Bar.o
It should be noted that this is the correct directory for libpq-fe.h and that I'm linking pq, so I'm not exactly sure why the postgres functions aren't linking correctly. I'm running Ubuntu 12.04 and installed psql (PostgreSQL) 9.1.6 from synaptic. As well I'll short circuit this, I am using #include "libpq-fe.h".
Any ideas on how I can get this linking issue resolved?
put -L/usr/lib/ -lm -lpq in the end of link command, the linker can then find the symbols
mpiCC -o decisioning_mpi -O2 -g -Wall -Werror decisioning_mpi.o io.o \
calculations.o rules.o Instrument.o Backtest_Parameter_CPO.o \
Backtest_Trade_CPO.o Data_Bar.o -L/usr/lib -lm -lpq
GCC Link Reference:
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html