All of lore.kernel.org
 help / color / mirror / Atom feed
From: robdlg@att.net
To: linuxppc-embedded@lists.linuxppc.org
Subject: popt, ELDK 2.0.2
Date: Mon, 06 Oct 2003 10:51:44 +0000	[thread overview]
Message-ID: <200310061051.FAA10075@lists.linuxppc.org> (raw)


I was experimenting with the popt library in the ELDK 2.0.2, and I received
the following errors.  The same compiler invocation is successful when used
with gcc under Red Hat Linux 7.3.  The source code follows the error
messages.  How do I properly compile and link this file?

ppc_82xx-gcc -Wall -lpopt -o popt_test main.c
/tmp/ccMrZmW2.o: In function `main':
/tmp/ccMrZmW2.o(.text+0x60): undefined reference to `poptGetContext'
/tmp/ccMrZmW2.o(.text+0x60): relocation truncated to fit: R_PPC_REL24
poptGetContext
/tmp/ccMrZmW2.o(.text+0x70): undefined reference to `poptGetNextOpt'
/tmp/ccMrZmW2.o(.text+0x70): relocation truncated to fit: R_PPC_REL24
poptGetNextOpt
/tmp/ccMrZmW2.o(.text+0x94): undefined reference to `poptFreeContext'
/tmp/ccMrZmW2.o(.text+0x94): relocation truncated to fit: R_PPC_REL24
poptFreeContext
collect2: ld returned 1 exit status
make: *** [all] Error 1

#include <stdio.h>
#include <stdlib.h>
#include <popt.h>

int main(int argc, char *argv[])
{
	int rc;

	/* command-line arguments */
	struct poptOption options[] = {
		{ "help", 'h', POPT_ARG_NONE, NULL, 1 },
		{ NULL, 0, 0, NULL, 0 }
	};
	poptContext context;

	context = poptGetContext(NULL, argc, (const char **)argv, options,
0);
	rc = poptGetNextOpt( context );

	printf("%d\n", rc);

	poptFreeContext( context);

	return 0;
}

/* eof */

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

             reply	other threads:[~2003-10-06 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-06 10:51 robdlg [this message]
2003-10-06 17:10 ` popt, ELDK 2.0.2 Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200310061051.FAA10075@lists.linuxppc.org \
    --to=robdlg@att.net \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.