help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static linking of libraries


From: Paul Pluzhnikov
Subject: Re: Static linking of libraries
Date: Tue, 21 Mar 2006 07:07:36 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Paulo Matos" <pocmatos@gmail.com> writes:

> Found the -static flag... Hope it does the trick! :)

This is *the* wrong way to solve this problem.
Your binary may crash and/or not work correctly when moved to a
different machine.

See this thread for gory details:
http://groups.google.com/group/comp.os.linux.development.apps/browse_frm/thread/f664f8f7c19a4a7b

Correct way to ensure that you don't depend on dynamic versions of
log4cpp and glpk, while still making your binary portable to other systems:

  g++ ... -o myapp mayapp.o ... -Wl,-Bstatic -llog4cpp -lglpk -Wl,-Bdynamic

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]