public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Updated: libunistring 0.9.5-1
       [not found] <55275D48.9070009@xs4all.nl>
@ 2015-04-10 14:58 ` Nellis, Kenneth
  2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nellis, Kenneth @ 2015-04-10 14:58 UTC (permalink / raw)
  To: The Cygwin Mailing List

I thought I'd play with libunistring so for the first
time I downloaded the following packages:

$ cygcheck -c libunistring-devel libunistring-doc libunistring2
Cygwin Package Information
Package              Version        Status
libunistring-devel   0.9.5-1        OK
libunistring-doc     0.9.5-1        OK
libunistring2        0.9.5-1        OK
$

Then wrote what I thought would be a trivial first program.

#include <uniname.h>
#include <stdio.h>
int main (void)
{
    char buffer[UNINAME_MAX] = "(undefined)";
    ucs4_t uc = 0x20AC; /* euro symbol */
    unicode_character_name (uc, buffer);
    puts (buffer);
    return 0;
}

It compiles fine, but I don't know how to get it to link.

$ gcc -lunistring unicode_character_name.c
/tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): undefined reference to `unicode_character_name'
/tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `unicode_character_name'
collect2: error: ld returned 1 exit status
$

The only relevant library file that I found in the installation
(https://cygwin.com/packages/x86_64/libunistring-devel/libunistring-devel-0.9.5-1)
is usr/lib/libunistring.dll.a, the "dll" part of which seems odd to me.
Specifying -lunistring.dll produced the same error message.

Ideas?

--Ken Nellis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Updated: libunistring 0.9.5-1
  2015-04-10 14:58 ` Updated: libunistring 0.9.5-1 Nellis, Kenneth
  2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
@ 2015-04-10 15:18   ` René Berber
  2015-04-10 15:19   ` Marco Atzeri
  2 siblings, 0 replies; 5+ messages in thread
From: René Berber @ 2015-04-10 15:18 UTC (permalink / raw)
  To: cygwin

On 4/10/2015 9:58 AM, Nellis, Kenneth wrote:

[snip]
> It compiles fine, but I don't know how to get it to link.
> 
> $ gcc -lunistring unicode_character_name.c

The order is important on Cygwin, try:

gcc -o unicode_character_name unicode_character_name.c -lunistring

> libunistring.dll.a, the "dll" part of which seems odd to me

That's the way it works, a stub library (needed by the linker) with the
contents of the (real) dynamic library (i.e. there is a corresponding
lib<name>.dll).
-- 
René Berber


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Updated: libunistring 0.9.5-1
  2015-04-10 14:58 ` Updated: libunistring 0.9.5-1 Nellis, Kenneth
@ 2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
  2015-04-10 15:22     ` Nellis, Kenneth
  2015-04-10 15:18   ` René Berber
  2015-04-10 15:19   ` Marco Atzeri
  2 siblings, 1 reply; 5+ messages in thread
From: Lemke, Michael  ST/HZA-ZSW @ 2015-04-10 15:18 UTC (permalink / raw)
  To: Nellis, Kenneth; +Cc: cygwin

>On Friday, April 10, 2015 4:59 PM Nellis, Kenneth wrote:
>Then wrote what I thought would be a trivial first program.
...
>It compiles fine, but I don't know how to get it to link.
>
>$ gcc -lunistring unicode_character_name.c
>/tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): undefined reference to `unicode_character_name'
>/tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `unicode_character_name'
>collect2: error: ld returned 1 exit status
>$
>
>Ideas?

Try

$ gcc unicode_character_name.c -lunistring

Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Updated: libunistring 0.9.5-1
  2015-04-10 14:58 ` Updated: libunistring 0.9.5-1 Nellis, Kenneth
  2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
  2015-04-10 15:18   ` René Berber
@ 2015-04-10 15:19   ` Marco Atzeri
  2 siblings, 0 replies; 5+ messages in thread
From: Marco Atzeri @ 2015-04-10 15:19 UTC (permalink / raw)
  To: cygwin



On 4/10/2015 4:58 PM, Nellis, Kenneth wrote:
> I thought I'd play with libunistring so for the first
> time I downloaded the following packages:
>
>
> Then wrote what I thought would be a trivial first program.
>
> #include <uniname.h>
> #include <stdio.h>
> int main (void)
> {
>      char buffer[UNINAME_MAX] = "(undefined)";
>      ucs4_t uc = 0x20AC; /* euro symbol */
>      unicode_character_name (uc, buffer);
>      puts (buffer);
>      return 0;
> }
>
> It compiles fine, but I don't know how to get it to link.
>
> $ gcc -lunistring unicode_character_name.c
> /tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): undefined reference to `unicode_character_name'
> /tmp/ccaJ19ki.o:unicode_character_name.c:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `unicode_character_name'
> collect2: error: ld returned 1 exit status
> $
>

try in this way:

$ gcc  unicode_character_name.c  -lunistring

order matters on Windows

> --Ken Nellis

Regards MArco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Updated: libunistring 0.9.5-1
  2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
@ 2015-04-10 15:22     ` Nellis, Kenneth
  0 siblings, 0 replies; 5+ messages in thread
From: Nellis, Kenneth @ 2015-04-10 15:22 UTC (permalink / raw)
  To: cygwin

> From: Lemke, Michael ST/HZA-ZSW 
> 
> Try
> 
> $ gcc unicode_character_name.c -lunistring
> 
> Michael

Sho'nuff! Thanx! 

--Ken, hoping his question wasn't too ignorant

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-10 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <55275D48.9070009@xs4all.nl>
2015-04-10 14:58 ` Updated: libunistring 0.9.5-1 Nellis, Kenneth
2015-04-10 15:18   ` Lemke, Michael  ST/HZA-ZSW
2015-04-10 15:22     ` Nellis, Kenneth
2015-04-10 15:18   ` René Berber
2015-04-10 15:19   ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).