Gentoo Archives: gentoo-user

From: Mike Gilbert <floppymaster@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [Slightly OT] Linking to a non-standard library installed using portage
Date: Thu, 03 Feb 2011 19:17:59
Message-Id: AANLkTi=rD3e6S_A6zbZeFCb1U8jkS7+tn27o4NtihiM9@mail.gmail.com
In Reply to: [gentoo-user] [Slightly OT] Linking to a non-standard library installed using portage by Mark Knecht
1 On Thu, Feb 3, 2011 at 1:39 PM, Mark Knecht <markknecht@×××××.com> wrote:
2 > What do I link to?
3 >
4 > I've tried various things like this but none seem to find the library correctly:
5 >
6 > mark@c2stable ~/CODE/CUDA/Mark $ nvcc -L/usr/lib64/libta_lib
7 > ta-lib-ma.cu -o ta-lib-ma
8 > /tmp/tmpxft_00000a8b_00000000-13_ta-lib-ma.o: In function `main':
9 > tmpxft_00000a8b_00000000-1_ta-lib-ma.cudafe1.cpp:(.text+0x9f):
10 > undefined reference to `TA_SMA'
11 > collect2: ld returned 1 exit status
12
13 I haven't used nvcc, but I assume it works like gcc. If so, you'll
14 want to use the -L option for the library path and the -l option to
15 specify the library name. For example:
16
17 nvcc ta-lib-ma.cu -o ta-lib-ma -L/usr/lib64 -lta_lib