Find the answer to your Linux question:
Results 1 to 6 of 6
Where can I get the description of following g++ compilation flags: -D_UNIX -D_REENTRANT -DUNICODE -D_UNICODE -D__LITTLE_ENDIAN__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_LARGE_FILES -DLINUX -D__x86__ -D__linux__ -D____ -D__OSVERSION__=2...
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    17

    g++ compilation flags description

    Where can I get the description of following g++ compilation flags:

    -D_UNIX
    -D_REENTRANT
    -DUNICODE
    -D_UNICODE
    -D__LITTLE_ENDIAN__
    -D_FILE_OFFSET_BITS=64
    -D_LARGEFILE_SOURCE
    -D_LARGEFILE64_SOURCE
    -D_LARGE_FILES
    -DLINUX
    -D__x86__
    -D__linux__
    -D____
    -D__OSVERSION__=2

  2. #2
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    There is only one compiler flag used in your sample: '-D' Each of them performs the equivalent of "#define" in the source code. This is common practice for conditional compilation to suit differing target architectures.
    --- rod.
    Stuff happens. Then stays happened.

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    17
    Rod,
    Where can I get description of these #defines? Or is there any standard or particular file where they might have defined?

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    No. They are entirely dependent upon the source code being compiled. Some are "common" in that they are used in a number of programs for cross-platform operation. Example: the __LITTLE_ENDIAN__ flag is telling the code to use the code for Intel type of processors, vs Sparc or MC68K processors. From your question and cluelessness I have to assume that this is for a class?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Oct 2009
    Posts
    17
    Rubberman,
    I am trying to build my entire C++ code base and not just a class. These options are there in my make file but I am not getting from where they come or why some of them are there.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,961
    You say they are in your makefile. How did you generate the makefile? With an IDE? If so, what was it? Also, what type of application are you building?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...