wprintf - undefined reference
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 459 from 2003/7/26
    From: Wroclaw/Poland
    I have to use wide strings in my application for MorphOS (and another OSs). Unfortunately when I compile a source with wprintf function I get:

    "undefined reference to `wprintf'"

    I use wchar_t, std::wstring with no problems.
    Can I use wprintf under MorphOS? How?

    I use the last version of MorphOS SDK and GCC 4.4.5 under MorphOS 3.5 (PowerBookG4)
  • »11.05.14 - 23:14
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Stupid question, but you have included <string> haven't you?
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »12.05.14 - 10:22
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    The new SDK 3.5 is here btw.

    http://www.morphos-team.net/files/sdk-20140508.lha
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »12.05.14 - 10:27
    Profile
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 459 from 2003/7/26
    From: Wroclaw/Poland
    Quote:

    Intuition wrote:
    Stupid question, but you have included <string> haven't you?


    It isn't stupid question. :) However answer is: yes, I was trying to include: string, wchar, stdio, stdlib. MOS SDK includes contain wprintf so it should be available.

    I will need another functions for wide strings/chars. The wprintf is only one simple example.

    BTW - wchar_t and std::wstring work well. :)


    Quote:

    Intuition wrote:
    The new SDK 3.5 is here btw.

    http://www.morphos-team.net/files/sdk-20140508.lha


    Thank you for the info! I will update it today. I like to be updated. :)
  • »12.05.14 - 10:55
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3022 from 2003/3/5
    From: Canada
    The wide-char support in the compiler is very limited, sorry for that. Also, how would you display the output of wprintf if all the MorphOS GUI components do not handle wide-chars? In the end you will need to convert everything to the system code page.
  • »12.05.14 - 12:10
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 459 from 2003/7/26
    From: Wroclaw/Poland
    Quote:

    jacadcaps wrote:
    The wide-char support in the compiler is very limited, sorry for that. Also, how would you display the output of wprintf if all the MorphOS GUI components do not handle wide-chars? In the end you will need to convert everything to the system code page.


    I create game for MorphOS in my small engine where all GUI elements are drawn using OpenGL. I use myown font (3D) system. So wide-strings limitations of MOS GUI aren't problem for me. Currently I am adding support for Unicode and I would like to use wide-strings. The game is compiled also for: iOS, OSX, Windows (and others OSs in future). So I prefer multiplatform techniques.

    Function wprintf isn't very important for me. If other functions for wide-strings work (e.g. reading strings from text file), I will be happy enough. :)

    Now I know that wide-string support is limited so I will test other functions.

    Thank you for help.
  • »12.05.14 - 13:06
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 459 from 2003/7/26
    From: Wroclaw/Poland
    Quote:

    jacadcaps wrote:
    The wide-char support in the compiler is very limited, sorry for that. Also, how would you display the output of wprintf if all the MorphOS GUI components do not handle wide-chars? In the end you will need to convert everything to the system code page.


    I have just tested some functions for wchar/std::wstring. You are right - support of wide chars in MorphOS is very limited. So I won't use standard wide-chars. I have to implement my own simple class for utf-16 strings.
  • »12.05.14 - 19:47
    Profile Visit Website