open bracket and underscore before function opening bracket

This is a discussion on open bracket and underscore before function opening bracket within the C Programming forums, part of the General Programming Boards category; Hi I've seen this around and I'm not sure what it is for. I've seen it in other projects and ...

  1. #1
    Registered User redruby147's Avatar
    Join Date
    Sep 2008
    Location
    England
    Posts
    37

    open bracket and underscore before function opening bracket

    Hi I've seen this around and I'm not sure what it is for. I've seen it in other projects and it compiles fine but when I tried:

    Code:
    file_chooser_directory = gtk_file_chooser_button_new (_("Select a directory"),
                                                                  GTK_FILE_CHOOSER_ACTION_OPEN);
    I recieved the following from gcc:

    Code:
    /tmp/ccbrQALM.o: In function `main':
    /media/disk/cleaner/src/main.c:175: undefined reference to `_'
    collect2: ld returned 1 exit status
    Yet if I remove "_", gcc has no complaints. Any insight is appreciated. Thanks.
    Last edited by redruby147; 12-19-2010 at 03:51 PM.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    I'm guessing it's something like the L for wide-string (or the T for TCHAR in windows), although I'm not familiar with a system that used that particular notation.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,676
    Iit's for internationalization, multi-language, etc. It's used in conjunction with some other tools that compile dictionary files, and then go through your code looking up translations/localizations of the strings you specify. Check GNU gettext: GNU gettext - Wikipedia, the free encyclopedia.

Popular pages Recent additions subscribe to a feed

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