undefined reference to `lt_dlopenext'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined reference to `lt_dlopenext'

lrn-2
$ nm -A --defined-only /mingw/lib/*.a | grep lt_dlopenext
%DISK_WITH_MINGW%/mingw/lib/libltdl.a:libltdl_libltdl_la-ltdl.o:00003130
T _lt_dlopenext
%DISK_WITH_MINGW%/mingw/lib/libltdl.dll.a:d000063.o:00000000 I
__imp__lt_dlopenext
%DISK_WITH_MINGW%/mingw/lib/libltdl.dll.a:d000063.o:00000000 T _lt_dlopenext

$ gcc -o conftest.exe -g -O2 -lltdl conftest.c
%TEMP%\ccwyr3xI.o: In function `main':
%CURRENT_DIRECTORY%/conftest.c:33: undefined reference to `lt_dlopenext'
collect2: ld returned 1 exit status

$ cat conftest.c
 /* confdefs.h */
 #define PACKAGE_NAME "GNUnet"
 #define PACKAGE_TARNAME "gnunet"
 #define PACKAGE_VERSION "0.8.1"
 #define PACKAGE_STRING "GNUnet 0.8.1"
 #define PACKAGE_BUGREPORT "[hidden email]"
 #define PACKAGE_URL ""
 #define PACKAGE "GNUnet"
 #define VERSION "0.8.1"
 #define STDC_HEADERS 1
 #define HAVE_SYS_TYPES_H 1
 #define HAVE_SYS_STAT_H 1
 #define HAVE_STDLIB_H 1
 #define HAVE_STRING_H 1
 #define HAVE_MEMORY_H 1
 #define HAVE_STRINGS_H 1
 #define HAVE_INTTYPES_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_UNISTD_H 1
 #define LT_OBJDIR ".libs/"
 /* end confdefs.h.  */

 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
 char lt_dlopenext ();
 int
 main ()
 {
 return lt_dlopenext ();
   ;
   return 0;
 }

What's wrong with it?

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to `lt_dlopenext'

JonY-3
On 1/10/2010 00:48, LRN wrote:

> $ nm -A --defined-only /mingw/lib/*.a | grep lt_dlopenext
> %DISK_WITH_MINGW%/mingw/lib/libltdl.a:libltdl_libltdl_la-ltdl.o:00003130
> T _lt_dlopenext
> %DISK_WITH_MINGW%/mingw/lib/libltdl.dll.a:d000063.o:00000000 I
> __imp__lt_dlopenext
> %DISK_WITH_MINGW%/mingw/lib/libltdl.dll.a:d000063.o:00000000 T _lt_dlopenext
>
> $ gcc -o conftest.exe -g -O2 -lltdl conftest.c
> %TEMP%\ccwyr3xI.o: In function `main':
> %CURRENT_DIRECTORY%/conftest.c:33: undefined reference to `lt_dlopenext'
> collect2: ld returned 1 exit status
>
> $ cat conftest.c
>   /* confdefs.h */
>   #define PACKAGE_NAME "GNUnet"
>   #define PACKAGE_TARNAME "gnunet"
>   #define PACKAGE_VERSION "0.8.1"
>   #define PACKAGE_STRING "GNUnet 0.8.1"
>   #define PACKAGE_BUGREPORT "[hidden email]"
>   #define PACKAGE_URL ""
>   #define PACKAGE "GNUnet"
>   #define VERSION "0.8.1"
>   #define STDC_HEADERS 1
>   #define HAVE_SYS_TYPES_H 1
>   #define HAVE_SYS_STAT_H 1
>   #define HAVE_STDLIB_H 1
>   #define HAVE_STRING_H 1
>   #define HAVE_MEMORY_H 1
>   #define HAVE_STRINGS_H 1
>   #define HAVE_INTTYPES_H 1
>   #define HAVE_STDINT_H 1
>   #define HAVE_UNISTD_H 1
>   #define LT_OBJDIR ".libs/"
>   /* end confdefs.h.  */
>
>   /* Override any GCC internal prototype to avoid an error.
>      Use char because int might match the return type of a GCC
>      builtin and then its argument prototype would still apply.  */
>   #ifdef __cplusplus
>   extern "C"
>   #endif
>   char lt_dlopenext ();
>   int
>   main ()
>   {
>   return lt_dlopenext ();
>     ;
>     return 0;
>   }
>
> What's wrong with it?
>

Hi,

Its failing because of the wrong link order. Libraries are always
specified after the objects.

Wrong:   gcc -o conftest.exe -g -O2 -lltdl conftest.c
Correct: gcc -o conftest.exe -g -O2 conftest.c -lltdl

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users