compilation error

Asked by manish shivare

hello sir,
i am try rohc compression for my program.
before this i used rohc_first_application for checking my rohc installion.
my rohc-1.6.1 passed all test.
but when i give command-
$gcc -o rohc_first_application -g -Wall $(pkg-config rohc --libs) rohc_first_application.c

then error show
Package rohc was not found in the pkg-config search path.
Perhaps you should add the directory containing `rohc.pc'
to the PKG_CONFIG_PATH environment variable
No package 'rohc' found
gcc: error: rohc_first_application.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.

Thank You in Advance..!!
and i also try
$ gcc -o rohc_first_application -g -Wall -lrohc_common -lrohc_comp -lm rohc_first_application.c
then error show
rohc_first_application.c:2:23: fatal error: rohc_comp.h: No such file or directory
compilation terminated.

i already added PKG_CONFIG_PATH environment variable in ./bashrc file.
path is
PKG_CONFIG_PATH=/home/manish/ns2/rohc-1.6.1/
but it is show above error.
please help me.

Question information

Language:
English Edit question
Status:
Expired
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#1

Hi,

Did you install the ROHC library (make install at step 10 of http://rohc-lib.org/wiki/doku.php?id=library-install-sources#native_build_on_unix-like_systems ) ? If not, do it before using pkg-config.

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#2

hello sir,
thanks for reply
i am give a list of command which is executed by me;
$./autogen.sh
$make
$make all
$sudo make install
$ ./configure --enable-doc
 $ make html
$./configure --enable-rohc-tests
make check
output is

======================================
328 of 328 tests failed
See test/non_regression/test-suite.log
Please report to http://rohc-lib.org/
======================================
make[4]: *** [test-suite.log] Error 1
make[4]: Leaving directory `/home/manish/rohc-1.6.1/test/non_regression'
make[3]: *** [check-TESTS] Error 2
make[3]: Leaving directory `/home/manish/rohc-1.6.1/test/non_regression'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/manish/rohc-1.6.1/test/non_regression'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/manish/rohc-1.6.1/test'
make: *** [check-recursive] Error 1

or when use $ ./configure --enable-rohc-tests --enable-rohc-tests-valgrind
but same output show.
please help me.

Revision history for this message
manish shivare (mshivare13) said :
#3

and before non regression all test is passed

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#4

Step 5 is mandatory for running tests.

Didier

Revision history for this message
manish shivare (mshivare13) said :
#5

thanks for reply
i was also do the step no. 5
i download rohc-tests-1.6.1.tar.bz2
and murge into rohc-1.6.1 directory.
but when use
$./configure or $sudo ./configure output is-
config.status: error: cannot find input file: `test/non_regression/Makefile.in'
and when use $autogen.sh
Running libtoolize... done
Running autoconf... done
Running autoheader... done
Running automake... failed
Running automake again with errors unmasked:
configure.ac:859: required file `test/non_regression/Makefile.in' not found
please help me.
thank u in advance

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#6

Hello,

Please try again with clean extraction from release archives, something probably went wrong with yours. I've just tried with success the following commands:

$ wget https://launchpad.net/rohc/1.6.x/1.6.1/+download/rohc-1.6.1.tar.bz2
$ wget https://launchpad.net/rohc/1.6.x/1.6.1/+download/rohc-tests-1.6.1.tar.bz2
$ tar xjf rohc-1.6.1.tar.bz2
$ tar xjf rohc-tests-1.6.1.tar.bz2
$ cd rohc-1.6.1
$ ./configure
$ make all
$ make check

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#7

Thanks Didier Barvaux, that solved my question.

Revision history for this message
manish shivare (mshivare13) said :
#8

thanks for reply your solution is very helpful for me, that solved my problem.
after this require any library path set becaue when i run your rohc_first_application.
it is give follwing output
$gcc -o rohc_first_application -g -Wall $(pkg-config rohc --libs) rohc_first_application.c
rohc_first_application.c:3:1: warning: data definition has no type or storage class [enabled by default]
rohc_first_application.c:3:1: warning: type defaults to ‘int’ in declaration of ‘comp’ [-Wimplicit-int]
rohc_first_application.c:3:8: warning: initialization makes integer from pointer without a cast [enabled by default]
rohc_first_application.c:3:1: error: initializer element is not constant
rohc_first_application.c:4:1: error: expected identifier or ‘(’ before ‘if’
rohc_first_application.c:11:1: warning: data definition has no type or storage class [enabled by default]
rohc_first_application.c:11:1: warning: type defaults to ‘int’ in declaration of ‘status’ [-Wimplicit-int]
rohc_first_application.c:11:1: error: conflicting types for ‘status’
rohc_first_application.c:9:6: note: previous declaration of ‘status’ was here
rohc_first_application.c:11:1: warning: implicit declaration of function ‘rohc_comp_enable_profiles’ [-Wimplicit-function-declaration]
rohc_first_application.c:18:36: error: ‘ROHC_PROFILE_TCP’ undeclared here (not in a function)
rohc_first_application.c:19:1: error: expected identifier or ‘(’ before ‘if’
rohc_first_application.c:25:15: error: variably modified ‘ip_packet’ at file scope
rohc_first_application.c:27:15: error: variably modified ‘rohc_packet’ at file scope
rohc_first_application.c:34:1: warning: data definition has no type or storage class [enabled by default]
rohc_first_application.c:34:1: warning: type defaults to ‘int’ in declaration of ‘ret’ [-Wimplicit-int]
rohc_first_application.c:36:22: warning: passing argument 1 of ‘rohc_compress2’ makes pointer from integer without a cast [enabled by default]
In file included from rohc_first_application.c:2:0:
/usr/local/include/rohc_comp.h:298:17: note: expected ‘struct rohc_comp * const’ but argument is of type ‘int’
rohc_first_application.c:36:22: error: initializer element is not constant
rohc_first_application.c:37:1: error: expected identifier or ‘(’ before ‘if’
rohc_first_application.c:42:1: warning: data definition has no type or storage class [enabled by default]
rohc_first_application.c:42:1: warning: type defaults to ‘int’ in declaration of ‘rohc_free_compressor’ [-Wimplicit-int]
rohc_first_application.c:42:1: warning: parameter names (without types) in function declaration [enabled by default]
rohc_first_application.c:42:1: error: conflicting types for ‘rohc_free_compressor’
In file included from rohc_first_application.c:2:0:
/usr/local/include/rohc_comp.h:277:18: note: previous declaration of ‘rohc_free_compressor’ was here

if require a set path please send me exact path becuse i am beginner for the ubuntu 12.10.
waiting for your reply
thank u

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#9

Please copy/paste the content of rohc_first_application.c to get some help.

Didier

Revision history for this message
manish shivare (mshivare13) said :
#10

manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -o simple_rohc_program -g -Wall $(pkg-config rohc --libs) simple_rohc_program.c
code is given by you-
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

/**
 * @file simple_rohc_program.c
 * @brief A simple program that uses the compression part of the ROHC library
 * @author Didier Barvaux <email address hidden>
 *
 * This simple program was first published on the mailing list dedicated to the
 * ROHC library. Ask your questions about this example there.
 *
 * Mailing list subscription: http://launchpad.net/~rohc/+join
 * Mailing list public archives: http://lists.launchpad.net/rohc/
 */

/* system includes */
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>

#include "config.h" /* for HAVE_*_H definitions */

#if HAVE_WINSOCK2_H == 1
# include <winsock2.h> /* for htons() on Windows */
#endif
#if HAVE_ARPA_INET_H == 1
# include <arpa/inet.h> /* for htons() on Linux */
#endif

/* includes required to use the compression part of the ROHC library */
#include <rohc.h>
#include <rohc_comp.h>

/** The size (in bytes) of the buffers used in the program */
#define BUFFER_SIZE 2048

/** The payload for the fake IP packet */
#define FAKE_PAYLOAD "hello, ROHC world!"

static int gen_random_num(const struct rohc_comp *const comp,
                          void *const user_context);

/**
 * @brief The main entry point for the simple ROHC program
 *
 * @param argc The number of arguments given to the program
 * @param argv The table of arguments given to the program
 * @return 0 in case of success, 1 otherwise
 */
int main(int argc, char **argv)
{
 struct rohc_comp *compressor; /* the ROHC compressor */
 unsigned char ip_packet[BUFFER_SIZE]; /* the buffer that will contain
                                            the IPv4 packet to compress */
 size_t ip_packet_len; /* the length (in bytes) of the
                                            IPv4 packet */
 unsigned char rohc_packet[BUFFER_SIZE]; /* the buffer that will contain
                                            the resulting ROHC packet */
 size_t rohc_packet_len; /* the length (in bytes) of the
                                            resulting ROHC packet */
 unsigned int seed;
 size_t i;
 int ret;

 /* initialize the random generator */
 seed = time(NULL);
 srand(seed);

 /* Create a ROHC compressor with small CIDs, no jamming and no adaptation
  * to encapsulation frames.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga721fd34fc0cd9e1d789b693eb6bb6485
  * for details about rohc_alloc_compressor in the API documentation.
  */
 printf("\ncreate the ROHC compressor\n");
 compressor = rohc_alloc_compressor(ROHC_SMALL_CID_MAX, 0, 0, 0);
 if(compressor == NULL)
 {
  fprintf(stderr, "failed create the ROHC compressor\n");
  goto error;
 }

 /* set the callback for random numbers */
 if(!rohc_comp_set_random_cb(compressor, gen_random_num, NULL))
 {
  fprintf(stderr, "failed to set the callback for random numbers\n");
  goto release_compressor;
 }

 /* Enable the compression profiles you need (comment or uncomment some lines).
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga1a444eb91681521f726712a60a4df867
  * for details about rohc_activate_profile in the API documentation.
  */
 printf("\nenable several ROHC compression profiles\n");
 rohc_activate_profile(compressor, ROHC_PROFILE_UNCOMPRESSED);
 //rohc_activate_profile(compressor, ROHC_PROFILE_UDP);
 rohc_activate_profile(compressor, ROHC_PROFILE_IP);
 //rohc_activate_profile(compressor, ROHC_PROFILE_UDPLITE);
 //rohc_activate_profile(compressor, ROHC_PROFILE_RTP);
 //rohc_activate_profile(comp, ROHC_PROFILE_ESP);

 /* create a fake IP packet for the purpose of this simple program */
 printf("\nbuild a fake IP packet\n");
 ip_packet[0] = 4 << 4; /* IP version 4 */
 ip_packet[0] |= 5; /* IHL: minimal IPv4 header length (in 32-bit words) */
 ip_packet[1] = 0; /* TOS */
 ip_packet_len = 5 * 4 + strlen(FAKE_PAYLOAD);
 ip_packet[2] = (ip_packet_len >> 8) & 0xff; /* Total Length */
 ip_packet[3] = ip_packet_len & 0xff;
 ip_packet[4] = 0; /* IP-ID */
 ip_packet[5] = 0;
 ip_packet[6] = 0; /* Fragment Offset and IP flags */
 ip_packet[7] = 0;
 ip_packet[8] = 1; /* TTL */
 ip_packet[9] = 134; /* Protocol: unassigned number */
 ip_packet[10] = 0xbe; /* fake Checksum */
 ip_packet[11] = 0xef;
 ip_packet[12] = 0x01; /* Source address */
 ip_packet[13] = 0x02;
 ip_packet[14] = 0x03;
 ip_packet[15] = 0x04;
 ip_packet[16] = 0x05; /* Destination address */
 ip_packet[17] = 0x06;
 ip_packet[18] = 0x07;
 ip_packet[19] = 0x08;

 /* copy the payload just after the IP header */
 memcpy(ip_packet + 5 * 4, FAKE_PAYLOAD, strlen(FAKE_PAYLOAD));

 /* dump the newly-created IP packet on terminal */
 for(i = 0; i < ip_packet_len; i++)
 {
  printf("0x%02x ", ip_packet[i]);
  if(i != 0 && ((i + 1) % 8) == 0)
  {
   printf("\n");
  }
 }
 if(i != 0 && ((i + 1) % 8) != 0) /* be sure to go to the line */
 {
  printf("\n");
 }

 /* Now, compress this fake IP packet.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga99be8242b7bc4f442f4519461a99726b
  * for details about rohc_compress in the API documentation.
  */
 printf("\ncompress the fake IP packet\n");
 ret = rohc_compress2(compressor,
                      ip_packet, ip_packet_len,
                      rohc_packet, BUFFER_SIZE, &rohc_packet_len);
 if(ret != ROHC_OK)
 {
  fprintf(stderr, "compression of fake IP packet failed\n");
  goto release_compressor;
 }

 /* dump the ROHC packet on terminal */
 printf("\nROHC packet resulting from the ROHC compression:\n");
 for(i = 0; i < rohc_packet_len; i++)
 {
  printf("0x%02x ", rohc_packet[i]);
  if(i != 0 && ((i + 1) % 8) == 0)
  {
   printf("\n");
  }
 }
 if(i != 0 && ((i + 1) % 8) != 0) /* be sure to go to the line */
 {
  printf("\n");
 }

 /* Release the ROHC compressor when you do not need it anymore.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga736ea1760d7af54ad903c29765df5bd3
  * for details about rohc_free_compressor in the API documentation.
  */
 printf("\n\ndestroy the ROHC decompressor\n");
 rohc_free_compressor(compressor);

 printf("\nThe program ended successfully. The ROHC packet is larger than the "
        "IP packet (39 bytes versus 38 bytes). This is expected since we only "
        "compress one packet in this simple example. Keep in mind that ROHC "
        "is designed to compress streams of packets not one single packet.\n\n");

 return 0;

release_compressor:
 rohc_free_compressor(compressor);
error:
 fprintf(stderr, "an error occured during program execution, "
         "abort program\n");
 return 1;
}

/**
 * @brief Generate a random number
 *
 * @param comp The ROHC compressor
 * @param user_context Should always be NULL
 * @return A random number
 */
static int gen_random_num(const struct rohc_comp *const comp,
                          void *const user_context)
{
 return rand();
}

Revision history for this message
manish shivare (mshivare13) said :
#11

the output is
simple_rohc_program.c:35:51: fatal error: config.h: No such file or directory
compilation terminated.

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#12

Hello,

The program contains some special code to build on both Windows and Linux. Please change:

    #include "config.h" /* for HAVE_*_H definitions */

    #if HAVE_WINSOCK2_H == 1
    # include <winsock2.h> /* for htons() on Windows */
    #endif
    #if HAVE_ARPA_INET_H == 1
    # include <arpa/inet.h> /* for htons() on Linux */
    #endif

into:

    #include <arpa/inet.h> /* for htons() on Linux */

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#13

thanks for reply sir,
i modify the code according to your instruction but this is not create rohc_alloc_compressor.
please help me i am give a code and its output
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

/**
 * @file simple_rohc_program.c
 * @brief A simple program that uses the compression part of the ROHC library
 * @author Didier Barvaux <email address hidden>
 *
 * This simple program was first published on the mailing list dedicated to the
 * ROHC library. Ask your questions about this example there.
 *
 * Mailing list subscription: http://launchpad.net/~rohc/+join
 * Mailing list public archives: http://lists.launchpad.net/rohc/
 */

/* system includes */
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>

#if HAVE_ARPA_INET_H == 1
# include <arpa/inet.h> /* for htons() on Linux */
#endif

/* includes required to use the compression part of the ROHC library */
#include <rohc.h>
#include <rohc_comp.h>

/** The size (in bytes) of the buffers used in the program */
#define BUFFER_SIZE 2048

/** The payload for the fake IP packet */
#define FAKE_PAYLOAD "hello, ROHC world!"

static int gen_random_num(const struct rohc_comp *const comp,
                          void *const user_context);

/**
 * @brief The main entry point for the simple ROHC program
 *
 * @param argc The number of arguments given to the program
 * @param argv The table of arguments given to the program
 * @return 0 in case of success, 1 otherwise
 */
int main(int argc, char **argv)
{
 struct rohc_comp *compressor; /* the ROHC compressor */
 unsigned char ip_packet[BUFFER_SIZE]; /* the buffer that will contain
                                            the IPv4 packet to compress */
 size_t ip_packet_len; /* the length (in bytes) of the
                                            IPv4 packet */
 unsigned char rohc_packet[BUFFER_SIZE]; /* the buffer that will contain
                                            the resulting ROHC packet */
 size_t rohc_packet_len; /* the length (in bytes) of the
                                            resulting ROHC packet */
 unsigned int seed;
 size_t i;
 int ret;

 /* initialize the random generator */
 seed = time(NULL);
 srand(seed);

 /* Create a ROHC compressor with small CIDs, no jamming and no adaptation
  * to encapsulation frames.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga721fd34fc0cd9e1d789b693eb6bb6485
  * for details about rohc_alloc_compressor in the API documentation.
  */
 printf("\ncreate the ROHC compressor\n");
 compressor = rohc_alloc_compressor(ROHC_SMALL_CID_MAX, 0, 0, 0);
 if(compressor == NULL)
 {
  fprintf(stderr, "failed create the ROHC compressor\n");
  goto error;
 }

 /* set the callback for random numbers */
 if(!rohc_comp_set_random_cb(compressor, gen_random_num, NULL))
 {
  fprintf(stderr, "failed to set the callback for random numbers\n");
  goto release_compressor;
 }

 /* Enable the compression profiles you need (comment or uncomment some lines).
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga1a444eb91681521f726712a60a4df867
  * for details about rohc_activate_profile in the API documentation.
  */
 printf("\nenable several ROHC compression profiles\n");
 rohc_activate_profile(compressor, ROHC_PROFILE_UNCOMPRESSED);
 //rohc_activate_profile(compressor, ROHC_PROFILE_UDP);
 rohc_activate_profile(compressor, ROHC_PROFILE_IP);
 //rohc_activate_profile(compressor, ROHC_PROFILE_UDPLITE);
 //rohc_activate_profile(compressor, ROHC_PROFILE_RTP);
 //rohc_activate_profile(comp, ROHC_PROFILE_ESP);

 /* create a fake IP packet for the purpose of this simple program */
 printf("\nbuild a fake IP packet\n");
 ip_packet[0] = 4 << 4; /* IP version 4 */
 ip_packet[0] |= 5; /* IHL: minimal IPv4 header length (in 32-bit words) */
 ip_packet[1] = 0; /* TOS */
 ip_packet_len = 5 * 4 + strlen(FAKE_PAYLOAD);
 ip_packet[2] = (ip_packet_len >> 8) & 0xff; /* Total Length */
 ip_packet[3] = ip_packet_len & 0xff;
 ip_packet[4] = 0; /* IP-ID */
 ip_packet[5] = 0;
 ip_packet[6] = 0; /* Fragment Offset and IP flags */
 ip_packet[7] = 0;
 ip_packet[8] = 1; /* TTL */
 ip_packet[9] = 134; /* Protocol: unassigned number */
 ip_packet[10] = 0xbe; /* fake Checksum */
 ip_packet[11] = 0xef;
 ip_packet[12] = 0x01; /* Source address */
 ip_packet[13] = 0x02;
 ip_packet[14] = 0x03;
 ip_packet[15] = 0x04;
 ip_packet[16] = 0x05; /* Destination address */
 ip_packet[17] = 0x06;
 ip_packet[18] = 0x07;
 ip_packet[19] = 0x08;

 /* copy the payload just after the IP header */
 memcpy(ip_packet + 5 * 4, FAKE_PAYLOAD, strlen(FAKE_PAYLOAD));

 /* dump the newly-created IP packet on terminal */
 for(i = 0; i < ip_packet_len; i++)
 {
  printf("0x%02x ", ip_packet[i]);
  if(i != 0 && ((i + 1) % 8) == 0)
  {
   printf("\n");
  }
 }
 if(i != 0 && ((i + 1) % 8) != 0) /* be sure to go to the line */
 {
  printf("\n");
 }

 /* Now, compress this fake IP packet.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga99be8242b7bc4f442f4519461a99726b
  * for details about rohc_compress in the API documentation.
  */
 printf("\ncompress the fake IP packet\n");
 ret = rohc_compress2(compressor,
                      ip_packet, ip_packet_len,
                      rohc_packet, BUFFER_SIZE, &rohc_packet_len);
 if(ret != ROHC_OK)
 {
  fprintf(stderr, "compression of fake IP packet failed\n");
  goto release_compressor;
 }

 /* dump the ROHC packet on terminal */
 printf("\nROHC packet resulting from the ROHC compression:\n");
 for(i = 0; i < rohc_packet_len; i++)
 {
  printf("0x%02x ", rohc_packet[i]);
  if(i != 0 && ((i + 1) % 8) == 0)
  {
   printf("\n");
  }
 }
 if(i != 0 && ((i + 1) % 8) != 0) /* be sure to go to the line */
 {
  printf("\n");
 }

 /* Release the ROHC compressor when you do not need it anymore.
  *
  * See http://rohc-lib.org/doc/latest/group__rohc__comp.html#ga736ea1760d7af54ad903c29765df5bd3
  * for details about rohc_free_compressor in the API documentation.
  */
 printf("\n\ndestroy the ROHC decompressor\n");
 rohc_free_compressor(compressor);

 printf("\nThe program ended successfully. The ROHC packet is larger than the "
        "IP packet (39 bytes versus 38 bytes). This is expected since we only "
        "compress one packet in this simple example. Keep in mind that ROHC "
        "is designed to compress streams of packets not one single packet.\n\n");

 return 0;

release_compressor:
 rohc_free_compressor(compressor);
error:
 fprintf(stderr, "an error occured during program execution, "
         "abort program\n");
 return 1;
}

/**
 * @brief Generate a random number
 *
 * @param comp The ROHC compressor
 * @param user_context Should always be NULL
 * @return A random number
 */
static int gen_random_num(const struct rohc_comp *const comp,
                          void *const user_context)
{
 return rand();
}

output is-
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -o simple_rohc_program -g -Wall $(pkg-config rohc --libs) simple_rohc_program.c
/tmp/ccmlyCMo.o: In function `main':
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:91: undefined reference to `rohc_alloc_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:99: undefined reference to `rohc_comp_set_random_cb'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:111: undefined reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:113: undefined reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:168: undefined reference to `rohc_compress2'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:200: undefined reference to `rohc_free_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:211: undefined reference to `rohc_free_compressor'
collect2: error: ld returned 1 exit status

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#14

Hello,

Please send me the output of the following 2 commands:
$ pkg-config rohc --modversion
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --modversion

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#15

This is the ouput of your command
manish@manish-HP-630-Notebook-PC:~$ pkg-config rohc --modversion1.6.1
manish@manish-HP-630-Notebook-PC:~$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/pkg-config rohc -- modversion
rohc: command not found
and i add outut of following command which is locate pkgconfig
manish@manish-HP-630-Notebook-PC:~$ locate pkgconfig
/home/ns2/rohc-1.6.1/lib/pkgconfig
/home/ns2/rohc-1.6.1/lib/pkgconfig/rohc.pc
/usr/lib/pkgconfig
/usr/lib/i386-linux-gnu/pkgconfig
/usr/lib/i386-linux-gnu/pkgconfig/form.pc
/usr/lib/i386-linux-gnu/pkgconfig/ice.pc
/usr/lib/i386-linux-gnu/pkgconfig/libcrypto.pc
/usr/lib/i386-linux-gnu/pkgconfig/libffi.pc
/usr/lib/i386-linux-gnu/pkgconfig/libssl.pc
/usr/lib/i386-linux-gnu/pkgconfig/menu.pc
/usr/lib/i386-linux-gnu/pkgconfig/ncurses++.pc
/usr/lib/i386-linux-gnu/pkgconfig/ncurses.pc
/usr/lib/i386-linux-gnu/pkgconfig/openssl.pc
/usr/lib/i386-linux-gnu/pkgconfig/panel.pc
/usr/lib/i386-linux-gnu/pkgconfig/pixman-1.pc
/usr/lib/i386-linux-gnu/pkgconfig/pthread-stubs.pc
/usr/lib/i386-linux-gnu/pkgconfig/sm.pc
/usr/lib/i386-linux-gnu/pkgconfig/spice-client-glib-2.0.pc
/usr/lib/i386-linux-gnu/pkgconfig/spice-controller.pc
/usr/lib/i386-linux-gnu/pkgconfig/spice-server.pc
/usr/lib/i386-linux-gnu/pkgconfig/tic.pc
/usr/lib/i386-linux-gnu/pkgconfig/tinfo.pc
/usr/lib/i386-linux-gnu/pkgconfig/x11.pc
/usr/lib/i386-linux-gnu/pkgconfig/xau.pc
/usr/lib/i386-linux-gnu/pkgconfig/xcb.pc
/usr/lib/i386-linux-gnu/pkgconfig/xdmcp.pc
/usr/lib/i386-linux-gnu/pkgconfig/xext.pc
/usr/lib/i386-linux-gnu/pkgconfig/xinerama.pc
/usr/lib/i386-linux-gnu/pkgconfig/xmu.pc
/usr/lib/i386-linux-gnu/pkgconfig/xt.pc
/usr/lib/i386-linux-gnu/pkgconfig/zlib.pc
/usr/lib/pkgconfig/dbus-python.pc
/usr/lib/pkgconfig/ibus-table.pc
/usr/lib/pkgconfig/libquvi-scripts.pc
/usr/lib/pkgconfig/nautilus-sendto.pc
/usr/lib/pkgconfig/notify-python.pc
/usr/lib/pkgconfig/pm-utils.pc
/usr/lib/pkgconfig/valgrind.pc
/usr/lib/pkgconfig/xorg-wacom.pc
/usr/lib/rpm/pkgconfigdeps.sh
/usr/lib/rpm/fileattrs/pkgconfig.attr
/usr/local/lib/pkgconfig
/usr/local/lib/pkgconfig/rohc.pc
/usr/local/lib/pkgconfig/valgrind.pc
/usr/ns2/rohc-1.6.1/lib/pkgconfig
/usr/ns2/rohc-1.6.1/lib/pkgconfig/rohc.pc
/usr/ns2/rohc1.6.1/lib/pkgconfig
/usr/ns2/rohc1.6.1/lib/pkgconfig/rohc.pc
/usr/share/pkgconfig
/usr/share/gtksourceview-3.0/language-specs/pkgconfig.lang
/usr/share/pkgconfig/bash-completion.pc
/usr/share/pkgconfig/fontutil.pc
/usr/share/pkgconfig/gnome-icon-theme.pc
/usr/share/pkgconfig/inputproto.pc
/usr/share/pkgconfig/iso-codes.pc
/usr/share/pkgconfig/kbproto.pc
/usr/share/pkgconfig/mobile-broadband-provider-info.pc
/usr/share/pkgconfig/shared-desktop-ontologies.pc
/usr/share/pkgconfig/shared-mime-info.pc
/usr/share/pkgconfig/spice-protocol.pc
/usr/share/pkgconfig/udev.pc
/usr/share/pkgconfig/udisks.pc
/usr/share/pkgconfig/usbutils.pc
/usr/share/pkgconfig/xbitmaps.pc
/usr/share/pkgconfig/xextproto.pc
/usr/share/pkgconfig/xineramaproto.pc
/usr/share/pkgconfig/xkeyboard-config.pc
/usr/share/pkgconfig/xorg-sgml-doctools.pc
/usr/share/pkgconfig/xproto.pc
/usr/share/pkgconfig/xtrans.pc
/usr/share/pkgconfig/yelp-xsl.pc

 i think the problem is i found two rohc path
/home/ns2/rohc-1.6.1/lib/pkgconfig
/home/ns2/rohc-1.6.1/lib/pkgconfig/rohc.pc
/usr/lib/pkgconfig

if this is a problem please send me how to correct it

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#16

You mistyped my 2nd command. Whitespace position is important.

Incorrect: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/pkg-config rohc -- modversion
Correct: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --modversion

According to your locate command, the correct command should work and report 1.6.1. Then, you can do:
  $ cd rohc-1.6.1/examples/
  $ gcc -o simple_rohc_program -g -Wall \
     $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs ) \
     simple_rohc_program.c

Revision history for this message
manish shivare (mshivare13) said :
#17

 extremely sorry for the my silly mistake i am providing my log file
according to your instruction
manish@manish-HP-630-Notebook-PC:~$ pkg-config rohc --modversion
1.6.1
manish@manish-HP-630-Notebook-PC:~$
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --modversion
1.6.1
manish@manish-HP-630-Notebook-PC:~$ cd rohc-1.6.1/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1$ cd examples/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -o
simple_rohc_program -g -Wall $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
pkg-config rohc --libs ) simple_rohc_program.c
/tmp/ccglCz67.o: In function `main':
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:91: undefined
reference to `rohc_alloc_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:99: undefined
reference to `rohc_comp_set_random_cb'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:111: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:113: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:168: undefined
reference to `rohc_compress2'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:200: undefined
reference to `rohc_free_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:211: undefined
reference to `rohc_free_compressor'
collect2: error: ld returned 1 exit status
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$

On Tue, Sep 3, 2013 at 1:31 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Answered
>
> Didier Barvaux proposed the following answer:
> You mistyped my 2nd command. Whitespace position is important.
>
> Incorrect: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/pkg-config rohc --
> modversion
> Correct: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc
> --modversion
>
> According to your locate command, the correct command should work and
> report 1.6.1. Then, you can do:
> $ cd rohc-1.6.1/examples/
> $ gcc -o simple_rohc_program -g -Wall \
> $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs )
> \
> simple_rohc_program.c
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#18

Please send me the output of the following commands:
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs
$ ls -l /usr/local/lib/librohc*
$ cat /usr/local/lib/pkgconfig/rohc.pc

Revision history for this message
manish shivare (mshivare13) said :
#19

this is log according to your instruction-
manish@manish-HP-630-Notebook-PC:~$
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs
-L/usr/local/lib -lrohc_decomp -lrohc_comp -lrohc_common
manish@manish-HP-630-Notebook-PC:~$ ls -l /usr/local/lib/librohc*
-rwxr-xr-x 1 root root 948 Sep 2 15:14 /usr/local/lib/librohc_common.la
lrwxrwxrwx 1 root root 23 Sep 2 15:14 /usr/local/lib/librohc_common.so
-> librohc_common.so.0.1.0
lrwxrwxrwx 1 root root 23 Sep 2 15:14
/usr/local/lib/librohc_common.so.0 -> librohc_common.so.0.1.0
-rwxr-xr-x 1 root root 133921 Sep 2 15:14
/usr/local/lib/librohc_common.so.0.1.0
-rwxr-xr-x 1 root root 994 Sep 2 15:14 /usr/local/lib/librohc_comp.la
lrwxrwxrwx 1 root root 21 Sep 2 15:14 /usr/local/lib/librohc_comp.so
-> librohc_comp.so.0.1.0
lrwxrwxrwx 1 root root 21 Sep 2 15:14 /usr/local/lib/librohc_comp.so.0
-> librohc_comp.so.0.1.0
-rwxr-xr-x 1 root root 520240 Sep 2 15:14
/usr/local/lib/librohc_comp.so.0.1.0
-rwxr-xr-x 1 root root 1060 Sep 2 15:14 /usr/local/lib/librohc_decomp.la
lrwxrwxrwx 1 root root 23 Sep 2 15:14 /usr/local/lib/librohc_decomp.so
-> librohc_decomp.so.0.1.0
lrwxrwxrwx 1 root root 23 Sep 2 15:14
/usr/local/lib/librohc_decomp.so.0 -> librohc_decomp.so.0.1.0
-rwxr-xr-x 1 root root 520609 Sep 2 15:14
/usr/local/lib/librohc_decomp.so.0.1.0
manish@manish-HP-630-Notebook-PC:~$ cat /usr/local/lib/pkgconfig/rohc.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: RObust Header Compression (ROHC)
Description: Free and efficient library that implements the ROHC protocol
Version: 1.6.1
Libs: -L${libdir} -lrohc_decomp -lrohc_comp -lrohc_common
Cflags: -I${includedir}

On Tue, Sep 3, 2013 at 3:46 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Answered
>
> Didier Barvaux proposed the following answer:
> Please send me the output of the following commands:
> $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs
> $ ls -l /usr/local/lib/librohc*
> $ cat /usr/local/lib/pkgconfig/rohc.pc
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#20

Please try:

$ gcc -o simple_rohc_program -g -Wall \
   $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs --cflags ) \
   simple_rohc_program.c

Revision history for this message
manish shivare (mshivare13) said :
#21

thanks for reply. i am very thankful for you because you give time for my
thread.
but i still have compilation error.
this is the output-
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -o
simple_rohc_program -g -Wall $(
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs --cflags
) simple_rohc_program.c
/tmp/ccz0wPFR.o: In function `main':
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:91: undefined
reference to `rohc_alloc_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:99: undefined
reference to `rohc_comp_set_random_cb'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:111: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:113: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:168: undefined
reference to `rohc_compress2'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:200: undefined
reference to `rohc_free_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:211: undefined
reference to `rohc_free_compressor'
collect2: error: ld returned 1 exit status

On Tue, Sep 3, 2013 at 11:36 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Please try:
>
> $ gcc -o simple_rohc_program -g -Wall \
> $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs
> --cflags ) \
> simple_rohc_program.c
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#22

The libraries seem to be found correctly, but there is something wrong during the link... Could you send me the output of the following commands:

$ uname -m -i
$ gcc --version
$ ld --version
$ file /usr/local/lib/librohc_*
$ cd rohc-1.6.1/examples/ # go to the examples/ directory
$ rm -f simple_rohc_program.o simple_rohc_program
$ gcc -c -o simple_rohc_program.o -g -Wall \
   $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --cflags ) \
   simple_rohc_program.c
$ file simple_rohc_program.o
$ gcc -Wl,--verbose -o simple_rohc_program \
    $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs ) \
    simple_rohc_program.o
$ file simple_rohc_program

And what Linux distribution do you use?

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#23

hello sir,
thanks for reply. this is log according to your suggestion.
manish@manish-HP-630-Notebook-PC:~$ uname -m -i
i686 i686
manish@manish-HP-630-Notebook-PC:~$ gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
manish@manish-HP-630-Notebook-PC:~$ file /usr/local/lib/librohc_*
/usr/local/lib/librohc_common.la: libtool library file,
/usr/local/lib/librohc_common.so: symbolic link to
`librohc_common.so.0.1.0'
/usr/local/lib/librohc_common.so.0: symbolic link to
`librohc_common.so.0.1.0'
/usr/local/lib/librohc_common.so.0.1.0: ELF 32-bit LSB shared object, Intel
80386, version 1 (SYSV), dynamically linked,
BuildID[sha1]=0xcc9d8a2a2c467c26c4d468056bc9ec2fef5abcbc, not stripped
/usr/local/lib/librohc_comp.la: libtool library file,
/usr/local/lib/librohc_comp.so: symbolic link to
`librohc_comp.so.0.1.0'
/usr/local/lib/librohc_comp.so.0: symbolic link to
`librohc_comp.so.0.1.0'
/usr/local/lib/librohc_comp.so.0.1.0: ELF 32-bit LSB shared object, Intel
80386, version 1 (SYSV), dynamically linked,
BuildID[sha1]=0x733e346ddd99243e259f7f5efe99638ea3bb5ef0, not stripped
/usr/local/lib/librohc_decomp.la: libtool library file,
/usr/local/lib/librohc_decomp.so: symbolic link to
`librohc_decomp.so.0.1.0'
/usr/local/lib/librohc_decomp.so.0: symbolic link to
`librohc_decomp.so.0.1.0'
/usr/local/lib/librohc_decomp.so.0.1.0: ELF 32-bit LSB shared object, Intel
80386, version 1 (SYSV), dynamically linked,
BuildID[sha1]=0x294f93b75c4a06ad40ee3ecd28d6e6c23ae3072c, not stripped
manish@manish-HP-630-Notebook-PC:~$ cd rohc-1.6.1/examples/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ rm -f
simple_rohc_program.o simple_rohc_program
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -c -o
simple_rohc_program.o -g -Wall $(
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --cflags )
simple_rohc_program.c
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ file
simple_rohc_program.o
simple_rohc_program.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(SYSV), not stripped
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ file
simple_rohc_program
simple_rohc_program: ERROR: cannot open `simple_rohc_program' (No such file
or directory)
i am using ubuntu 12.10 and os type 32-bit.
waiting for your reply.

On Wed, Sep 4, 2013 at 2:16 AM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> The libraries seem to be found correctly, but there is something wrong
> during the link... Could you send me the output of the following
> commands:
>
> $ uname -m -i
> $ gcc --version
> $ ld --version
> $ file /usr/local/lib/librohc_*
> $ cd rohc-1.6.1/examples/ # go to the examples/ directory
> $ rm -f simple_rohc_program.o simple_rohc_program
> $ gcc -c -o simple_rohc_program.o -g -Wall \
> $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --cflags )
> \
> simple_rohc_program.c
> $ file simple_rohc_program.o
> $ gcc -Wl,--verbose -o simple_rohc_program \
> $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs ) \
> simple_rohc_program.o
> $ file simple_rohc_program
>
> And what Linux distribution do you use?
>
> Regards,
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#24

Two commands are missing:

$ ld --version
$ gcc -Wl,--verbose -o simple_rohc_program \
    $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs ) \
    simple_rohc_program.o

Revision history for this message
manish shivare (mshivare13) said :
#25

thank you for reply
pardon me for my incomplete post i am proving the log of two command-
manish@manish-HP-630-Notebook-PC:~$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.
manish@manish-HP-630-Notebook-PC:~$ cd rohc-1.6.1/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1$ cd examples/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -Wl,--verbose
-o simple_rohc_program $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
pkg-config rohc --libs ) simple_rohc_program.o
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
  Supported emulations:
   elf_i386
   i386linux
   elf32_x86_64
   elf_x86_64
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
          "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
. = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
  .interp : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash : { *(.hash) }
  .gnu.hash : { *(.gnu.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version : { *(.gnu.version) }
  .gnu.version_d : { *(.gnu.version_d) }
  .gnu.version_r : { *(.gnu.version_r) }
  .rel.dyn :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ifunc)
    }
  .rel.plt :
    {
      *(.rel.plt)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .init :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt : { *(.plt) *(.iplt) }
  .text :
  {
    *(.text.unlikely .text.*_unlikely)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
  }
  .fini :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1 : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler. */
  .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment. We want to adjust up to
     the same address within the page on the next page up. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling */
  .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections */
  .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first. Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard. The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in. */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic : { *(.dynamic) }
  .got : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
  .got.plt : { *(.got.plt) *(.igot.plt) }
  .data :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1 : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end. Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section. */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections. */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0. */
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges 0 : { *(.debug_ranges) }
  /* DWARF Extension. */
  .debug_macro 0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o
attempt to open /usr/local/lib/librohc_decomp.so succeeded
-lrohc_decomp (/usr/local/lib/librohc_decomp.so)
attempt to open /usr/local/lib/librohc_comp.so succeeded
-lrohc_comp (/usr/local/lib/librohc_comp.so)
attempt to open /usr/local/lib/librohc_common.so succeeded
-lrohc_common (/usr/local/lib/librohc_common.so)
attempt to open simple_rohc_program.o succeeded
simple_rohc_program.o
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/local/lib/libgcc_s.so failed
attempt to open /usr/local/lib/libgcc_s.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/local/lib/libc.so failed
attempt to open /usr/local/lib/libc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so succeeded
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
/lib/i386-linux-gnu/libc.so.6
attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
(/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
/lib/i386-linux-gnu/ld-linux.so.2
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/local/lib/libgcc_s.so failed
attempt to open /usr/local/lib/libgcc_s.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtend.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtend.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o
ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
simple_rohc_program.o: In function `main':
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:91: undefined
reference to `rohc_alloc_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:99: undefined
reference to `rohc_comp_set_random_cb'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:111: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:113: undefined
reference to `rohc_activate_profile'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:168: undefined
reference to `rohc_compress2'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:200: undefined
reference to `rohc_free_compressor'
/home/manish/rohc-1.6.1/examples/simple_rohc_program.c:211: undefined
reference to `rohc_free_compressor'
collect2: error: ld returned 1 exit status
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$

On Wed, Sep 4, 2013 at 10:36 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Two commands are missing:
>
> $ ld --version
> $ gcc -Wl,--verbose -o simple_rohc_program \
> $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs ) \
> simple_rohc_program.o
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#26

The linker finds the libraries and use them, but it does not find the rohc_* symbols. Maybe they are not in the so file. Please send the output of the following commands to check:

$ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_alloc_compressor
$ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_comp_set_random_cb
$ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_activate_profile
$ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_free_compressor

Revision history for this message
manish shivare (mshivare13) said :
#27

thanks for reply. this is log according your suggestion-
manish@manish-HP-630-Notebook-PC:~$ readelf --syms
/usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_alloc_compressor
   121: 00004de0 656 FUNC GLOBAL DEFAULT 11 rohc_alloc_compressor
   512: 00004de0 656 FUNC GLOBAL DEFAULT 11 rohc_alloc_compressor
manish@manish-HP-630-Notebook-PC:~$ readelf --syms
/usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_comp_set_random_cb
   165: 00004100 43 FUNC GLOBAL DEFAULT 11 rohc_comp_set_random_cb
   464: 00004100 43 FUNC GLOBAL DEFAULT 11 rohc_comp_set_random_cb
manish@manish-HP-630-Notebook-PC:~$ readelf --syms
/usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_activate_profile
   112: 00004890 159 FUNC GLOBAL DEFAULT 11 rohc_activate_profile
   397: 00004890 159 FUNC GLOBAL DEFAULT 11 rohc_activate_profile
manish@manish-HP-630-Notebook-PC:~$ readelf --syms
/usr/local/lib/librohc_comp.so.0.1.0 | grep rohc_free_compressor
   183: 00003f40 255 FUNC GLOBAL DEFAULT 11 rohc_free_compressor
   406: 00003f40 255 FUNC GLOBAL DEFAULT 11 rohc_free_compressor

On Thu, Sep 5, 2013 at 12:41 AM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> The linker finds the libraries and use them, but it does not find the
> rohc_* symbols. Maybe they are not in the so file. Please send the
> output of the following commands to check:
>
> $ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep
> rohc_alloc_compressor
> $ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep
> rohc_comp_set_random_cb
> $ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep
> rohc_activate_profile
> $ readelf --syms /usr/local/lib/librohc_comp.so.0.1.0 | grep
> rohc_free_compressor
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#28

Hello,

To summarize:
1/ gcc correctly builds the .o object from sources,
2/ ld fails to link a small programs with the ROHC libraries,
3/ ld correctly finds the librohc*.so files,
4/ the librohc*.so files seem correct (ELF 32-bit, symbols are all there).

I don't understand why it fails... Let's try with a smaller program that uses only the librohc_common.so library:

$ cat > test_rohc_common.c << EOF
> #include <stdlib.h>
> #include <stdio.h>
> #include <rohc.h>
>
> int main(int argc, char **argv)
> {
> printf("ROHC version %s\n", rohc_version());
> return 0;
> }
> EOF
$ cat test_rohc_common.c
$ gcc -o test_rohc_common -g -Wall -I/usr/local/include \
    -L/usr/local/lib/ -lrohc_common test_rohc_common.c
$ file test_rohc_common

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#29

this code also given compilation error.
this is log
manish@manish-HP-630-Notebook-PC:~$ cat > test_rohc_common.c << EOF
> #include <stdlib.h>
> #include <stdio.h>
> #include <rohc.h>
>
> int main(int argc, char **argv)
> {
> printf("ROHC version %s\n", rohc_version());
> return 0;
>
> }
> EOF
manish@manish-HP-630-Notebook-PC:~$ cat test_rohc_common.c
#include <stdlib.h>
 #include <stdio.h>
#include <rohc.h>

int main(int argc, char **argv)
{
 printf("ROHC version %s\n", rohc_version());
return 0;

}
manish@manish-HP-630-Notebook-PC:~$ gcc -o test_rohc_common -g -Wall
-I/usr/local/include -L/usr/local/lib/ -lrohc_common test_rohc_common.c
/tmp/cc5H9Nty.o: In function `main':
/home/manish/test_rohc_common.c:7: undefined reference to `rohc_version'
collect2: error: ld returned 1 exit statu

i need to reinstall or any other solution?
please help me
i am waiting for you and sorry about bothering to you for my questions.

On Thu, Sep 5, 2013 at 11:21 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Hello,
>
> To summarize:
> 1/ gcc correctly builds the .o object from sources,
> 2/ ld fails to link a small programs with the ROHC libraries,
> 3/ ld correctly finds the librohc*.so files,
> 4/ the librohc*.so files seem correct (ELF 32-bit, symbols are all there).
>
> I don't understand why it fails... Let's try with a smaller program that
> uses only the librohc_common.so library:
>
> $ cat > test_rohc_common.c << EOF
> > #include <stdlib.h>
> > #include <stdio.h>
> > #include <rohc.h>
> >
> > int main(int argc, char **argv)
> > {
> > printf("ROHC version %s\n", rohc_version());
> > return 0;
> > }
> > EOF
> $ cat test_rohc_common.c
> $ gcc -o test_rohc_common -g -Wall -I/usr/local/include \
> -L/usr/local/lib/ -lrohc_common test_rohc_common.c
> $ file test_rohc_common
>
> Regards,
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
manish shivare (mshivare13) said :
#30

sorry for typo waiting for you reply
thank you

On Fri, Sep 6, 2013 at 8:01 PM, manish shivare <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Needs information => Open
>
> manish shivare gave more information on the question:
> this code also given compilation error.
> this is log
> manish@manish-HP-630-Notebook-PC:~$ cat > test_rohc_common.c << EOF
> > #include <stdlib.h>
> > #include <stdio.h>
> > #include <rohc.h>
> >
> > int main(int argc, char **argv)
> > {
> > printf("ROHC version %s\n", rohc_version());
> > return 0;
> >
> > }
> > EOF
> manish@manish-HP-630-Notebook-PC:~$ cat test_rohc_common.c
> #include <stdlib.h>
> #include <stdio.h>
> #include <rohc.h>
>
> int main(int argc, char **argv)
> {
> printf("ROHC version %s\n", rohc_version());
> return 0;
>
> }
> manish@manish-HP-630-Notebook-PC:~$ gcc -o test_rohc_common -g -Wall
> -I/usr/local/include -L/usr/local/lib/ -lrohc_common
> test_rohc_common.c
> /tmp/cc5H9Nty.o: In function `main':
> /home/manish/test_rohc_common.c:7: undefined reference to `rohc_version'
> collect2: error: ld returned 1 exit statu
>
>
> i need to reinstall or any other solution?
> please help me
> i am waiting for you and sorry about bothering to you for my questions.
>
>
> On Thu, Sep 5, 2013 at 11:21 PM, Didier Barvaux <
> <email address hidden>> wrote:
>
> > Question #234832 on rohc changed:
> > https://answers.launchpad.net/rohc/+question/234832
> >
> > Status: Open => Needs information
> >
> > Didier Barvaux requested more information:
> > Hello,
> >
> > To summarize:
> > 1/ gcc correctly builds the .o object from sources,
> > 2/ ld fails to link a small programs with the ROHC libraries,
> > 3/ ld correctly finds the librohc*.so files,
> > 4/ the librohc*.so files seem correct (ELF 32-bit, symbols are all
> there).
> >
> > I don't understand why it fails... Let's try with a smaller program that
> > uses only the librohc_common.so library:
> >
> > $ cat > test_rohc_common.c << EOF
> > > #include <stdlib.h>
> > > #include <stdio.h>
> > > #include <rohc.h>
> > >
> > > int main(int argc, char **argv)
> > > {
> > > printf("ROHC version %s\n", rohc_version());
> > > return 0;
> > > }
> > > EOF
> > $ cat test_rohc_common.c
> > $ gcc -o test_rohc_common -g -Wall -I/usr/local/include \
> > -L/usr/local/lib/ -lrohc_common test_rohc_common.c
> > $ file test_rohc_common
> >
> > Regards,
> > Didier
> >
> > --
> > You received this question notification because you are a member of ROHC
> > Team, which is an answer contact for rohc.
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~rohc
> > Post to : <email address hidden>
> > Unsubscribe : https://launchpad.net/~rohc
> > More help : https://help.launchpad.net/ListHelp
> >
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#31

Could you please try with another installation?

$ mkdir /tmp/rohc_sources
$ cd /tmp/rohc_sources
$ wget https://launchpad.net/rohc/1.6.x/1.6.1/+download/rohc-1.6.1.tar.bz2
$ tar -xjf rohc-1.6.1.tar.bz2
$ cd rohc-1.6.1
$ ./configure --prefix=/tmp/rohc_install/
$ make clean all install
$ cd ..
$ cat > test_rohc_common.c << EOF
> #include <stdlib.h>
> #include <stdio.h>
> #include <rohc.h>
>
> int main(int argc, char **argv)
> {
> printf("ROHC version %s\n", rohc_version());
> return 0;
>
> }
> EOF
$ gcc -o test_rohc_common -g -Wall -I/tmp/rohc_install/include \
    -lrohc_common -L/tmp/rohc_install/lib/ test_rohc_common.c
$ file ./test_rohc_common
$ LD_LIBRARY_PATH=/tmp/rohc_install/lib/ ./test_rohc_common

Revision history for this message
manish shivare (mshivare13) said :
#32

thank you for reply. i am giving a log-
manish@manish-HP-630-Notebook-PC:~$ cd rohc-1.6.1/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1$ cd examples/
manish@manish-HP-630-Notebook-PC:~/rohc-1.6.1/examples$ gcc -Wl,--verbose
-o simple_rohc_program $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
pkg-config rohc --libs ) simple_rohc_program.o
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
  Supported emulations:
   elf_i386
   i386linux
   elf32_x86_64
   elf_x86_64
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
          "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
. = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
  .interp : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash : { *(.hash) }
  .gnu.hash : { *(.gnu.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version : { *(.gnu.version) }
  .gnu.version_d : { *(.gnu.version_d) }
  .gnu.version_r : { *(.gnu.version_r) }
  .rel.dyn :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ifunc)
    }
  .rel.plt :
    {
      *(.rel.plt)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .init :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt : { *(.plt) *(.iplt) }
  .text :
  {
    *(.text.unlikely .text.*_unlikely)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
  }
  .fini :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1 : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler. */
  .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment. We want to adjust up to
     the same address within the page on the next page up. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling */
  .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections */
  .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first. Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard. The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in. */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic : { *(.dynamic) }
  .got : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
  .got.plt : { *(.got.plt) *(.igot.plt) }
  .data :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1 : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end. Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section. */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections. */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0. */
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges 0 : { *(.debug_ranges) }
  /* DWARF Extension. */
  .debug_macro 0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o
attempt to open /usr/local/lib/librohc_decomp.so succeeded
-lrohc_decomp (/usr/local/lib/librohc_decomp.so)
attempt to open /usr/local/lib/librohc_comp.so succeeded
-lrohc_comp (/usr/local/lib/librohc_comp.so)
attempt to open /usr/local/lib/librohc_common.so succeeded
-lrohc_common (/usr/local/lib/librohc_common.so)
attempt to open simple_rohc_program.o succeeded
simple_rohc_program.o
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/local/lib/libgcc_s.so failed
attempt to open /usr/local/lib/libgcc_s.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/local/lib/libc.so failed
attempt to open /usr/local/lib/libc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so succeeded
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
/lib/i386-linux-gnu/libc.so.6
attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
(/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
/lib/i386-linux-gnu/ld-linux.so.2
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/local/lib/libgcc_s.so failed
attempt to open /usr/local/lib/libgcc_s.a failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtend.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtend.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o
ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
simple_rohc_program.o: In function `main':
simple_rohc_program.c:(.text+0x6a): undefined reference to
`rohc_alloc_compressor'
simple_rohc_program.c:(.text+0xbb): undefined reference to
`rohc_comp_set_random_cb'
simple_rohc_program.c:(.text+0x10c): undefined reference to
`rohc_activate_profile'
simple_rohc_program.c:(.text+0x120): undefined reference to
`rohc_activate_profile'
simple_rohc_program.c:(.text+0x28a): undefined reference to `rohc_compress2'
simple_rohc_program.c:(.text+0x361): undefined reference to
`rohc_free_compressor'
simple_rohc_program.c:(.text+0x380): undefined reference to
`rohc_free_compressor'
collect2: error: ld returned 1 exit status

according to my analysis this file are create problem
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/local/lib/libgcc_s.so failed
attempt to open /usr/local/lib/libgcc_s.a failed
because they are not present in a directory.
any suggestion regarding this problem.

On Sat, Sep 7, 2013 at 9:56 AM, manish shivare <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> manish shivare gave more information on the question:
> sorry for typo waiting for you reply
> thank you
>
>
> On Fri, Sep 6, 2013 at 8:01 PM, manish shivare <
> <email address hidden>> wrote:
>
> > Question #234832 on rohc changed:
> > https://answers.launchpad.net/rohc/+question/234832
> >
> > Status: Needs information => Open
> >
> > manish shivare gave more information on the question:
> > this code also given compilation error.
> > this is log
> > manish@manish-HP-630-Notebook-PC:~$ cat > test_rohc_common.c << EOF
> > > #include <stdlib.h>
> > > #include <stdio.h>
> > > #include <rohc.h>
> > >
> > > int main(int argc, char **argv)
> > > {
> > > printf("ROHC version %s\n", rohc_version());
> > > return 0;
> > >
> > > }
> > > EOF
> > manish@manish-HP-630-Notebook-PC:~$ cat test_rohc_common.c
> > #include <stdlib.h>
> > #include <stdio.h>
> > #include <rohc.h>
> >
> > int main(int argc, char **argv)
> > {
> > printf("ROHC version %s\n", rohc_version());
> > return 0;
> >
> > }
> > manish@manish-HP-630-Notebook-PC:~$ gcc -o test_rohc_common -g -Wall
> > -I/usr/local/include -L/usr/local/lib/ -lrohc_common
> > test_rohc_common.c
> > /tmp/cc5H9Nty.o: In function `main':
> > /home/manish/test_rohc_common.c:7: undefined reference to `rohc_version'
> > collect2: error: ld returned 1 exit statu
> >
> >
> > i need to reinstall or any other solution?
> > please help me
> > i am waiting for you and sorry about bothering to you for my questions.
> >
> >
> > On Thu, Sep 5, 2013 at 11:21 PM, Didier Barvaux <
> > <email address hidden>> wrote:
> >
> > > Question #234832 on rohc changed:
> > > https://answers.launchpad.net/rohc/+question/234832
> > >
> > > Status: Open => Needs information
> > >
> > > Didier Barvaux requested more information:
> > > Hello,
> > >
> > > To summarize:
> > > 1/ gcc correctly builds the .o object from sources,
> > > 2/ ld fails to link a small programs with the ROHC libraries,
> > > 3/ ld correctly finds the librohc*.so files,
> > > 4/ the librohc*.so files seem correct (ELF 32-bit, symbols are all
> > there).
> > >
> > > I don't understand why it fails... Let's try with a smaller program
> that
> > > uses only the librohc_common.so library:
> > >
> > > $ cat > test_rohc_common.c << EOF
> > > > #include <stdlib.h>
> > > > #include <stdio.h>
> > > > #include <rohc.h>
> > > >
> > > > int main(int argc, char **argv)
> > > > {
> > > > printf("ROHC version %s\n", rohc_version());
> > > > return 0;
> > > > }
> > > > EOF
> > > $ cat test_rohc_common.c
> > > $ gcc -o test_rohc_common -g -Wall -I/usr/local/include \
> > > -L/usr/local/lib/ -lrohc_common test_rohc_common.c
> > > $ file test_rohc_common
> > >
> > > Regards,
> > > Didier
> > >
> > > --
> > > You received this question notification because you are a member of
> ROHC
> > > Team, which is an answer contact for rohc.
> > >
> > > _______________________________________________
> > > Mailing list: https://launchpad.net/~rohc
> > > Post to : <email address hidden>
> > > Unsubscribe : https://launchpad.net/~rohc
> > > More help : https://help.launchpad.net/ListHelp
> > >
> >
> > --
> > You received this question notification because you are a member of ROHC
> > Team, which is an answer contact for rohc.
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~rohc
> > Post to : <email address hidden>
> > Unsubscribe : https://launchpad.net/~rohc
> > More help : https://help.launchpad.net/ListHelp
> >
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#33

> according to my analysis this file are create problem
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
> attempt to open /usr/local/lib/libgcc_s.so failed
> attempt to open /usr/local/lib/libgcc_s.a failed
> because they are not present in a directory.
> any suggestion regarding this problem.

I don't think so. I got same failures on my system. libgcc.a is found, so the libgcc.so failure is not a problem. libgcc_s.(so|a) is found in another directory.

Did you try to re-install as described in my previous message?

Didier

Revision history for this message
manish shivare (mshivare13) said :
#34

hello sir,
yes, i try to re-install according to your instruction
but still found compilation error-
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries...
yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking for sys/types.h... (cached) yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for gcc option to accept ISO C99... -std=gnu99
checking for malloc... yes
checking for calloc... yes
checking for free... yes
checking for memcpy... yes
checking for memcmp... yes
checking for ntohl... yes
checking for htonl... yes
checking for ntohs... yes
checking for htons... yes
checking for sched_setscheduler... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking whether the Linux kernel module shall be built... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating bzr_revno
config.status: creating src/Makefile
config.status: creating src/common/Makefile
config.status: creating src/common/protocols/Makefile
config.status: creating src/common/test/Makefile
config.status: creating src/comp/Makefile
config.status: creating src/comp/test/Makefile
config.status: creating src/decomp/Makefile
config.status: creating test/Makefile
config.status: creating test/functional/Makefile
config.status: creating test/functional/feedback2/Makefile
config.status: creating test/functional/feedback_ring/Makefile
config.status: creating test/functional/decompress_feedback_only/Makefile
config.status: creating test/functional/context_reuse/Makefile
config.status: creating test/functional/rtp_uor2_disambiguation/Makefile
config.status: creating test/functional/rtp_detection/Makefile
config.status: creating test/functional/segment/Makefile
config.status: creating test/robustness/Makefile
config.status: creating test/robustness/empty_payload/Makefile
config.status: creating test/robustness/damaged_packet/Makefile
config.status: creating test/robustness/lost_packet/Makefile
config.status: creating test/robustness/piggybacking_feedback/Makefile
config.status: creating test/robustness/malformed_rohc_packets/Makefile
config.status: creating test/non_regression/Makefile
config.status: creating statistics/Makefile
config.status: creating examples/Makefile
config.status: creating linux/Makefile
config.status: creating app/Makefile
config.status: creating app/performance/Makefile
config.status: creating app/tunnel/Makefile
config.status: creating app/sniffer/Makefile
config.status: creating app/fuzzer/Makefile
config.status: creating doc/doxygen.conf
config.status: creating doc/Makefile
config.status: creating contrib/Makefile
config.status: creating contrib/rohc.spec
config.status: creating rohc.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
manish@manish-HP-630-Notebook-PC:/tmp/rohc_sources/rohc-1.6.1$ make clean
all install
Making clean in src
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making clean in .
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
rm -rf .libs _libs
rm -f *.lo
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making clean in common
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making clean in protocols
make[3]: Entering directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
rm -rf .libs _libs
rm -f *.lo
make[3]: Leaving directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
Making clean in .
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
test -z "librohc_common.la" || rm -f librohc_common.la
rm -f ./so_locations
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making clean in test
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
 rm -f test_lsb_decode_wraparound test_lsb_decode_packet_loss
test_rtp_ts_wraparound
rm -rf .libs _libs
rm -f *.o
test -z "test_lsb_decode_wraparound.sh.log
test_lsb_decode_packet_loss.sh.log test_rtp_ts_wraparound.sh.log" || rm -f
test_lsb_decode_wraparound.sh.log test_lsb_decode_packet_loss.sh.log
test_rtp_ts_wraparound.sh.log
test -z "test_lsb_decode_wraparound.sh.trs
test_lsb_decode_packet_loss.sh.trs test_rtp_ts_wraparound.sh.trs" || rm -f
test_lsb_decode_wraparound.sh.trs test_lsb_decode_packet_loss.sh.trs
test_rtp_ts_wraparound.sh.trs
test -z "test-suite.log" || rm -f test-suite.log
rm -f *.lo
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making clean in comp
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making clean in .
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
test -z "librohc_comp.la" || rm -f librohc_comp.la
rm -f ./so_locations
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making clean in test
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
 rm -f test_api_robustness
rm -rf .libs _libs
rm -f *.o
test -z "test_api_robustness.sh.log" || rm -f test_api_robustness.sh.log
test -z "test_api_robustness.sh.trs" || rm -f test_api_robustness.sh.trs
test -z "test-suite.log" || rm -f test-suite.log
rm -f *.lo
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making clean in decomp
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
test -z "librohc_decomp.la" || rm -f librohc_decomp.la
rm -f ./so_locations
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making clean in app
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
rm -rf .libs _libs
rm -f *.lo
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
Making clean in contrib
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
rm -rf .libs _libs
rm -f *.lo
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1'
rm -rf .libs _libs
test -z "" || rm -f
test -z "" || rm -f
test -z "test-suite.log" || rm -f test-suite.log
rm -f *.lo
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1'
make all-recursive
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1'
Making all in src
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making all in .
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making all in common
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making all in protocols
make[4]: Entering directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
Making all in .
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
  CC librohc_common_la-rohc_common.lo
  CC librohc_common_la-rohc_packets.lo
  CC librohc_common_la-rohc_traces_internal.lo
  CC librohc_common_la-rohc_utils.lo
  CC librohc_common_la-crc.lo
  CC librohc_common_la-decode.lo
  CC librohc_common_la-ip_id_offset_decode.lo
  CC librohc_common_la-interval.lo
  CC librohc_common_la-lsb_decode.lo
  CC librohc_common_la-sdvl.lo
  CC librohc_common_la-wlsb.lo
  CC librohc_common_la-ip.lo
  CC librohc_common_la-ts_sc_comp.lo
  CC librohc_common_la-ts_sc_decomp.lo
  CC librohc_common_la-comp_list.lo
  CC librohc_common_la-cid.lo
  CCLD librohc_common.la
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making all in test
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making all in comp
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making all in .
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
  CC librohc_comp_la-rohc_comp.lo
  CC librohc_comp_la-c_uncompressed.lo
  CC librohc_comp_la-c_generic.lo
  CC librohc_comp_la-c_ip.lo
  CC librohc_comp_la-c_udp.lo
  CC librohc_comp_la-c_udp_lite.lo
  CC librohc_comp_la-c_esp.lo
  CC librohc_comp_la-c_rtp.lo
  CCLD librohc_comp.la
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making all in test
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making all in decomp
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
  CC librohc_decomp_la-rohc_decomp.lo
  CC librohc_decomp_la-feedback.lo
  CC librohc_decomp_la-d_uncompressed.lo
  CC librohc_decomp_la-d_generic.lo
  CC librohc_decomp_la-d_ip.lo
  CC librohc_decomp_la-d_udp.lo
  CC librohc_decomp_la-d_udp_lite.lo
  CC librohc_decomp_la-d_esp.lo
  CC librohc_decomp_la-d_rtp.lo
  CCLD librohc_decomp.la
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making all in app
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
Making all in contrib
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1'
Making install in src
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making install in .
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making install in common
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making install in protocols
make[3]: Entering directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
make[4]: Entering directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
make[3]: Leaving directory
`/tmp/rohc_sources/rohc-1.6.1/src/common/protocols'
Making install in .
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
 /bin/mkdir -p '/tmp/rohc_install/lib'
 /bin/bash ../../libtool --mode=install /usr/bin/install -c
librohc_common.la '/tmp/rohc_install/lib'
libtool: install: /usr/bin/install -c .libs/librohc_common.so.0.1.0
/tmp/rohc_install/lib/librohc_common.so.0.1.0
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_common.so.0.1.0 librohc_common.so.0 || { rm -f librohc_common.so.0
&& ln -s librohc_common.so.0.1.0 librohc_common.so.0; }; })
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_common.so.0.1.0 librohc_common.so || { rm -f librohc_common.so &&
ln -s librohc_common.so.0.1.0 librohc_common.so; }; })
libtool: install: /usr/bin/install -c .libs/librohc_common.lai
/tmp/rohc_install/lib/librohc_common.la
libtool: finish:
PATH="/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/manish/ns2/ns-allinone-2.31/bin:/home/manish/ns2/ns-allinone-2.31/tcl8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/tk8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/ns-2.31/::/sbin"
ldconfig -n /tmp/rohc_install/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/rohc_install/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/tmp/rohc_install/include'
 /usr/bin/install -c -m 644 rohc.h rohc_packets.h rohc_traces.h
'/tmp/rohc_install/include'
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making install in test
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common/test'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/common'
Making install in comp
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making install in .
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
 /bin/mkdir -p '/tmp/rohc_install/lib'
 /bin/bash ../../libtool --mode=install /usr/bin/install -c
librohc_comp.la '/tmp/rohc_install/lib'
libtool: install: warning: relinking `librohc_comp.la'
libtool: install: (cd /tmp/rohc_sources/rohc-1.6.1/src/comp; /bin/bash
/tmp/rohc_sources/rohc-1.6.1/libtool --silent --tag CC --mode=relink gcc
-std=gnu99 -g -Wall -Wstrict-prototypes -g -O2 -no-undefined -version-info
1:0:1 -L../../src/common/.libs -o librohc_comp.la -rpath
/tmp/rohc_install/lib librohc_comp_la-rohc_comp.lo
librohc_comp_la-c_uncompressed.lo librohc_comp_la-c_generic.lo
librohc_comp_la-c_ip.lo librohc_comp_la-c_udp.lo
librohc_comp_la-c_udp_lite.lo librohc_comp_la-c_esp.lo
librohc_comp_la-c_rtp.lo -lrohc_common )
libtool: install: /usr/bin/install -c .libs/librohc_comp.so.0.1.0T
/tmp/rohc_install/lib/librohc_comp.so.0.1.0
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_comp.so.0.1.0 librohc_comp.so.0 || { rm -f librohc_comp.so.0 && ln
-s librohc_comp.so.0.1.0 librohc_comp.so.0; }; })
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_comp.so.0.1.0 librohc_comp.so || { rm -f librohc_comp.so && ln -s
librohc_comp.so.0.1.0 librohc_comp.so; }; })
libtool: install: /usr/bin/install -c .libs/librohc_comp.lai
/tmp/rohc_install/lib/librohc_comp.la
libtool: finish:
PATH="/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/manish/ns2/ns-allinone-2.31/bin:/home/manish/ns2/ns-allinone-2.31/tcl8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/tk8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/ns-2.31/::/sbin"
ldconfig -n /tmp/rohc_install/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/rohc_install/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/tmp/rohc_install/include'
 /usr/bin/install -c -m 644 rohc_comp.h '/tmp/rohc_install/include'
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making install in test
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[4]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp/test'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/comp'
Making install in decomp
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
 /bin/mkdir -p '/tmp/rohc_install/lib'
 /bin/bash ../../libtool --mode=install /usr/bin/install -c
librohc_decomp.la '/tmp/rohc_install/lib'
libtool: install: warning: relinking `librohc_decomp.la'
libtool: install: (cd /tmp/rohc_sources/rohc-1.6.1/src/decomp; /bin/bash
/tmp/rohc_sources/rohc-1.6.1/libtool --silent --tag CC --mode=relink gcc
-std=gnu99 -g -Wall -Wstrict-prototypes -g -O2 -no-undefined -version-info
1:0:1 -L../../src/common/.libs -L../../src/comp/.libs -o
librohc_decomp.la-rpath /tmp/rohc_install/lib
librohc_decomp_la-rohc_decomp.lo
librohc_decomp_la-feedback.lo librohc_decomp_la-d_uncompressed.lo
librohc_decomp_la-d_generic.lo librohc_decomp_la-d_ip.lo
librohc_decomp_la-d_udp.lo librohc_decomp_la-d_udp_lite.lo
librohc_decomp_la-d_esp.lo librohc_decomp_la-d_rtp.lo -lrohc_common
-lrohc_comp )
libtool: install: /usr/bin/install -c .libs/librohc_decomp.so.0.1.0T
/tmp/rohc_install/lib/librohc_decomp.so.0.1.0
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_decomp.so.0.1.0 librohc_decomp.so.0 || { rm -f librohc_decomp.so.0
&& ln -s librohc_decomp.so.0.1.0 librohc_decomp.so.0; }; })
libtool: install: (cd /tmp/rohc_install/lib && { ln -s -f
librohc_decomp.so.0.1.0 librohc_decomp.so || { rm -f librohc_decomp.so &&
ln -s librohc_decomp.so.0.1.0 librohc_decomp.so; }; })
libtool: install: /usr/bin/install -c .libs/librohc_decomp.lai
/tmp/rohc_install/lib/librohc_decomp.la
libtool: finish:
PATH="/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/manish/ns2/ns-allinone-2.31/bin:/home/manish/ns2/ns-allinone-2.31/tcl8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/tk8.4.14/unix:/home/manish/ns2/ns-allinone-2.31/ns-2.31/::/sbin"
ldconfig -n /tmp/rohc_install/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/rohc_install/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/tmp/rohc_install/include'
 /usr/bin/install -c -m 644 rohc_decomp.h '/tmp/rohc_install/include'
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src/decomp'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/src'
Making install in app
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[3]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/app'
Making install in contrib
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1/contrib'
make[1]: Entering directory `/tmp/rohc_sources/rohc-1.6.1'
make[2]: Entering directory `/tmp/rohc_sources/rohc-1.6.1'
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/tmp/rohc_install/share/doc/rohc'
 /usr/bin/install -c -m 644 README INSTALL COPYING AUTHORS ChangeLog
'/tmp/rohc_install/share/doc/rohc'
 /bin/mkdir -p '/tmp/rohc_install/lib/pkgconfig'
 /usr/bin/install -c -m 644 rohc.pc '/tmp/rohc_install/lib/pkgconfig'
make[2]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1'
make[1]: Leaving directory `/tmp/rohc_sources/rohc-1.6.1'
manish@manish-HP-630-Notebook-PC:/tmp/rohc_sources/rohc-1.6.1$ cd ..
manish@manish-HP-630-Notebook-PC:/tmp/rohc_sources$ cat >
test_rohc_common.c << EOF
> #include <stdlib.h>
> #include <stdio.h>
> #include <rohc.h>
> int main(int argc, char **argv)
> {
> printf("ROHC version %s\n", rohc_version());
> return 0;
> }
> EOF
manish@manish-HP-630-Notebook-PC:/tmp/rohc_sources$ gcc -o test_rohc_common
-g -Wall -I/tmp/rohc_install/include -lrohc_common
-L/tmp/rohc_install/lib/ test_rohc_common.c
/tmp/cchpXK8J.o: In function `main':
/tmp/rohc_sources/test_rohc_common.c:6: undefined reference to
`rohc_version'
collect2: error: ld returned 1 exit status

On Sat, Sep 7, 2013 at 6:36 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Didier Barvaux posted a new comment:
> > according to my analysis this file are create problem
> > attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
> > attempt to open /usr/local/lib/libgcc_s.so failed
> > attempt to open /usr/local/lib/libgcc_s.a failed
> > because they are not present in a directory.
> > any suggestion regarding this problem.
>
> I don't think so. I got same failures on my system. libgcc.a is found,
> so the libgcc.so failure is not a problem. libgcc_s.(so|a) is found in
> another directory.
>
> Did you try to re-install as described in my previous message?
>
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#35

Thanks. The problem was probably not caused by the previous installation. It may be either a global problem with your system (gcc, ld...) or a specific problem with librohc. Let's try to build a small application that links with another library, libpcap.

$ sudo apt-get install libpcap libpcap-dev # if not already installed
$ cat > test_pcap.c << EOF
> #include <pcap/pcap.h>
>
> int main(int argc, char *argv[])
> {
> pcap_t *handle;
> handle = pcap_open_dead(DLT_LINUX_SLL, 5);
> pcap_close(handle);
> return 0;
> }
> EOF
$ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
$ file test_pcap
$ ldd test_pcap

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#36

thank u for reply. but i still found the same problem.
this is log
manish@manish-HP-630-Notebook-PC:~$ cat test_pcap.c#include <pcap/pcap.h>
int main(int argc, char *argv[])
{
pcap_t *handle;
handle = pcap_open_dead(DLT_LINUX_SLL, 5);
pcap_close(handle);
return 0;
}
manish@manish-HP-630-Notebook-PC:~$ gcc -Wl,--verbose -o test_pca-lpcap
test_pcap.c
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
  Supported emulations:
   elf_i386
   i386linux
   elf32_x86_64
   elf_x86_64
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
          "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
. = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
  .interp : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash : { *(.hash) }
  .gnu.hash : { *(.gnu.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version : { *(.gnu.version) }
  .gnu.version_d : { *(.gnu.version_d) }
  .gnu.version_r : { *(.gnu.version_r) }
  .rel.dyn :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ifunc)
    }
  .rel.plt :
    {
      *(.rel.plt)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .init :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt : { *(.plt) *(.iplt) }
  .text :
  {
    *(.text.unlikely .text.*_unlikely)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
  }
  .fini :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1 : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler. */
  .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment. We want to adjust up to
     the same address within the page on the next page up. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling */
  .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections */
  .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first. Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard. The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in. */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic : { *(.dynamic) }
  .got : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
  .got.plt : { *(.got.plt) *(.igot.plt) }
  .data :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1 : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end. Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section. */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections. */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0. */
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges 0 : { *(.debug_ranges) }
  /* DWARF Extension. */
  .debug_macro 0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o
attempt to open /tmp/ccvbPF0j.o succeeded
/tmp/ccvbPF0j.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libc.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so succeeded
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
opened script file
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libc.so
attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
/lib/i386-linux-gnu/libc.so.6
attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
(/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
/lib/i386-linux-gnu/ld-linux.so.2
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.7/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.7/crtend.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/crtend.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o
ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
/tmp/ccvbPF0j.o: In function `main':
test_pcap.c:(.text+0x19): undefined reference to `pcap_open_dead'
test_pcap.c:(.text+0x29): undefined reference to `pcap_close'
collect2: error: ld returned 1 exit status

i am also try another program its working is fine. i am providing a log
manish@manish-HP-630-Notebook-PC:~$ cat test.c
 #include <stdio.h>
    #include <pcap.h>

    int main(int argc, char *argv[])
    {
        char *dev, errbuf[PCAP_ERRBUF_SIZE];

        dev = pcap_lookupdev(errbuf);
        if (dev == NULL) {
            fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
            return(2);
        }
        printf("Device: %s\n", dev);
        return(0);
    }

manish@manish-HP-630-Notebook-PC:~$ gcc test.c -lpcap
manish@manish-HP-630-Notebook-PC:~$ sudo ./a.out
[sudo] password for manish:
Device: eth0
waiting for your reply

On Sun, Sep 8, 2013 at 1:56 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Thanks. The problem was probably not caused by the previous
> installation. It may be either a global problem with your system (gcc,
> ld...) or a specific problem with librohc. Let's try to build a small
> application that links with another library, libpcap.
>
> $ sudo apt-get install libpcap libpcap-dev # if not already installed
> $ cat > test_pcap.c << EOF
> > #include <pcap/pcap.h>
> >
> > int main(int argc, char *argv[])
> > {
> > pcap_t *handle;
> > handle = pcap_open_dead(DLT_LINUX_SLL, 5);
> > pcap_close(handle);
> > return 0;
> > }
> > EOF
> $ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
> $ file test_pcap
> $ ldd test_pcap
>
> Regards,
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#37

Hello,

Thanks for the output. You seem however to have mistyped the command:

Wrong: gcc -Wl,--verbose -o test_pca-lpcap test_pcap.c
Right: gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c

The first version makes the -lpcap option part of the binary name. It could explain the error you encounter.
Please try again with the 2nd version.

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#38

pardon me for my silly mistake. this is the log after running 2nd Version.
manish@manish-HP-630-Notebook-PC:~$ cat test_pcap.c
#include <pcap/pcap.h>
int main(int argc, char *argv[])
{
pcap_t *handle;
handle = pcap_open_dead(DLT_LINUX_SLL, 5);
pcap_close(handle);
return 0;
}
manish@manish-HP-630-Notebook-PC:~$ gcc -Wl,--verbose -o test_pcap -lpcap
test_pcap.c
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
  Supported emulations:
   elf_i386
   i386linux
   elf32_x86_64
   elf_x86_64
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
          "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
. = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
  .interp : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash : { *(.hash) }
  .gnu.hash : { *(.gnu.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version : { *(.gnu.version) }
  .gnu.version_d : { *(.gnu.version_d) }
  .gnu.version_r : { *(.gnu.version_r) }
  .rel.dyn :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ifunc)
    }
  .rel.plt :
    {
      *(.rel.plt)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .init :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt : { *(.plt) *(.iplt) }
  .text :
  {
    *(.text.unlikely .text.*_unlikely)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
  }
  .fini :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1 : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler. */
  .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment. We want to adjust up to
     the same address within the page on the next page up. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling */
  .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections */
  .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first. Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard. The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in. */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic : { *(.dynamic) }
  .got : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
  .got.plt : { *(.got.plt) *(.igot.plt) }
  .data :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1 : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end. Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section. */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections. */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0. */
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges 0 : { *(.debug_ranges) }
  /* DWARF Extension. */
  .debug_macro 0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so succeeded
-lpcap (/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so)
attempt to open /tmp/cc0MERjt.o succeeded
/tmp/cc0MERjt.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so succeeded
opened script file
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
opened script file
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
/lib/i386-linux-gnu/libc.so.6
attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
(/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
/lib/i386-linux-gnu/ld-linux.so.2
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
/tmp/cc0MERjt.o: In function `main':
test_pcap.c:(.text+0x19): undefined reference to `pcap_open_dead'
test_pcap.c:(.text+0x29): undefined reference to `pcap_close'
collect2: error: ld returned 1 exit status

sorry for giving trouble to you. but this rohc library is require for my
project.
thank you

On Mon, Sep 9, 2013 at 12:51 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Hello,
>
> Thanks for the output. You seem however to have mistyped the command:
>
> Wrong: gcc -Wl,--verbose -o test_pca-lpcap test_pcap.c
> Right: gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
>
> The first version makes the -lpcap option part of the binary name. It
> could explain the error you encounter.
> Please try again with the 2nd version.
>
> Regards,
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#39

Your system got a problem: a small program with librohc or libpcap fails to link, another succeeds with libpcap. If you have access to another Ubuntu 12.10 32-bit system, could you please try to link the same small programs?

Revision history for this message
manish shivare (mshivare13) said :
#40

hello sir ,
this is not comfortable for me to re-install my ubuntu 12.10.
i am try below command
manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
-lpcap
manish@manish-HP-630-Notebook-PC:~$ file test_pcap
test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
manish@manish-HP-630-Notebook-PC:~$ ldd test_pcap
    linux-gate.so.1 => (0xb7766000)
    libpcap.so.0.8 => /usr/lib/i386-linux-gnu/libpcap.so.0.8 (0xb7713000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7569000)
    /lib/ld-linux.so.2 (0xb7767000)
on behalf of your suggest command.
its working seems to find.
but i am not able to get proper linker order to run rohc library.
please suggest me how to attach library file with linker in a manual mode
and automatic both.
or suggest any reference regarding this because i am beginner for linux.
thank you

On Mon, Sep 9, 2013 at 6:01 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Your system got a problem: a small program with librohc or libpcap fails
> to link, another succeeds with libpcap. If you have access to another
> Ubuntu 12.10 32-bit system, could you please try to link the same small
> programs?
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#41

Hello,

Do you mean that the command below does not work:
  $ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c

And the command below works:
  $ gcc -Wall test_pcap.c -o test_pcap -lpcap

with the same content in the test_pcap.c file?

Regards,
Didier

Revision history for this message
manish shivare (mshivare13) said :
#42

thanks for reply,
i am providing log of both command.
manish@manish-HP-630-Notebook-PC:~$ gcc -Wl,--verbose -o test_pcap -lpcap
test_pcap.c
GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
  Supported emulations:
   elf_i386
   i386linux
   elf32_x86_64
   elf_x86_64
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
          "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
. = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
  .interp : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash : { *(.hash) }
  .gnu.hash : { *(.gnu.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .gnu.version : { *(.gnu.version) }
  .gnu.version_d : { *(.gnu.version_d) }
  .gnu.version_r : { *(.gnu.version_r) }
  .rel.dyn :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ifunc)
    }
  .rel.plt :
    {
      *(.rel.plt)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .init :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt : { *(.plt) *(.iplt) }
  .text :
  {
    *(.text.unlikely .text.*_unlikely)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em. */
    *(.gnu.warning)
  }
  .fini :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1 : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler. */
  .exception_ranges : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment. We want to adjust up to
     the same address within the page on the next page up. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling */
  .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections */
  .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array))
    KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
.dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first. Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard. The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in. */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic : { *(.dynamic) }
  .got : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
  .got.plt : { *(.got.plt) *(.igot.plt) }
  .data :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1 : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end. Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section. */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections. */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  .stab.excl 0 : { *(.stab.excl) }
  .stab.exclstr 0 : { *(.stab.exclstr) }
  .stab.index 0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0. */
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges 0 : { *(.debug_ranges) }
  /* DWARF Extension. */
  .debug_macro 0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so succeeded
-lpcap (/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so)
attempt to open /tmp/ccWKcRXK.o succeeded
/tmp/ccWKcRXK.o
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.a failed
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so succeeded
opened script file
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
opened script file
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
/lib/i386-linux-gnu/libc.so.6
attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
(/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
/lib/i386-linux-gnu/ld-linux.so.2
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/crtend.o
attempt to open
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o succeeded
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
/tmp/ccWKcRXK.o: In function `main':
test_pcap.c:(.text+0x19): undefined reference to `pcap_open_dead'
test_pcap.c:(.text+0x29): undefined reference to `pcap_close'
collect2: error: ld returned 1 exit status
output of second command
manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
-lpcap
manish@manish-HP-630-Notebook-PC:~$ file test_pcap
test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
manish@manish-HP-630-Notebook-PC:~$ ldd test_pcap
    linux-gate.so.1 => (0xb779b000)
    libpcap.so.0.8 => /usr/lib/i386-linux-gnu/libpcap.so.0.8 (0xb7748000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb759e000)
    /lib/ld-linux.so.2 (0xb779c000)
second command log is compile the program properly.
any suggestion regrading this.
and you did not given any advise for my previous query about compiling
librohc.
i am waiting for your reply.

On Tue, Sep 10, 2013 at 10:31 PM, Didier Barvaux <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Open => Needs information
>
> Didier Barvaux requested more information:
> Hello,
>
> Do you mean that the command below does not work:
> $ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
>
> And the command below works:
> $ gcc -Wall test_pcap.c -o test_pcap -lpcap
>
> with the same content in the test_pcap.c file?
>
> Regards,
> Didier
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#43

Could you please the following variants of the command lines:
$ gcc -Wl,--verbose -Wall test_pcap.c -o test_pcap -lpcap
$ gcc -Wl,--verbose test_pcap.c -o test_pcap -lpcap
$ gcc -Wall -o test_pcap -lpcap test_pcap.c
$ gcc -o test_pcap -lpcap test_pcap.c

Revision history for this message
manish shivare (mshivare13) said :
#44

hello sir,
sorry for bothering you.
but suggested all command is given same output only below command compile.
 manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
-lpcap
manish@manish-HP-630-Notebook-PC:~$ sudo file test_pcap
[sudo] password for manish:
test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
the output of command is correct or not?
because i don't know what is the output of the test_pcap.c
and you are not providing any suggestion for running rohc my major concern
on rohc library not pcap library.
i only want to use rohc library for compression and decompression of my
self created pkt.
i don't want to capture network traffic. so please suggest me how to
compile sample_rohc_program.c.
In my system linker problem is found so please suggest me how to resolve it
manual linker command.
if you provide syntax of command it is very helpful for me.
thank you.

On Tue, Sep 10, 2013 at 11:11 PM, manish shivare <
<email address hidden>> wrote:

> Question #234832 on rohc changed:
> https://answers.launchpad.net/rohc/+question/234832
>
> Status: Needs information => Open
>
> manish shivare gave more information on the question:
> thanks for reply,
> i am providing log of both command.
> manish@manish-HP-630-Notebook-PC:~$ gcc -Wl,--verbose -o test_pcap -lpcap
> test_pcap.c
> GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
> Supported emulations:
> elf_i386
> i386linux
> elf32_x86_64
> elf_x86_64
> elf_l1om
> elf_k1om
> using internal linker script:
> ==================================================
> /* Script for -z combreloc: combine and sort reloc sections */
> OUTPUT_FORMAT("elf32-i386", "elf32-i386",
> "elf32-i386")
> OUTPUT_ARCH(i386)
> ENTRY(_start)
> SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
> SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
> SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
> SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
> SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
> SEARCH_DIR("=/usr/lib");
> SECTIONS
> {
> /* Read-only sections, merged into text segment: */
> PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08048000));
> . = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
> .interp : { *(.interp) }
> .note.gnu.build-id : { *(.note.gnu.build-id) }
> .hash : { *(.hash) }
> .gnu.hash : { *(.gnu.hash) }
> .dynsym : { *(.dynsym) }
> .dynstr : { *(.dynstr) }
> .gnu.version : { *(.gnu.version) }
> .gnu.version_d : { *(.gnu.version_d) }
> .gnu.version_r : { *(.gnu.version_r) }
> .rel.dyn :
> {
> *(.rel.init)
> *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
> *(.rel.fini)
> *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
> *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
> *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
> *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
> *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
> *(.rel.ctors)
> *(.rel.dtors)
> *(.rel.got)
> *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
> *(.rel.ifunc)
> }
> .rel.plt :
> {
> *(.rel.plt)
> PROVIDE_HIDDEN (__rel_iplt_start = .);
> *(.rel.iplt)
> PROVIDE_HIDDEN (__rel_iplt_end = .);
> }
> .init :
> {
> KEEP (*(SORT_NONE(.init)))
> }
> .plt : { *(.plt) *(.iplt) }
> .text :
> {
> *(.text.unlikely .text.*_unlikely)
> *(.text.exit .text.exit.*)
> *(.text.startup .text.startup.*)
> *(.text.hot .text.hot.*)
> *(.text .stub .text.* .gnu.linkonce.t.*)
> /* .gnu.warning sections are handled specially by elf32.em. */
> *(.gnu.warning)
> }
> .fini :
> {
> KEEP (*(SORT_NONE(.fini)))
> }
> PROVIDE (__etext = .);
> PROVIDE (_etext = .);
> PROVIDE (etext = .);
> .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
> .rodata1 : { *(.rodata1) }
> .eh_frame_hdr : { *(.eh_frame_hdr) }
> .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
> .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
> .gcc_except_table.*) }
> /* These sections are generated by the Sun/Oracle C++ compiler. */
> .exception_ranges : ONLY_IF_RO { *(.exception_ranges
> .exception_ranges*) }
> /* Adjust the address for the data segment. We want to adjust up to
> the same address within the page on the next page up. */
> . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
> (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
> (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
> /* Exception handling */
> .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
> .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
> .gcc_except_table.*) }
> .exception_ranges : ONLY_IF_RW { *(.exception_ranges
> .exception_ranges*) }
> /* Thread Local Storage sections */
> .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
> .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
> .preinit_array :
> {
> PROVIDE_HIDDEN (__preinit_array_start = .);
> KEEP (*(.preinit_array))
> PROVIDE_HIDDEN (__preinit_array_end = .);
> }
> .init_array :
> {
> PROVIDE_HIDDEN (__init_array_start = .);
> KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> KEEP (*(.init_array))
> KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
> .ctors))
> PROVIDE_HIDDEN (__init_array_end = .);
> }
> .fini_array :
> {
> PROVIDE_HIDDEN (__fini_array_start = .);
> KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
> SORT_BY_INIT_PRIORITY(.dtors.*)))
> KEEP (*(.fini_array))
> KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
> .dtors))
> PROVIDE_HIDDEN (__fini_array_end = .);
> }
> .ctors :
> {
> /* gcc uses crtbegin.o to find the start of
> the constructors, so we make sure it is
> first. Because this is a wildcard, it
> doesn't matter if the user does not
> actually link against crtbegin.o; the
> linker won't look for a file to match a
> wildcard. The wildcard also means that it
> doesn't matter which directory crtbegin.o
> is in. */
> KEEP (*crtbegin.o(.ctors))
> KEEP (*crtbegin?.o(.ctors))
> /* We don't want to include the .ctor section from
> the crtend.o file until after the sorted ctors.
> The .ctor section from the crtend file contains the
> end of ctors marker and it must be last */
> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
> KEEP (*(SORT(.ctors.*)))
> KEEP (*(.ctors))
> }
> .dtors :
> {
> KEEP (*crtbegin.o(.dtors))
> KEEP (*crtbegin?.o(.dtors))
> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
> KEEP (*(SORT(.dtors.*)))
> KEEP (*(.dtors))
> }
> .jcr : { KEEP (*(.jcr)) }
> .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
> *(.
> data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
> .dynamic : { *(.dynamic) }
> .got : { *(.got) *(.igot) }
> . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
> .got.plt : { *(.got.plt) *(.igot.plt) }
> .data :
> {
> *(.data .data.* .gnu.linkonce.d.*)
> SORT(CONSTRUCTORS)
> }
> .data1 : { *(.data1) }
> _edata = .; PROVIDE (edata = .);
> . = .;
> __bss_start = .;
> .bss :
> {
> *(.dynbss)
> *(.bss .bss.* .gnu.linkonce.b.*)
> *(COMMON)
> /* Align here to ensure that the .bss section occupies space up to
> _end. Align after .bss to ensure correct alignment even if the
> .bss section disappears because there are no input sections.
> FIXME: Why do we need it? When there is no .bss section, we don't
> pad the .data section. */
> . = ALIGN(. != 0 ? 32 / 8 : 1);
> }
> . = ALIGN(32 / 8);
> . = ALIGN(32 / 8);
> _end = .; PROVIDE (end = .);
> . = DATA_SEGMENT_END (.);
> /* Stabs debugging sections. */
> .stab 0 : { *(.stab) }
> .stabstr 0 : { *(.stabstr) }
> .stab.excl 0 : { *(.stab.excl) }
> .stab.exclstr 0 : { *(.stab.exclstr) }
> .stab.index 0 : { *(.stab.index) }
> .stab.indexstr 0 : { *(.stab.indexstr) }
> .comment 0 : { *(.comment) }
> /* DWARF debug sections.
> Symbols in the DWARF debugging sections are relative to the beginning
> of the section so we begin them at 0. */
> /* DWARF 1 */
> .debug 0 : { *(.debug) }
> .line 0 : { *(.line) }
> /* GNU DWARF 1 extensions */
> .debug_srcinfo 0 : { *(.debug_srcinfo) }
> .debug_sfnames 0 : { *(.debug_sfnames) }
> /* DWARF 1.1 and DWARF 2 */
> .debug_aranges 0 : { *(.debug_aranges) }
> .debug_pubnames 0 : { *(.debug_pubnames) }
> /* DWARF 2 */
> .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
> .debug_abbrev 0 : { *(.debug_abbrev) }
> .debug_line 0 : { *(.debug_line) }
> .debug_frame 0 : { *(.debug_frame) }
> .debug_str 0 : { *(.debug_str) }
> .debug_loc 0 : { *(.debug_loc) }
> .debug_macinfo 0 : { *(.debug_macinfo) }
> /* SGI/MIPS DWARF 2 extensions */
> .debug_weaknames 0 : { *(.debug_weaknames) }
> .debug_funcnames 0 : { *(.debug_funcnames) }
> .debug_typenames 0 : { *(.debug_typenames) }
> .debug_varnames 0 : { *(.debug_varnames) }
> /* DWARF 3 */
> .debug_pubtypes 0 : { *(.debug_pubtypes) }
> .debug_ranges 0 : { *(.debug_ranges) }
> /* DWARF Extension. */
> .debug_macro 0 : { *(.debug_macro) }
> .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
> /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
> }
>
>
> ==================================================
> attempt to open
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o succeeded
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o
> attempt to open
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o succeeded
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o succeeded
> /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.so failed
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.a failed
> attempt to open
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so
> succeeded
> -lpcap (/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so)
> attempt to open /tmp/ccWKcRXK.o succeeded
> /tmp/ccWKcRXK.o
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
> -lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.so failed
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.a failed
> attempt to open
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so succeeded
> opened script file
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
> opened script file
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
> attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
> /lib/i386-linux-gnu/libc.so.6
> attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
> (/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
> attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
> /lib/i386-linux-gnu/ld-linux.so.2
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
> -lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o succeeded
> /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o
> attempt to open
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o succeeded
> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
> ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
> found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
> /tmp/ccWKcRXK.o: In function `main':
> test_pcap.c:(.text+0x19): undefined reference to `pcap_open_dead'
> test_pcap.c:(.text+0x29): undefined reference to `pcap_close'
> collect2: error: ld returned 1 exit status
> output of second command
> manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
> -lpcap
> manish@manish-HP-630-Notebook-PC:~$ file test_pcap
> test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
> dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
> BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
> manish@manish-HP-630-Notebook-PC:~$ ldd test_pcap
> linux-gate.so.1 => (0xb779b000)
> libpcap.so.0.8 => /usr/lib/i386-linux-gnu/libpcap.so.0.8 (0xb7748000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb759e000)
> /lib/ld-linux.so.2 (0xb779c000)
> second command log is compile the program properly.
> any suggestion regrading this.
> and you did not given any advise for my previous query about compiling
> librohc.
> i am waiting for your reply.
>
>
>
> On Tue, Sep 10, 2013 at 10:31 PM, Didier Barvaux <
> <email address hidden>> wrote:
>
> > Question #234832 on rohc changed:
> > https://answers.launchpad.net/rohc/+question/234832
> >
> > Status: Open => Needs information
> >
> > Didier Barvaux requested more information:
> > Hello,
> >
> > Do you mean that the command below does not work:
> > $ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
> >
> > And the command below works:
> > $ gcc -Wall test_pcap.c -o test_pcap -lpcap
> >
> > with the same content in the test_pcap.c file?
> >
> > Regards,
> > Didier
> >
> > --
> > You received this question notification because you are a member of ROHC
> > Team, which is an answer contact for rohc.
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~rohc
> > Post to : <email address hidden>
> > Unsubscribe : https://launchpad.net/~rohc
> > More help : https://help.launchpad.net/ListHelp
> >
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
manish shivare (mshivare13) said :
#45

and i also try the syntax which is given on
http://rohc-lib.org/wiki/doku.php?id=library-first-application.
log is -
manish@manish-HP-630-Notebook-PC:~/rohc_first_application$ gcc -o
rohc_first_application -g -Wall $(
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config rohc --libs --cflags
) rohc_first_application.c
rohc_first_application.c: In function ‘main’:
rohc_first_application.c:101:2: warning: implicit declaration of function
‘rohc_comp_new’ [-Wimplicit-function-declaration]
  compressor = rohc_comp_new(ROHC_SMALL_CID, ROHC_SMALL_CID_MAX);
  ^
rohc_first_application.c:101:13: warning: assignment makes pointer from
integer without a cast [enabled by default]
  compressor = rohc_comp_new(ROHC_SMALL_CID, ROHC_SMALL_CID_MAX);
             ^
rohc_first_application.c:119:2: warning: implicit declaration of function
‘rohc_comp_enable_profile’ [-Wimplicit-function-declaration]
  if(!rohc_comp_enable_profile(compressor, ROHC_PROFILE_UNCOMPRESSED))
  ^
rohc_first_application.c:131:2: warning: implicit declaration of function
‘rohc_comp_enable_profiles’ [-Wimplicit-function-declaration]
  if(!rohc_comp_enable_profiles(compressor, ROHC_PROFILE_UDP,
  ^
rohc_first_application.c:187:2: warning: implicit declaration of function
‘rohc_compress3’ [-Wimplicit-function-declaration]
  ret = rohc_compress3(compressor, arrival_time, ip_packet, ip_packet_len,
  ^
rohc_first_application.c:238:2: warning: implicit declaration of function
‘rohc_comp_free’ [-Wimplicit-function-declaration]
  rohc_comp_free(compressor);
  ^
/tmp/cctkfFbq.o: In function `main':
/home/manish/rohc_first_application/rohc_first_application.c:101: undefined
reference to `rohc_comp_new'
/home/manish/rohc_first_application/rohc_first_application.c:110: undefined
reference to `rohc_comp_set_random_cb'
/home/manish/rohc_first_application/rohc_first_application.c:119: undefined
reference to `rohc_comp_enable_profile'
/home/manish/rohc_first_application/rohc_first_application.c:124: undefined
reference to `rohc_comp_enable_profile'
/home/manish/rohc_first_application/rohc_first_application.c:131: undefined
reference to `rohc_comp_enable_profiles'
/home/manish/rohc_first_application/rohc_first_application.c:187: undefined
reference to `rohc_compress3'
/home/manish/rohc_first_application/rohc_first_application.c:238: undefined
reference to `rohc_comp_free'
/home/manish/rohc_first_application/rohc_first_application.c:250: undefined
reference to `rohc_comp_free'
collect2: error: ld returned 1 exit status

On Thu, Sep 12, 2013 at 11:57 PM, manish <email address hidden> wrote:

> hello sir,
> sorry for bothering you.
> but suggested all command is given same output only below command compile.
>
> manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
> -lpcap
> manish@manish-HP-630-Notebook-PC:~$ sudo file test_pcap
> [sudo] password for manish:
> test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
> dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
> BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
> the output of command is correct or not?
> because i don't know what is the output of the test_pcap.c
> and you are not providing any suggestion for running rohc my major concern
> on rohc library not pcap library.
> i only want to use rohc library for compression and decompression of my
> self created pkt.
> i don't want to capture network traffic. so please suggest me how to
> compile sample_rohc_program.c.
> In my system linker problem is found so please suggest me how to resolve
> it manual linker command.
> if you provide syntax of command it is very helpful for me.
> thank you.
>
>
> On Tue, Sep 10, 2013 at 11:11 PM, manish shivare <
> <email address hidden>> wrote:
>
>> Question #234832 on rohc changed:
>> https://answers.launchpad.net/rohc/+question/234832
>>
>> Status: Needs information => Open
>>
>> manish shivare gave more information on the question:
>> thanks for reply,
>> i am providing log of both command.
>> manish@manish-HP-630-Notebook-PC:~$ gcc -Wl,--verbose -o test_pcap -lpcap
>> test_pcap.c
>> GNU ld (GNU Binutils for Ubuntu) 2.22.90.20120924
>> Supported emulations:
>> elf_i386
>> i386linux
>> elf32_x86_64
>> elf_x86_64
>> elf_l1om
>> elf_k1om
>> using internal linker script:
>> ==================================================
>> /* Script for -z combreloc: combine and sort reloc sections */
>> OUTPUT_FORMAT("elf32-i386", "elf32-i386",
>> "elf32-i386")
>> OUTPUT_ARCH(i386)
>> ENTRY(_start)
>> SEARCH_DIR("/usr/i686-linux-gnu/lib32"); SEARCH_DIR("=/usr/local/lib32");
>> SEARCH_DIR("=/lib32"); SEARCH_DIR("=/usr/lib32");
>> SEARCH_DIR("=/usr/local/lib/i386-linux-gnu");
>> SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib/i386-linux-gnu");
>> SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib/i386-linux-gnu");
>> SEARCH_DIR("=/usr/lib");
>> SECTIONS
>> {
>> /* Read-only sections, merged into text segment: */
>> PROVIDE (__executable_start = SEGMENT_START("text-segment",
>> 0x08048000));
>> . = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS;
>> .interp : { *(.interp) }
>> .note.gnu.build-id : { *(.note.gnu.build-id) }
>> .hash : { *(.hash) }
>> .gnu.hash : { *(.gnu.hash) }
>> .dynsym : { *(.dynsym) }
>> .dynstr : { *(.dynstr) }
>> .gnu.version : { *(.gnu.version) }
>> .gnu.version_d : { *(.gnu.version_d) }
>> .gnu.version_r : { *(.gnu.version_r) }
>> .rel.dyn :
>> {
>> *(.rel.init)
>> *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
>> *(.rel.fini)
>> *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
>> *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
>> *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
>> *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
>> *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
>> *(.rel.ctors)
>> *(.rel.dtors)
>> *(.rel.got)
>> *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
>> *(.rel.ifunc)
>> }
>> .rel.plt :
>> {
>> *(.rel.plt)
>> PROVIDE_HIDDEN (__rel_iplt_start = .);
>> *(.rel.iplt)
>> PROVIDE_HIDDEN (__rel_iplt_end = .);
>> }
>> .init :
>> {
>> KEEP (*(SORT_NONE(.init)))
>> }
>> .plt : { *(.plt) *(.iplt) }
>> .text :
>> {
>> *(.text.unlikely .text.*_unlikely)
>> *(.text.exit .text.exit.*)
>> *(.text.startup .text.startup.*)
>> *(.text.hot .text.hot.*)
>> *(.text .stub .text.* .gnu.linkonce.t.*)
>> /* .gnu.warning sections are handled specially by elf32.em. */
>> *(.gnu.warning)
>> }
>> .fini :
>> {
>> KEEP (*(SORT_NONE(.fini)))
>> }
>> PROVIDE (__etext = .);
>> PROVIDE (_etext = .);
>> PROVIDE (etext = .);
>> .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
>> .rodata1 : { *(.rodata1) }
>> .eh_frame_hdr : { *(.eh_frame_hdr) }
>> .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
>> .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
>> .gcc_except_table.*) }
>> /* These sections are generated by the Sun/Oracle C++ compiler. */
>> .exception_ranges : ONLY_IF_RO { *(.exception_ranges
>> .exception_ranges*) }
>> /* Adjust the address for the data segment. We want to adjust up to
>> the same address within the page on the next page up. */
>> . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
>> (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
>> (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
>> /* Exception handling */
>> .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
>> .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table
>> .gcc_except_table.*) }
>> .exception_ranges : ONLY_IF_RW { *(.exception_ranges
>> .exception_ranges*) }
>> /* Thread Local Storage sections */
>> .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
>> .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
>> .preinit_array :
>> {
>> PROVIDE_HIDDEN (__preinit_array_start = .);
>> KEEP (*(.preinit_array))
>> PROVIDE_HIDDEN (__preinit_array_end = .);
>> }
>> .init_array :
>> {
>> PROVIDE_HIDDEN (__init_array_start = .);
>> KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
>> SORT_BY_INIT_PRIORITY(.ctors.*)))
>> KEEP (*(.init_array))
>> KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
>> .ctors))
>> PROVIDE_HIDDEN (__init_array_end = .);
>> }
>> .fini_array :
>> {
>> PROVIDE_HIDDEN (__fini_array_start = .);
>> KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
>> SORT_BY_INIT_PRIORITY(.dtors.*)))
>> KEEP (*(.fini_array))
>> KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o )
>> .dtors))
>> PROVIDE_HIDDEN (__fini_array_end = .);
>> }
>> .ctors :
>> {
>> /* gcc uses crtbegin.o to find the start of
>> the constructors, so we make sure it is
>> first. Because this is a wildcard, it
>> doesn't matter if the user does not
>> actually link against crtbegin.o; the
>> linker won't look for a file to match a
>> wildcard. The wildcard also means that it
>> doesn't matter which directory crtbegin.o
>> is in. */
>> KEEP (*crtbegin.o(.ctors))
>> KEEP (*crtbegin?.o(.ctors))
>> /* We don't want to include the .ctor section from
>> the crtend.o file until after the sorted ctors.
>> The .ctor section from the crtend file contains the
>> end of ctors marker and it must be last */
>> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
>> KEEP (*(SORT(.ctors.*)))
>> KEEP (*(.ctors))
>> }
>> .dtors :
>> {
>> KEEP (*crtbegin.o(.dtors))
>> KEEP (*crtbegin?.o(.dtors))
>> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
>> KEEP (*(SORT(.dtors.*)))
>> KEEP (*(.dtors))
>> }
>> .jcr : { KEEP (*(.jcr)) }
>> .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
>> *(.
>> data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
>> .dynamic : { *(.dynamic) }
>> .got : { *(.got) *(.igot) }
>> . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 12 ? 12 : 0, .);
>> .got.plt : { *(.got.plt) *(.igot.plt) }
>> .data :
>> {
>> *(.data .data.* .gnu.linkonce.d.*)
>> SORT(CONSTRUCTORS)
>> }
>> .data1 : { *(.data1) }
>> _edata = .; PROVIDE (edata = .);
>> . = .;
>> __bss_start = .;
>> .bss :
>> {
>> *(.dynbss)
>> *(.bss .bss.* .gnu.linkonce.b.*)
>> *(COMMON)
>> /* Align here to ensure that the .bss section occupies space up to
>> _end. Align after .bss to ensure correct alignment even if the
>> .bss section disappears because there are no input sections.
>> FIXME: Why do we need it? When there is no .bss section, we don't
>> pad the .data section. */
>> . = ALIGN(. != 0 ? 32 / 8 : 1);
>> }
>> . = ALIGN(32 / 8);
>> . = ALIGN(32 / 8);
>> _end = .; PROVIDE (end = .);
>> . = DATA_SEGMENT_END (.);
>> /* Stabs debugging sections. */
>> .stab 0 : { *(.stab) }
>> .stabstr 0 : { *(.stabstr) }
>> .stab.excl 0 : { *(.stab.excl) }
>> .stab.exclstr 0 : { *(.stab.exclstr) }
>> .stab.index 0 : { *(.stab.index) }
>> .stab.indexstr 0 : { *(.stab.indexstr) }
>> .comment 0 : { *(.comment) }
>> /* DWARF debug sections.
>> Symbols in the DWARF debugging sections are relative to the beginning
>> of the section so we begin them at 0. */
>> /* DWARF 1 */
>> .debug 0 : { *(.debug) }
>> .line 0 : { *(.line) }
>> /* GNU DWARF 1 extensions */
>> .debug_srcinfo 0 : { *(.debug_srcinfo) }
>> .debug_sfnames 0 : { *(.debug_sfnames) }
>> /* DWARF 1.1 and DWARF 2 */
>> .debug_aranges 0 : { *(.debug_aranges) }
>> .debug_pubnames 0 : { *(.debug_pubnames) }
>> /* DWARF 2 */
>> .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
>> .debug_abbrev 0 : { *(.debug_abbrev) }
>> .debug_line 0 : { *(.debug_line) }
>> .debug_frame 0 : { *(.debug_frame) }
>> .debug_str 0 : { *(.debug_str) }
>> .debug_loc 0 : { *(.debug_loc) }
>> .debug_macinfo 0 : { *(.debug_macinfo) }
>> /* SGI/MIPS DWARF 2 extensions */
>> .debug_weaknames 0 : { *(.debug_weaknames) }
>> .debug_funcnames 0 : { *(.debug_funcnames) }
>> .debug_typenames 0 : { *(.debug_typenames) }
>> .debug_varnames 0 : { *(.debug_varnames) }
>> /* DWARF 3 */
>> .debug_pubtypes 0 : { *(.debug_pubtypes) }
>> .debug_ranges 0 : { *(.debug_ranges) }
>> /* DWARF Extension. */
>> .debug_macro 0 : { *(.debug_macro) }
>> .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
>> /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
>> }
>>
>>
>> ==================================================
>> attempt to open
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o succeeded
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o
>> attempt to open
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o succeeded
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crti.o
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o succeeded
>> /usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.so failed
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libpcap.a failed
>> attempt to open
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so
>> succeeded
>> -lpcap
>> (/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libpcap.so)
>> attempt to open /tmp/ccWKcRXK.o succeeded
>> /tmp/ccWKcRXK.o
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
>> -lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.so failed
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libc.a failed
>> attempt to open
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so succeeded
>> opened script file
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
>> opened script file
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libc.so
>> attempt to open /lib/i386-linux-gnu/libc.so.6 succeeded
>> /lib/i386-linux-gnu/libc.so.6
>> attempt to open /usr/lib/i386-linux-gnu/libc_nonshared.a succeeded
>> (/usr/lib/i386-linux-gnu/libc_nonshared.a)elf-init.oS
>> attempt to open /lib/i386-linux-gnu/ld-linux.so.2 succeeded
>> /lib/i386-linux-gnu/ld-linux.so.2
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.so failed
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a succeeded
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so succeeded
>> -lgcc_s (/usr/lib/gcc/i686-linux-gnu/4.8/libgcc_s.so)
>> attempt to open /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o succeeded
>> /usr/lib/gcc/i686-linux-gnu/4.8/crtend.o
>> attempt to open
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o succeeded
>> /usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crtn.o
>> ld-linux.so.2 needed by /lib/i386-linux-gnu/libc.so.6
>> found ld-linux.so.2 at /lib/i386-linux-gnu/ld-linux.so.2
>> /tmp/ccWKcRXK.o: In function `main':
>> test_pcap.c:(.text+0x19): undefined reference to `pcap_open_dead'
>> test_pcap.c:(.text+0x29): undefined reference to `pcap_close'
>> collect2: error: ld returned 1 exit status
>> output of second command
>> manish@manish-HP-630-Notebook-PC:~$ gcc -Wall test_pcap.c -o test_pcap
>> -lpcap
>> manish@manish-HP-630-Notebook-PC:~$ file test_pcap
>> test_pcap: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
>> dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
>> BuildID[sha1]=0x85c5248439361f209038fbf5686d4c536e3a3dca, not stripped
>> manish@manish-HP-630-Notebook-PC:~$ ldd test_pcap
>> linux-gate.so.1 => (0xb779b000)
>> libpcap.so.0.8 => /usr/lib/i386-linux-gnu/libpcap.so.0.8 (0xb7748000)
>> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb759e000)
>> /lib/ld-linux.so.2 (0xb779c000)
>> second command log is compile the program properly.
>> any suggestion regrading this.
>> and you did not given any advise for my previous query about compiling
>> librohc.
>> i am waiting for your reply.
>>
>>
>>
>> On Tue, Sep 10, 2013 at 10:31 PM, Didier Barvaux <
>> <email address hidden>> wrote:
>>
>> > Question #234832 on rohc changed:
>> > https://answers.launchpad.net/rohc/+question/234832
>> >
>> > Status: Open => Needs information
>> >
>> > Didier Barvaux requested more information:
>> > Hello,
>> >
>> > Do you mean that the command below does not work:
>> > $ gcc -Wl,--verbose -o test_pcap -lpcap test_pcap.c
>> >
>> > And the command below works:
>> > $ gcc -Wall test_pcap.c -o test_pcap -lpcap
>> >
>> > with the same content in the test_pcap.c file?
>> >
>> > Regards,
>> > Didier
>> >
>> > --
>> > You received this question notification because you are a member of ROHC
>> > Team, which is an answer contact for rohc.
>> >
>> > _______________________________________________
>> > Mailing list: https://launchpad.net/~rohc
>> > Post to : <email address hidden>
>> > Unsubscribe : https://launchpad.net/~rohc
>> > More help : https://help.launchpad.net/ListHelp
>> >
>>
>> --
>> You received this question notification because you are a member of ROHC
>> Team, which is an answer contact for rohc.
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~rohc
>> Post to : <email address hidden>
>> Unsubscribe : https://launchpad.net/~rohc
>> More help : https://help.launchpad.net/ListHelp
>>
>
>

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#46

Hello,

> sorry for bothering you.
> but suggested all command is given same output only below command compile.

Your system is somewhat broken. All commands should work...

> the output of command is correct or not?
> because i don't know what is the output of the test_pcap.c

No output is expected. The program itself is useless. Its purpose was testing compilation.

> and you are not providing any suggestion for running rohc my major concern
> on rohc library not pcap library.
> i only want to use rohc library for compression and decompression of my
> self created pkt.
> i don't want to capture network traffic. so please suggest me how to
> compile sample_rohc_program.c.
> In my system linker problem is found so please suggest me how to resolve it
> manual linker command.

I know that you care about the ROHC library, not the pcap library. I was using the pcap library to test how strangely your system behaves. You state that the problem with your system linker is found. I don't share your opinion...

Anyway, one of the commands seems to work somehow, so let's try to mimic the same command for the ROHC library. Please try to build the example with:
$ gcc -Wall rohc_first_application.c -o rohc_first_application \
    $( PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ \
         pkg-config rohc --libs --cflags )

A note about the error you report in your last message: you use some example code that is written for the future version 1.7.0 of the library, that's why you get new errors. Please get back to the previous code that you copied/pasted me a few days ago (don't forget to apply the changes I mentioned at that time).

Regards,
Didier

Revision history for this message
Launchpad Janitor (janitor) said :
#47

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.