Re: Can't link custom library

Leif Walsh <[email protected]>
Newsgroups gmane.comp.db.mysql.devel
Message-ID <[email protected]>
If you want to use env variables, linker arguments should go in LDFLAGS and libraries should go in LDLIBS. 

Sent from my iPhone

On Dec 19, 2011, at 6:08 PM, Hiromichi Watari <[email protected]> wrote:

> 
> 
> Hi Vladislav,
> Thank you for your reply.
> 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.
> I am not very familiar with cmake but obviously your approach is much better.
> Thanks,
> Hiromichi
> 
> 
> 
> ----- Original Message -----
> From: Vladislav Vaintroub <[email protected]>
> To: 'Hiromichi Watari' <[email protected]>; [email protected]
> Cc: 
> Sent: Monday, December 19, 2011 3:40 PM
> Subject: RE: Can't link custom library
> 
> 
>> -----Original Message-----
>> From: Hiromichi Watari [mailto:[email protected]]
>> Sent: Montag, 19. Dezember 2011 20:13
>> To: [email protected]
>> Subject: Can't link custom library
>> 
>> 
>> 
>> Hi,
>> 
>> I can't link my custom library with cmake (mysql 5.5), has anyone seen
> this ?
>> I ended up adding the library file into link.txt after cmake creates it as
> a
>> workaround.
> 
> This is very basic CMake. If you link foo to something, add
> TARGET_LINK_LIBRARY(something foo) to CMakeLists.txt  after "something" is
> created.
> For statically built plugins it is done automatically. Anything else needs
> TARGET_LINK_LIBRARY. What is the purpose of the linking your custom library
> (and with what would you like to link it?) 
> 
>> Thanks,
>> Hiromichi
>> 
>> -----------------------------------------------------------------------
>> CXXFLAGS="-L/my_lib_dir -lfoo"
>> export CXXFLAGS
>> cmake .
>> // modify link.txt as a workaround
>> make
>> 
>> 
>> --
>> MySQL Internals Mailing List
>> For list archives: http://lists.mysql.com/internals
>> To unsubscribe:    http://lists.mysql.com/internals
> 
> 
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals
> 

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.