Quantcast

skipping incompatible libfl.a when searching for -lfl

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

skipping incompatible libfl.a when searching for -lfl

Angus Comber
I am reading the O'Reilly flex and bison book and trying to build the very first program on page 4.

I have mingw installed and I downloaded the flex and bison executables and have them in my path.

I am running on Windows 7 64 bit.

I am using the bash shell 

First line worked:

flex fb1-1.l

then next line I used:

$ gcc lex.yy.c -lfl
fb1-1.l: In function 'yylex':
fb1-1.l:17:21: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
 [a-zA-Z]+ { words++; chars += strlen(yytext); }
                     ^~~~~~
fb1-1.l:17:21: warning: incompatible implicit declaration of built-in function 'strlen'
fb1-1.l:17:21: note: include '<string.h>' or provide a declaration of 'strlen'
fb1-1.l: At top level:
fb1-1.l:23:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../lib/libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../lib\libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../..\libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../lib/libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../libfl.a when searching for -lfl
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lfl
collect2.exe: error: ld returned 1 exit status


I do have a liblf.a file in C:\MinGW\lib

my path includes:
/mingw64/bin:/mingw64/bin:/c/MinGW/msys/1.0/bin:/c/MinGW/bin:/mingw64/bin:

gcc is installed in C:\MinGW\bin\gcc.exe

Why am I getting skipping incompatible version for libfl.a and how can I fix this?



------------------------------------------------------------------------------

_______________________________________________
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
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: skipping incompatible libfl.a when searching for -lfl

Keith Marshall-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25/09/16 21:47, Angus Comber wrote:
> I do have a liblf.a file in C:\MinGW\lib
>
> my path includes:
> /mingw64/bin:/mingw64/bin:/c/MinGW/msys/1.0/bin:/c/MinGW/bin:/mingw64/
bin:

That
>
looks decidedly wrong.  First, if you are using MSYS correctly,
/c/MinGW/msys/1.0/bin should not be there, because MSYS knows where
its own root is, and thus, the correct reference is to /bin.

Secondly, and again, if you are using MSYS correctly, there should be
only one reference to /mingw/bin, mapped through the mount table to
either 32-bit MinGW, or to mingw64, as appropriate for your current
build objectives.  You should *never* have potentially ambiguous
concurrent references to both MinGW/bin and mingw64/bin

> gcc is installed in C:\MinGW\bin\gcc.exe

It may well be, but your path has /mingw64/bin before /c/mingw/bin,
which means that you are not using our gcc; you are using the mingw64
alternative, which is not our product; we do not support it, and any
discussion relating to it (specifically) is off-topic here.

> Why am I getting skipping incompatible version for libfl.a

Probably because your libfl.a is 32-bit library, and you are trying to
link with 64-bit compilands.

> and how can I fix this?

Don't mix 32-bit and 64-bit compilands in the same build; if you are
building for 32-bit, remove /mingw64 references from $PATH.  OTOH, if
you are building for 64-bit, remove the 32-bit MinGW references, and
make sure all your libraries are built for either 32-bit or 64-bit,
as appropriate, but never mix them.

- --
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJX6EqFAAoJEMCtNsY0flo/x9sP/1F3TV0eBnhTa3BqbRUjdSXq
BRwSt3OTW871vpt9NoCDI6wR7F9fhC59g0x9T7zUKMYdPhl44MpOAB1xCjbMCLyy
GTIEVaLantP/edSskLglfbs0nQjZ2LUGfm+mCR8geVBkftMDKP5YfMJj/kB9pFZr
2NwNMAyogmS6DxNOlYZQCfTzsGKJSCvfL/Ze9OZVyfKpEKRqCtbp6CloV6Orz9BW
gkv0dkBWrhSTQYcGAsK9vHVKCvogFetx6cXB3/fQhLA4n91HAwOjPEmOYOTJA/gc
Dlq99Rx1D86N+jMO0/Q7qa9S4OkgiuULrFsDm2akZNqQeS9ehvv4CwKm2Y+H6Gyt
2WsaDCNrLkouBYhOA8RUpIVHDHiCSuXi2IeZ/u0olvv1A0I/UQfYwcyJD0LOQePY
57q2AHmqGxjYPKPeZ1z1wrfBw8EnWYdGU9sOSfErsHheYKjaovT0ycGtUFliWxst
6X6Y5MHG0lVbeCvKzEcd/D24VB9f5zYFxC13m9FZBLXRJy+h8Agty+cvALY5Qh6E
2gleCNPe2lD+/pR1Ut27/M28bL/vxafHGRvLpqb1YzpIEt1yD/k8c9/caa+k3kD2
hXnU1+Xxy8nWitJJpwU5zKMj7S8eGVjzdAmaM6p+Ce8OGVlxy26UrKU+Rcw1oQeP
b4ql9vco9YMyAaaDpwG8
=fmc/
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
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
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: skipping incompatible libfl.a when searching for -lfl

Keith Marshall-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25/09/16 23:07, Keith Marshall wrote:
>> my path includes:
>> /mingw64/bin:/mingw64/bin:/c/MinGW/msys/1.0/bin:/c/MinGW/bin:/mingw64/bin:
>
>>
> That looks decidedly wrong.  First, if you are using MSYS
> correctly, /c/MinGW/msys/1.0/bin should not be there, because MSYS
> knows where its own root is, and thus, the correct reference is to
> /bin.

Apologies for the mess Thunderbird/EnigMail made, when it arbitrarily
reformatted this, in my earlier reply.

- --
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJX6E3mAAoJEMCtNsY0flo/9RYP/0HRcgwBBpdx9iIJfqzpLx2E
t9PIDAzbTcbm5eL9T6rlFPSBCciPQE2WgCpQb+uLFQq7qg2mjiLHRCZtcFVxt6X8
vk5jC4unNAlRtT0WsPdUZ3AEe3qfsVsbmz/yEwKrqiz733UqmJ8hG1zD3mgb3vVh
NuXDo966ReWBpI65ik5XfTariAAvjhDyLLTCdXgsHFgFQW7ZQECyIPVbDygM1Pwl
F3AgbGAgHLMn/rFaY9tMv191vtTsC7qG9hy3yObckpkWhoSUR/ooJaB0Qtnj2dl/
G0bHuDldYFxZoZ7roizn5i/WeE2F3Z9BJFfhHcLdVvSfd0ZXTTa+nDwPOEa42bS5
TfZfDlRNkL63JeQcJdBMKfXEgz7TMYyIZbyksQc9EIVO8xtqzdRDmN7CmXPG5acN
1nnxeCA2PnWj+0yw33M8ONvJm0FYSZ3nfByBpqRWva8I0ycpJ9W7BeuXpvGZMH2W
sVLWptrcX4V5bSRt5hvgDU2Jub0iPklsOLtszsnmC67mfi/43mGV8M6F9o9vxxia
ucvlB4Nb955ra81PRA9zeqq4boZk7jE3Lg3Kv9XZBL4kOejMGiAonrK208DfBCsK
4DVotxnkitCRUlsn2GhFjvcPmzjvbWkoiZ5JT4xVILFR1dKm4Ro4z3V99WUdGyGd
H4QvxBloETl1NWI9WnIy
=Tix3
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
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
Also: mailto:[hidden email]?subject=unsubscribe
Loading...