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

Re: [Handle-info] compile c client library



Hi Laurence,

Many thanks for the detailed answers and suggestions.

However I do not quite follow why I need to link any library in the
first place? And what library do I need to link? Since it is not
mentioned in the source code.

Regards,

Peng

On 17 August 2012 14:39, Finston, Laurence <laurence.finston@gwdg.de> wrote:
> LD_LIBRARY_PATH is used at run-time, while LDFLAGS is used at link-time.  In other words, LD_LIBRARY_PATH won't do you any good until you've successfully linked your program.  You'll also need to set LIBS for linking, as below.  If you set them before calling configure, rather than setting them as part of the call to configure, be sure they've been exported.  Sorry if that's obvious, but I thought it best to mention it, just in case.
>
> If this still doesn't work, you could just try linking by hand.  You should see the command that's used when you run `make' and you could just run it from the shell, adding the appropriate flags with their arguments.  If the makefile was generated using Automake, `make -n <target>' will show you what would be run for <target> without actually running it.
>
> If this doesn't work, I could try installing the library myself next week.  I won't be able to do it sooner.  Probably someone else will be able to help you in the meantime, though.
>
> However, I think the C library may be somewhat out-of-date compared to the Java library.  It might actually make more sense to use JNI to call the functions from the Java API from a C or C++ program rather than using the C API, but I don't know this for sure.
>
> Laurence
>
> ________________________________________
> From: Peng Du [eddy.pdu@gmail.com]
> Sent: Friday, August 17, 2012 3:23 PM
> To: Finston, Laurence
> Cc: handle-info@cnri.reston.va.us
> Subject: Re: [Handle-info] compile c client library
>
> Dear Laurence,
>
> Thanks very much for your reply!
>
> I did try to set environment variables, as required by install.txt.
> Specifically, I used "./configure --prefix=$PWD" and accordingly I set
> LD_LIBRARY_PATH=$PWD/lib/perl/5.10/auto/hdllib/ . But the problem
> still remains.
>
> Best wishes,
>
> Peng
>
> On 17 August 2012 14:06, Finston, Laurence <laurence.finston@gwdg.de> wrote:
>> Hello,
>>
>>> I have installed (configure - make - make install) the c version
>>> client libraries. But when I tried to make the programs in hcc5/test,
>>> it keeps reporting "undefined reference to HDLCreate" or "undefined
>>> reference to HDLDelete", depending on the specific program to build.
>>
>>> Would anyone kindly advise me on this? Thanks very much!
>>
>> This is just general information, since it's been a couple of years since I installed the C client library (with some help from one or more people on this  mailing list).  I was, however, encouraged to use the Java library instead at the time.
>>
>> You have to make sure that the library is found when linking.  You can do this with the -l and -L flags.
>> -l is for the name of the library, without the prepended `lib', e.g., `-lpcat' for the library `libpcap'.
>> -L is for the search path for libraries.  So, if you've installed a library in a non-standard location, you can add directories (separated by the `:' character) to the search path with this linker option.
>>
>> Alternatively, you could set the appropriate environment variables.
>>
>> If you type `configure --help', you may get something like this (if the configure script was generated by Autoconf):
>>
>> [...]
>> Some influential environment variables:
>>   CXX         C++ compiler command
>>   CXXFLAGS    C++ compiler flags
>>   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
>>               nonstandard directory <lib dir>
>>   LIBS        libraries to pass to the linker, e.g. -l<library>
>>   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
>>               you have headers in a nonstandard directory <include dir>
>>   CC          C compiler command
>>   CFLAGS      C compiler flags
>> [...]
>>
>> On my (Linux) system, the default search path for libraries is set in `/etc/ld.so.conf'.
>>
>> I hope this helps.
>>
>> Laurence Finston
>> ________________________________________
>> From: handle-info-admin@cnri.reston.va.us [handle-info-admin@cnri.reston.va.us] on behalf of Peng Du [eddy.pdu@gmail.com]
>> Sent: Friday, August 17, 2012 2:20 PM
>> To: handle-info@cnri.reston.va.us
>> Subject: [Handle-info] compile c client library
>>
>> Hello there,
>>
>> I have installed (configure - make - make install) the c version
>> client libraries. But when I tried to make the programs in hcc5/test,
>> it keeps reporting "undefined reference to HDLCreate" or "undefined
>> reference to HDLDelete", depending on the specific program to build.
>>
>> Would anyone kindly advise me on this? Thanks very much!
>>
>> Best regards,
>>
>> Peng
>>
>> _______________________________________________
>> Handle-Info mailing list
>> Handle-Info@cnri.reston.va.us
>> http://www.handle.net/mailman/listinfo/handle-info

_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info