libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

windows static archive, missing symbols


From: Bob Rossi
Subject: windows static archive, missing symbols
Date: Fri, 19 Jan 2007 20:50:50 -0500
User-agent: Mutt/1.5.12-2006-07-14

Hi,

I've got a quick question hopefully. I'm building pcre on windows. I've
been able to build it into a dll and link against it with a small
program. However, when I build a static library, and link it with a
small program, I get the missing symbols error. 

I know the symbols are in the library because nm tells me so,
  $ nm -g /home/bobbybrasko/download/pcre/pcre/install/lib/libpcre.a|grep 
compile                         
  libpcre_la-pcre_compile.o:                                                    
                          
  00005550 T _pcre_compile                                                      
                          

Here is the link line of the small program,
  $ gcc-4.1 -g -Wall -o test test.c 
-L/home/bobbybrasko/download/pcre/pcre/install/lib \
    -lpcreposix -lpcre 
  -I/home/bobbybrasko/download/pcre/pcre/install/include                        
                          
  C:/WINDOWS/TEMP/ccgGAsIC.o(.text+0x2e): In function `main':                   
                          
  C:/msys/1.0/home/bobbybrasko/download/pcre/pcre/build/tmp/test.c:13: 
    undefined reference to `_imp__pcre_compile'                                 
                                                               collect2: ld 
returned 1 exit status                                                          
           address@hidden ~/download/pcre/pcre/build/tmp                        
                                 
Here is the test program,
$ cat test.c                                                                    
                        
#include <stdio.h>                                                              
                        
#include <string.h>                                                             
                        
#include <pcre.h>                                                               
                        
                                                                                
                        
pcre *re;                                                                       
                        
char *pattern;                                                                  
                        
const char *error;                                                              
                        
int erroffset;                                                                  
                        
                                                                                
                        
int                                                                             
                        
main (void)                                                                     
                        
{                                                                               
                        
  re = pcre_compile(                                                            
                        
    pattern,              /* the pattern */                                     
                        
    0,                    /* default options */                                 
                        
    &error,               /* for error message */                               
                        
    &erroffset,           /* for error offset */                                
                        
    NULL);                                                                      
                        
  return 0;                                                                     
                        
}                                                                               
                        

Here is the link line of the library pcre,
/bin/sh ./libtool --mode=link gcc  -g -O2   -o libpcre.la -rpath 
/home/bobbybrasko/download/pcre/pcre/static/../install/lib  
libpcre_la-pcre_chartables.lo libpcre_la-pcre_compile.lo 
libpcre_la-pcre_config.lo libpcre_la-pcre_dfa_exec.lo libpcre_la-pcre_exec.lo 
libpcre_la-pcre_fullinfo.lo libpcre_la-pcre_get.lo libpcre_la-pcre_globals.lo 
libpcre_la-pcre_info.lo libpcre_la-pcre_maketables.lo 
libpcre_la-pcre_newline.lo libpcre_la-pcre_ord2utf8.lo 
libpcre_la-pcre_refcount.lo libpcre_la-pcre_study.lo libpcre_la-pcre_tables.lo 
libpcre_la-pcre_try_flipped.lo libpcre_la-pcre_ucp_searchfuncs.lo 
libpcre_la-pcre_valid_utf8.lo libpcre_la-pcre_version.lo 
libpcre_la-pcre_xclass.lo  
libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared 
libraries
rm -fr  .libs/libpcre.a .libs/libpcre.la .libs/libpcre.lai
ar cru .libs/libpcre.a  libpcre_la-pcre_chartables.o libpcre_la-pcre_compile.o 
libpcre_la-pcre_config.o libpcre_la-pcre_dfa_exec.o libpcre_la-pcre_exec.o 
libpcre_la-pcre_fullinfo.o libpcre_la-pcre_get.o libpcre_la-pcre_globals.o 
libpcre_la-pcre_info.o libpcre_la-pcre_maketables.o libpcre_la-pcre_newline.o 
libpcre_la-pcre_ord2utf8.o libpcre_la-pcre_refcount.o libpcre_la-pcre_study.o 
libpcre_la-pcre_tables.o libpcre_la-pcre_try_flipped.o 
libpcre_la-pcre_ucp_searchfuncs.o libpcre_la-pcre_valid_utf8.o 
libpcre_la-pcre_version.o libpcre_la-pcre_xclass.o
ranlib .libs/libpcre.a
creating libpcre.la

Does anyone understand why I'd be getting these errors? Are .def files
important for static windows libraries or only for dll's? Any advice?

Thanks,
Bob Rossi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]