From: Hiromichi Watari Date: December 20 2011 2:58am Subject: Re: Can't link custom library List-Archive: http://lists.mysql.com/internals/38408 Message-Id: <1324349908.92815.YahooMailNeo@web121501.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Leif,=0AThank you for your feedback.=0AHiromichi=0A=A0=0A=0A----- Origin= al Message -----=0AFrom: Leif Walsh =0ATo: Hiromichi Wata= ri =0ACc: Vladislav Vaintroub ; "internals@stripped" =0ASent: = Monday, December 19, 2011 6:15 PM=0ASubject: Re: Can't link custom library= =0A=0AIf you want to use env variables, linker arguments should go in LDFLA= GS and libraries should go in LDLIBS. =0A=0ASent from my iPhone=0A=0AOn Dec= 19, 2011, at 6:08 PM, Hiromichi Watari wrote:= =0A=0A> =0A> =0A> Hi Vladislav,=0A> Thank you for your reply.=0A> My method= should have worked but CXXFLAGS (including -lfoo) are put into c++ command= line before target object hence functions in foo didn't get picked up.=0A>= I am not very familiar with cmake but obviously your approach is much bett= er.=0A> Thanks,=0A> Hiromichi=0A> =0A> =0A> =0A> ----- Original Message ---= --=0A> From: Vladislav Vaintroub =0A> To: 'Hirom= ichi Watari' ; internals@stripped=0A> Cc:= =0A> Sent: Monday, December 19, 2011 3:40 PM=0A> Subject: RE: Can't link c= ustom library=0A> =0A> =0A>> -----Original Message-----=0A>> From: Hiromich= i Watari [mailto:hiromichiwatari@stripped]=0A>> Sent: Montag, 19. Dezember= 2011 20:13=0A>> To: internals@stripped=0A>> Subject: Can't link cus= tom library=0A>> =0A>> =0A>> =0A>> Hi,=0A>> =0A>> I can't link my custom li= brary with cmake (mysql 5.5), has anyone seen=0A> this ?=0A>> I ended up ad= ding the library file into link.txt after cmake creates it as=0A> a=0A>> wo= rkaround.=0A> =0A> This is very basic CMake. If you link foo to something, = add=0A> TARGET_LINK_LIBRARY(something foo) to CMakeLists.txt=A0 after "some= thing" is=0A> created.=0A> For statically built plugins it is done automati= cally. Anything else needs=0A> TARGET_LINK_LIBRARY. What is the purpose of = the linking your custom library=0A> (and with what would you like to link i= t?) =0A> =0A>> Thanks,=0A>> Hiromichi=0A>> =0A>> --------------------------= ---------------------------------------------=0A>> CXXFLAGS=3D"-L/my_lib_di= r -lfoo"=0A>> export CXXFLAGS=0A>> cmake .=0A>> // modify link.txt as a wor= karound=0A>> make=0A>> =0A>> =0A>> --=0A>> MySQL Internals Mailing List=0A>= > For list archives: http://lists.mysql.com/internals=0A>> To unsubscribe:= =A0 =A0 http://lists.mysql.com/internals=0A> =0A> =0A> =0A> -- =0A> MySQL I= nternals Mailing List=0A> For list archives: http://lists.mysql.com/interna= ls=0A> To unsubscribe:=A0 =A0 http://lists.mysql.com/internals=0A> =0A> -- = =0A> MySQL Internals Mailing List=0A> For list archives: http://lists.mysql= .com/internals=0A> To unsubscribe:=A0 =A0 http://lists.mysql.com/internals= =0A> =0A=0A--=0AMySQL Internals Mailing List=0AFor list archives: http://li= sts.mysql.com/internals=0ATo unsubscribe:=A0 =A0 http://lists.mysql.com/int= ernals