Web lists-archives.com

Re: [Mingw-users] newbie errors




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 25/11/16 18:14, Ralph Hipps wrote:
> ok, tried a couple different things based on suggestions received,
> still no joy. I'm sure I'm forgetting something or doing something
> stupid, but I haven't figured out what just yet.
> 
> C:\ash>gcc aaspi_file.c -L. -l aardvark.dll -o prog_ice.exe

This is wrong!  "-l aardvark.dll" means aardvark.dll.dll, which is not
what your DLL is called.

> c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe:
> cannot find -laardvark.dll
> collect2.exe: error: ld returned 1 exit status
> 
> C:\ash>gcc aaspi_file.c -L. -l aardvark -o prog_ice.exe

This is correct; now the linker should find aardvark.dll ...

> ./aardvark.dll: file not recognized: File format not recognized
> collect2.exe: error: ld returned 1 exit status

... and so it did, but didn't like it (invalid DLL format).  Did you
build it yourself, or is it from a third party?  It certainly appears
to be in some format other than standard PE-COFF, as required for use
with MinGW.

> C:\ash>gcc aaspi_file.c -L. -o prog_ice.exe

Wrong again!  How is GCC supposed to guess what libraries to use?

> from aardvark.h:
> 
> /* Write a stream of bytes to the downstream SPI slave device. */
> int aa_spi_write (
>     Aardvark    aardvark,
>     u16         out_num_bytes,
>     const u08 * data_out,
>     u16         in_num_bytes,
>     u08 *       data_in
> );

Parameters are all of non-standard types.  I can guess what some of
them likely mean, but Aardvark is totally opaque.  Is it some sort of
C++ class?  Is aa_spi_write() a C, or a C++ function.  Is aardvark.dll
a C++ DLL compiled by MSVC?  If so, you are going to have a great deal
of difficulty linking it to MinGW compiled code; all C++ modules in a
single application need to be compiled by the same compiler.

- -- 
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)

iQIcBAEBAgAGBQJYOIy9AAoJEMCtNsY0flo/IBsQAK21DQa6hoklnUm38OuZuU0L
z9g1VZ5XEjvKE/mQA3NHHvlrScbWMsHBtqpOndCRjjnNe83onEdlkpKBMJUDHV4W
a/ZoTHRyU3a830qnK6b/kWvt7pMV6gQ6rzUls8Fh/+W9sRjV1S7ZSiM/HQyZTb61
ksRxjAil/hnl05qcWUId3QuzCUv5W290Im+L/UvnpmrdrfxOtPnvU1Ferk9Mil7+
vYQoOK+E1nhk+OikzCBSk3sD1u3iMKlIdKo5EILa5eU/5tuFZ2YEBJJz6Z60sDRV
bY1MZt3nALRwu4FdB7vQBhiVoQ9U2xM/paFBWybmy39nimlghkuxB8JQY70bj6UB
dAOZIN8GtNFoz/yGye0N9Rk3WPiMVUTwKmQET5HtnY4SNhLY69ETg3MHVND75N44
1ZvhbHV3bDRKjmBciaWzY5yOCSRIH1Xm+wV9T+rvkFpy5Z+1hc/heuMEQHHMrp+w
uwf939IQlumF7hiMRlILqPdAPUMJh+tjuC4gmz3bG2gqcD/x94Bnz8WMhkeNDz/j
8/YPikpepwkoF8/e0HSty0dNz8Tdh8j7eqMKSCo5BZazhk7vEBeUutgxEPuSl0UM
cN3xFuJkwgKloOF9YfBelfVCPOwkDKgZvzDKIcOD5rXQRRDWJRDP1aCJ5bBPSNVZ
znb/DzGgZRQyupXgk6co
=zWrK
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

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:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe