|
From: dE <de....@gm...> - 2015-02-18 04:48:55
|
Hi! I've tried to compiling ldns, cares and both of these, although compile, result in undefined references when trying to link a program using them /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to `ldns_dname_new_frm_str' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x7e): undefined reference to `ldns_resolver_new_frm_file' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xaa): undefined reference to `ldns_resolver_query' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xba): undefined reference to `ldns_rdf_deep_free' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xe7): undefined reference to `ldns_pkt_rr_list_by_type' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xf7): undefined reference to `ldns_rr_list2str' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x107): undefined reference to `ldns_rr_list_deep_free' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x113): undefined reference to `ldns_pkt_free' /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x11f): undefined reference to `ldns_resolver_deep_free' /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld: /tmp/cci2q85W.o: bad reloc address 0x20 in section `.eh_frame' /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld: final link failed: Invalid operation collect2: error: ld returned 1 exit status Compiling with -lldns Compiling cares code -- /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x16): undefined reference to `_imp__ares_library_init' /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x24): undefined reference to `_imp__ares_init' /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x5a): undefined reference to `_imp__ares_search' I installed using MXE on Linux. |
|
From: dE <de....@gm...> - 2015-02-18 05:54:26
|
On 02/18/15 10:18, dE wrote:
> Hi!
>
> I've tried to compiling ldns, cares and both of these, although
> compile, result in undefined references when trying to link a program
> using them
>
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to
> `ldns_dname_new_frm_str'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x7e): undefined reference to
> `ldns_resolver_new_frm_file'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xaa): undefined reference to
> `ldns_resolver_query'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xba): undefined reference to
> `ldns_rdf_deep_free'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xe7): undefined reference to
> `ldns_pkt_rr_list_by_type'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0xf7): undefined reference to
> `ldns_rr_list2str'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x107): undefined reference to
> `ldns_rr_list_deep_free'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x113): undefined reference to
> `ldns_pkt_free'
> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x11f): undefined reference to
> `ldns_resolver_deep_free'
> /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld:
>
> /tmp/cci2q85W.o: bad reloc address 0x20 in section `.eh_frame'
> /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/ld:
>
> final link failed: Invalid operation
> collect2: error: ld returned 1 exit status
>
> Compiling with -lldns
>
> Compiling cares code --
>
> /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x16): undefined reference
> to `_imp__ares_library_init'
> /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x24): undefined reference
> to `_imp__ares_init'
> /tmp/ccVzPSId.o:ares_txt_resolver.c:(.text+0x5a): undefined reference
> to `_imp__ares_search'
>
> I installed using MXE on Linux.
So I compiled libregex and made test.c
#include <regex.h>
int main () {
struct re_pattern_buffer test;
re_compile_fastmap (&test);
}
PATH="/home/de/mxe/usr/bin:$PATH"
/home/de/small/temp_small/cryptos/HFC_windows/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
-lregex test.c
/tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
`re_compile_fastmap'
|
|
From: John B. <joh...@ho...> - 2015-02-18 08:48:41
|
On Wed, 18 Feb 2015 11:24:02 +0530, dE wrote:
> On 02/18/15 10:18, dE wrote:
>> Hi!
>>
>> I've tried to compiling ldns, cares and both of these, although
>> compile, result in undefined references when trying to link a program
>> using them
>>
>> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to
>> `ldns_dname_new_frm_str'
>>
[many more undefined references snipped]
>> I installed using MXE on Linux.
>
> So I compiled libregex and made test.c
>
> #include <regex.h>
> int main () {
> struct re_pattern_buffer test;
> re_compile_fastmap (&test);
> }
>
> PATH="/home/de/mxe/usr/bin:$PATH"
> /home/de/small/temp_small/cryptos/HFC_windows/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
> -lregex test.c
> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
> `re_compile_fastmap'
It seems that when you installed libregex (and the other)
libraries , you did not put them in the cross-compiler's search path.
They probably got installed under /usr/local. Wherever they are, they
must be moved to the correct location.
1) Where is libregex*.a?
2) What is the output of
$ i686-pc-mingw32-gcc-4.8.1 --print-search-dirs
Regards,
John Brown.
|
|
From: dE <de....@gm...> - 2015-02-18 11:12:29
|
On 02/18/15 14:18, John Brown wrote:
> On Wed, 18 Feb 2015 11:24:02 +0530, dE wrote:
>> On 02/18/15 10:18, dE wrote:
>>> Hi!
>>>
>>> I've tried to compiling ldns, cares and both of these, although
>>> compile, result in undefined references when trying to link a program
>>> using them
>>>
>>> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to
>>> `ldns_dname_new_frm_str'
>>>
> [many more undefined references snipped]
>
>>> I installed using MXE on Linux.
>> So I compiled libregex and made test.c
>>
>> #include <regex.h>
>> int main () {
>> struct re_pattern_buffer test;
>> re_compile_fastmap (&test);
>> }
>>
>> PATH="/home/de/mxe/usr/bin:$PATH"
>> /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
>> -lregex test.c
>> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
>> `re_compile_fastmap'
> It seems that when you installed libregex (and the other)
> libraries , you did not put them in the cross-compiler's search path.
> They probably got installed under /usr/local. Wherever they are, they
> must be moved to the correct location.
>
> 1) Where is libregex*.a?
> 2) What is the output of
> $ i686-pc-mingw32-gcc-4.8.1 --print-search-dirs
>
> Regards,
> John Brown.
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
libregex is in the search dir that's why GCC doesn't complain of it being missing. It's in mxe/usr/i686-pc-mingw32/lib
Besides all libraries are installed there.
install: /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/
programs: =/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/
libraries: =/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/
|
|
From: John B. <joh...@ho...> - 2015-02-18 12:36:32
|
On Wed, 18 Feb 2015 16:42:03 +0530, dE wrote:
> On 02/18/15 14:18, John Brown wrote:
>> On Wed, 18 Feb 2015 11:24:02 +0530, dE wrote:
>>> On 02/18/15 10:18, dE wrote:
>>>> Hi!
>>>>
>>>> I've tried to compiling ldns, cares and both of these, although
>>>> compile, result in undefined references when trying to link a program
>>>> using them
>>>>
>>>> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to
>>>> `ldns_dname_new_frm_str'
>>>>
>> [many more undefined references snipped]
>>
>>>> I installed using MXE on Linux.
>>> So I compiled libregex and made test.c
>>>
>>> #include <regex.h>
>>> int main () {
>>> struct re_pattern_buffer test;
>>> re_compile_fastmap (&test);
>>> }
>>>
>>> PATH="/home/de/mxe/usr/bin:$PATH"
>>> /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
>>> -lregex test.c
>>> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
>>> `re_compile_fastmap'
>> It seems that when you installed libregex (and the other)
>> libraries , you did not put them in the cross-compiler's search path.
>> They probably got installed under /usr/local. Wherever they are, they
>> must be moved to the correct location.
>>
>> 1) Where is libregex*.a?
>> 2) What is the output of
>> $ i686-pc-mingw32-gcc-4.8.1 --print-search-dirs
>>
>> Regards,
>> John Brown.
>>
>
> libregex is in the search dir that's why GCC doesn't complain of it being missing. It's in mxe/usr/i686-pc-mingw32/lib
>
> Besides all libraries are installed there.
>
> install: /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/
> programs: =/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/
> libraries: =/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/
>
>
Concentrating on libregex for now:
There may be a problem with name mangling. Run
$ i686-pc-mingw32-gcc-4.8.1 -c -o test.o test.c
then run
$ /path/to/cross-compiler's/nm test.o | grep re_compile_fastmap
Compare the output with what you see when you run the same nm
command on /path/to/cross-compiler's/libregex.a (or libregex.dll.a).
Where did you download libregex?
Regards,
John Brown.
|
|
From: dE <de....@gm...> - 2015-02-19 03:27:22
|
On 02/18/15 18:06, John Brown wrote:
> On Wed, 18 Feb 2015 16:42:03 +0530, dE wrote:
>> On 02/18/15 14:18, John Brown wrote:
>>> On Wed, 18 Feb 2015 11:24:02 +0530, dE wrote:
>>>> On 02/18/15 10:18, dE wrote:
>>>>> Hi!
>>>>>
>>>>> I've tried to compiling ldns, cares and both of these, although
>>>>> compile, result in undefined references when trying to link a program
>>>>> using them
>>>>>
>>>>> /tmp/cci2q85W.o:ldns_resolv.c:(.text+0x55): undefined reference to
>>>>> `ldns_dname_new_frm_str'
>>>>>
>>> [many more undefined references snipped]
>>>
>>>>> I installed using MXE on Linux.
>>>> So I compiled libregex and made test.c
>>>>
>>>> #include <regex.h>
>>>> int main () {
>>>> struct re_pattern_buffer test;
>>>> re_compile_fastmap (&test);
>>>> }
>>>>
>>>> PATH="/home/de/mxe/usr/bin:$PATH"
>>>> /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
>>>> -lregex test.c
>>>> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
>>>> `re_compile_fastmap'
>>> It seems that when you installed libregex (and the other)
>>> libraries , you did not put them in the cross-compiler's search path.
>>> They probably got installed under /usr/local. Wherever they are, they
>>> must be moved to the correct location.
>>>
>>> 1) Where is libregex*.a?
>>> 2) What is the output of
>>> $ i686-pc-mingw32-gcc-4.8.1 --print-search-dirs
>>>
>>> Regards,
>>> John Brown.
>>>
>> libregex is in the search dir that's why GCC doesn't complain of it being missing. It's in mxe/usr/i686-pc-mingw32/lib
>>
>> Besides all libraries are installed there.
>>
>> install: /home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/
>> programs: =/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/libexec/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/bin/
>> libraries: =/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/i686-pc-mingw32/4.8.1/:/home/de/mxe/usr/lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/
>>
>>
> Concentrating on libregex for now:
>
> There may be a problem with name mangling. Run
> $ i686-pc-mingw32-gcc-4.8.1 -c -o test.o test.c
> then run
> $ /path/to/cross-compiler's/nm test.o | grep re_compile_fastmap
>
> Compare the output with what you see when you run the same nm
> command on /path/to/cross-compiler's/libregex.a (or libregex.dll.a).
>
> Where did you download libregex?
>
> Regards,
> John Brown.
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>
bin/i686-pc-mingw32-nm test.o | grep re_compile_fastmap
U _re_compile_fastmap
i686-pc-mingw32-nm /home/de/mxe/usr/i686-pc-mingw32/lib/libregex.a |
grep re_compile_fastmap
00000000 I __imp__re_compile_fastmap
00000000 T _re_compile_fastmap
Downloaded regex from here --
https://github.com/coapp-packages/libgnurx
|
|
From: Ludwig T. <ta...@ao...> - 2015-02-18 14:24:07
|
On Wed 18 February 2015 11:24:02 dE wrote:
<snip>
> So I compiled libregex and made test.c
>
> #include <regex.h>
> int main () {
> struct re_pattern_buffer test;
> re_compile_fastmap (&test);
> }
>
> PATH="/home/de/mxe/usr/bin:$PATH"
> /home/de/small/temp_small/cryptos/HFC_windows/mxe/usr/bin/i686-pc-mi
> ngw32-gcc-4.8.1 -lregex test.c
> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
> `re_compile_fastmap'
Please reorder your commandline to:
gcc test.c -lregex
You MUST place the module that references a symbol from a library
BEFORE the library that defines it! This is the way LD works.
BTW this is a common user error! See the FAQ on the MinGW site!
hth
Ludwig TAUER
|
|
From: dE <de....@gm...> - 2015-02-19 03:35:24
|
On 02/18/15 19:53, Ludwig Tauer wrote:
> On Wed 18 February 2015 11:24:02 dE wrote:
>
> <snip>
>
>> So I compiled libregex and made test.c
>>
>> #include <regex.h>
>> int main () {
>> struct re_pattern_buffer test;
>> re_compile_fastmap (&test);
>> }
>>
>> PATH="/home/de/mxe/usr/bin:$PATH"
>> /home/de/small/temp_small/cryptos/HFC_windows/mxe/usr/bin/i686-pc-mi
>> ngw32-gcc-4.8.1 -lregex test.c
>> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
>> `re_compile_fastmap'
> Please reorder your commandline to:
> gcc test.c -lregex
>
> You MUST place the module that references a symbol from a library
> BEFORE the library that defines it! This is the way LD works.
> BTW this is a common user error! See the FAQ on the MinGW site!
>
> hth
> Ludwig TAUER
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> MinGW-users mailing list
> Min...@li...
>
> 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
> Also: mailto:min...@li...?subject=unsubscribe
Ok. Yes, now it works.
Thank you everyone for the help!!
|
|
From: Eli Z. <el...@gn...> - 2015-02-18 15:24:20
|
> Date: Wed, 18 Feb 2015 11:24:02 +0530
> From: dE <de....@gm...>
>
> So I compiled libregex and made test.c
>
> #include <regex.h>
> int main () {
> struct re_pattern_buffer test;
> re_compile_fastmap (&test);
> }
>
> PATH="/home/de/mxe/usr/bin:$PATH"
> /home/de/small/temp_small/cryptos/HFC_windows/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
> -lregex test.c
> /tmp/ccWVANE9.o:test.c:(.text+0x16): undefined reference to
> `re_compile_fastmap'
The "-lregex" part should be last on the command line.
GNU ld is a one-pass linker, so it must see the library _after_ all
its callers.
|
|
From: Roger M. <ro...@zu...> - 2015-02-23 16:02:52
|
Hello, I am trying to use the bash shell supplied with MinGW/MSYS, but I'm finding that often environment variables (e.g. red_something) are translated to their upper case equivalent (i.e. RED_SOMETHING). We have binary executables that are called from the shell that require the variables to be defined in lower case (a hangover from UNIX days). I notice that CYGWIN allows the user to set a flag "nouppercase_env" for the CYGWIN to control this behaviour. Is there an equivalent flag that can be used with MinGW/MSYS? Many Thanks in advance, Roger |