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

  • Home
  • SEARCH
  • 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 4081662
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:05:22+00:00 2026-05-20T18:05:22+00:00

I want to compile some C++ software that one can download here . It’s

  • 0

I want to compile some C++ software that one can download here. It’s from 2001. Running make should do the trick.

I’m on Ubuntu 10.10 and I had to change gcc in the makefile to g++ for compilation to work.

Warnings:

Now, the program needs to scan a parameter file. When I compile, I receive several warnings:

g++    -c -o packet_data_agent.o packet_data_agent.cpp
packet_data_agent.cpp: In constructor ‘PACKET_DATA_AGENT::PACKET_DATA_AGENT()’:
packet_data_agent.cpp:34: warning: deprecated conversion from string constant to ‘char*’
packet_data_agent.cpp: In member function ‘void PACKET_DATA_AGENT::initialize(FILE*, FILE*)’:
packet_data_agent.cpp:109: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp:128: warning: format ‘%d’ expects type ‘int*’, but argument 3 has type ‘int32*’
packet_data_agent.cpp:131: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp:136: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp:141: warning: format ‘%d’ expects type ‘int*’, but argument 3 has type ‘int32*’
packet_data_agent.cpp:144: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp:149: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp: In member function ‘int32 PACKET_DATA_AGENT::get_PDU(int32, VIRTUAL_PDU*)’:
packet_data_agent.cpp:213: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp:244: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp: In member function ‘void PACKET_DATA_AGENT::put_PDU(int32, VIRTUAL_PDU*)’:
packet_data_agent.cpp:312: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘int32’
packet_data_agent.cpp: In member function ‘void PACKET_DATA_AGENT::write_statistics(FILE*)’:
packet_data_agent.cpp:393: warning: format ‘%10d’ expects type ‘int’, but argument 3 has type ‘int32’
packet_data_agent.cpp:394: warning: format ‘%10d’ expects type ‘int’, but argument 3 has type ‘int32’
g++ -O4  mobile_ip.o loss_generator.o radio_link_agent.o packet_data_agent.o -o mobile_ip -lm

My Problem:

Those lead to the fact that I can’t parse the included settings file. In the packet_data_agent.h, the variable is declared as int32:

int32 compressed_Internet_header_size;

And the C++ code to scan the parameter file in packet_data_agent.cpp:128:

fscanf(ParameterFile_ptr,"- compressed RTP/UDP/IP header size (in bytes): %d\n",&compressed_Internet_header_size);

But when I run the program, I receive the following error:

!!error in module PACKET-DATA-AGENT: illegal value 0 for the compressed RTP/UDP/IP header size

Although the parameter file clearly has:

- compressed RTP/UDP/IP header size (in bytes): 3

What can I do to make the program correctly parse the parameter file?

Additional information:

  • Size of int on my platform is 4

Here’s my g++ version:

$ g++ -v
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) 

Some very simple debugging:

I changed the source code as follows:

int return_test = fscanf(ParameterFile_ptr,"- compressed RTP/UDP/IP header size (in bytes): %d\n",&compressed_Internet_header_size);
printf ("%d\n", return_test);
printf ("%d\n", compressed_Internet_header_size);

The output is 0, 0. What could that mean? I mean, seriously, it’s right in front of me and it won’t find the parameter?

  • 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-05-20T18:05:23+00:00Added an answer on May 20, 2026 at 6:05 pm

    The warnings:

    The header global.h makes int32 a synonym for long. gcc is issuing warnings when you pass a long into *printf with format code %d because on some platforms (any where an int is 32 bits and a long is 64, or where an int is 16 bits and a long is 32) that will have very bad results.

    You could just change the typedef so that int32 means int rather than long and probably nothing bad will happen.

    The actual error when run:

    [EDITED in the light of new information from original question-asker:]

    It doesn’t seem that this has anything to do with the int/long/int32 stuff: rather, fscanf is failing to read that line of the parameter file. What about earlier lines? Is fscanf returning 1 for them all, or is it actually going wrong earlier in a way that doesn’t make it stop trying to parse the file?

    Assuming that all the earlier fscanf calls are succeeding and this is the first failing one: What happens if you copy-and-paste the fixed boilerplate stuff from the source code into the file? What if you make it just look for a number without any of the fixed boilerplate text? There aren’t any other lines in your parameter file between the file containing the output RTP stream line and the compressed RTP/UDP/IP header size line, are there?

    You may be able to get some idea of where it’s failing as follows: After the offending fscanf call, read a bit of the parameter file using fread, display it, and exit (no point trying to continue, of course; the parser will be completely confused if you do). If, e.g., it’s failed because it ran across a character that didn’t match the constant text in the fscanf format string, this should give you the non-matching character and some of what follows. If it’s failed because it tried to read an integer and saw something it didn’t like, then you should get the first character it couldn’t interpret as part of an integer and some of what follows. Etc.

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

Sidebar

Related Questions

I want to compile the following line of code from http://code.google.com/p/enhsim : enh::eout <<
Here's some example code to give an idea of what I want. int regular_function(void)
I want to compile a project differently, according to a constant defined by #define,
If I want to compile my .NET applications for a 64 bit environment. Do
Just out of curiosity: I know I can tell the compiler if I want
I want to compile multiple java files in my Application without restarting Weblogic and
Sometimes I want to build Python or GCC from scratch just for fun, but
One thing I lack understanding on is how can code compiled for an Intel
OK, first, I dont want any kind of flamewar here or anything like it.
I want to provide some functionality through an extension. This requires (read and execute)

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.