Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9309113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:47:20+00:00 2026-06-19T00:47:20+00:00

I have a mass of code that I’m trying to convert from g++ version

  • 0

I have a mass of code that I’m trying to convert from g++ version 4.2.2 to 4.7.2. In version 4.2.2 and prior, it seems that uint was defined as unsigned int. I know this is not a standard c++ thing and that real men write ISO standard C++, but I was wondering if there was a flag or some sort of way to make g++ accept uint without modifying all the source files. Can I change CPPFLAGS or add a switch to the g++ runline? My googles yielded nothing. I have some source files coming from a different group at work and I’d like to accept their uint transgressions.

e.g.

#include <iostream>
#include <fstream>
#include <assert.h>
using namespace std;
int main(void) {
    uint foo = 0xdeadbeef;
    cout<<hex<<foo<<endl;
}

yields:

/tmp/rbroger1/gcc_update rbroger1 @ plxc25804 
% /usr/intel/pkgs/gcc/4.2.2/bin/g++ ~/tmp.cc && ./a.out
deadbeef
/tmp/rbroger1/gcc_update rbroger1 @ plxc25804
% /usr/intel/pkgs/gcc/4.7.2/bin/g++ ~/tmp.cc && ./a.out
/nfs/pdx/home/rbroger1/tmp.cc: In function 'int main()':
/nfs/pdx/home/rbroger1/tmp.cc:8:5: error: 'uint' was not declared in this scope
/nfs/pdx/home/rbroger1/tmp.cc:8:10: error: expected ';' before 'foo'
/nfs/pdx/home/rbroger1/tmp.cc:9:16: error: 'foo' was not declared in this scope
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:47:21+00:00Added an answer on June 19, 2026 at 12:47 am

    You can add a -include a_file_where_there_is_typedef_to_uint.h flag to g++

    From the manual

    -include file

    Process file as if #include “file” appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor’s working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the #include “…” search chain as normal.

    If multiple -include options are given, the files are included in the order they appear on the command line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have this code that grabs a bunch of data from the database,
I have a large mass of integers that I'm reading from a file. All
We have a mass emailing tool (.net based) that we developed in house. html
I have heard people state that Code Generators and T4 templates should not be
I have a model with the following mass assignment protection defined as: attr_accessible :attachment,
I'm porting some code from Java to C, and so far things have gone
I have some TreeView's in my winform application. I am trying to make mass
I need to send newsletters. I have already a PHP script that sends mass
I have a batch file that automates copying a bunch of files from one
I have a code that has a large number of malloc s and device-specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.