cchar compiler error.

This is a discussion on cchar compiler error. within the C Programming forums, part of the General Programming Boards category; for this func mvin_wch, which in the manual looks like this. int mvin_wch(int y, int x, cchar_t *wcval); This make ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Location
    Stockholm, Sweden
    Posts
    20

    cchar compiler error.

    for this func mvin_wch, which in the manual looks like this.

    int mvin_wch(int y, int x, cchar_t *wcval);

    This make me expect that I should have a varable of type cchar_t

    But when I try - just for a test, write a very simple app to create a variable of cchar_t

    Code:
    #include <stdio.h>
    #include <curses.h>
    
    int main(void)
    {
        cchar_t ccht;
     return 0;
    }
    And then compile: gcc -lncursesw -g test.c -o test -Wall
    I got compiler error 'cchar_t undeclared'

    mvin_wch is in ncurses, and therefore I expect that cchar_t should be supported when including the curses header file,

    What am I doing wrong.?
    I should not need to use intscr() and endwin() just for this test.?
    Last edited by #define whatevr; 04-18-2011 at 06:20 AM.

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    Is the location of curses.h in your standard INCLUDE path?

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,751
    Looking at the header file here, it seems that cchar_t is a conditional compilation option.

    This worked here
    gcc -D_XOPEN_SOURCE_EXTENDED bar.c

    See also Feature Test Macros - The GNU C Library
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Mar 2011
    Location
    Stockholm, Sweden
    Posts
    20
    Quote Originally Posted by rags_to_riches View Post
    Is the location of curses.h in your standard INCLUDE path?
    Yes it is, I am building an viewer based on curses - and I recompile it a lot of times every day, so I am sure it is.

  5. #5
    Registered User
    Join Date
    Mar 2011
    Location
    Stockholm, Sweden
    Posts
    20
    Quote Originally Posted by Salem View Post
    Looking at the header file here, it seems that cchar_t is a conditional compilation option.

    This worked here
    gcc -D_XOPEN_SOURCE_EXTENDED bar.c

    See also Feature Test Macros - The GNU C Library
    Doesn't work to me. Can I kindley ask you to see what happens if you use the same e switches as I posted that I do.?

  6. #6
    Registered User
    Join Date
    Mar 2011
    Location
    Stockholm, Sweden
    Posts
    20
    Quote Originally Posted by Salem View Post
    Looking at the header file here, it seems that cchar_t is a conditional compilation option.

    This worked here
    gcc -D_XOPEN_SOURCE_EXTENDED bar.c

    See also Feature Test Macros - The GNU C Library
    I Misspelled the switch to the compiler, I retried - and as compile switch it works well, and also as #define in top of the file.

    Thank you for the help.

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,751
    I get the expected error: ‘cchar_t’ undeclared (first use in this function)
    Expected, because the only option of note is a linker option (for the library), not a compiler/pre-processor option.

    If it "didn't work for you", all I can suggest is you read your curses.h header file, and see how cchar_t is declared.
    Like for me, it is protected by a conditional compilation flag.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Registered User
    Join Date
    Mar 2011
    Location
    Stockholm, Sweden
    Posts
    20
    Did you see my post above.? I solved it with the info you gave me, thank you.
    Last edited by #define whatevr; 04-18-2011 at 06:18 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 12-13-2010, 10:02 PM
  2. GCC compiler giving syntax error before 'double' error
    By dragonmint in forum Linux Programming
    Replies: 4
    Last Post: 06-02-2007, 06:38 PM
  3. Compiler error error C2065: '_beginthreadex; : undeclared identifier
    By Roaring_Tiger in forum Windows Programming
    Replies: 3
    Last Post: 04-29-2003, 02:54 AM
  4. Compiler error or human error?
    By skyruler54 in forum C++ Programming
    Replies: 6
    Last Post: 09-06-2002, 03:27 PM
  5. fatal error C1001: INTERNAL COMPILER ERROR
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-21-2002, 01:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21