Jump to content

**** unicode and ICU .. need help ??

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
denarced

denarced

    Programmer

  • Members
  • PipPipPipPip
  • 182 posts
ok
hard stuff first, explanations later

the code

#include <stdio.h>

#include <stdlib.h>

#include <unicode/ustring.h>


#define PITUUS 64


int main(void)

{

	char i=0;

	unsigned int t[32],c;

	while((c=getchar())!='\n')

	{

		t[i++]=c;

	}

	int len = sizeof(t)/4;

	UChar *vali = malloc(sizeof(t));

	int32_t *pdest;

	UErrorCode vikakoodi = U_STRING_NOT_TERMINATED_WARNING;

	UErrorCode *ptr_vikakoodi = &vikakoodi;

	UChar *pointteri = u_strFromWCS(NULL,0,pdest,t,4,ptr_vikakoodi);

	return EXIT_SUCCESS;

}


terminal response:

denarced@lapden:~/k/0908mbs$ gcc -o o main.c -ansi
/tmp/ccSFrMYI.o: In function `main':
main.c:(.text+0x8d): undefined reference to `u_strFromWCS_3_6'
collect2: ld returned 1 exit status
[1]+ Done gedit /usr/include/unicode/ustring.h
denarced@lapden:~/k/0908mbs$ gcc -o o main.c
/tmp/ccsCOUOb.o: In function `main':
main.c:(.text+0x8d): undefined reference to `u_strFromWCS_3_6'
collect2: ld returned 1 exit status

I like to do ANSI compatible code ..

you can find info on the u_strFromWCS in ICU 4.0: ustring.h File Reference

why will it not compile
I'm trying to learn using the ICU4C libraries so I can easily do unicode software but **** that library is made for pros ..

as always, help is appreciated

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I don't see you're linking against their libraries? If you don't do that, it won't be able to find the functions.

#3
denarced

denarced

    Programmer

  • Members
  • PipPipPipPip
  • 182 posts

v0id said:

I don't see you're linking against their libraries? If you don't do that, it won't be able to find the functions.

Yes I did
I linked on ustring.h
that takes care of the u_strFromWCS
and ustring.h is linked to unicode/utypes.h
that takes care of the error code