newbie errors

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

newbie errors

Ralph Hipps

Ok, I know I’m a newb, but I need help getting started on something urgent.

 

I’ve installed gcc, seems to be working, path is set, etc.

 

I’m getting errors about not finding stuff even tho it’s in the directory my source is in, and I’m in that dir when I invoke the tools. Seems a bit odd. I’m running on Win7 Enterprise.

 

Any suggestions?

 

aaspi_file.c has:

 

#include <stdio.h>

#include <stdlib.h>

#include "aardvark.h"

 

But….

 

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

 

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xa0): undefined reference to `aa_spi_write'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xb4): undefined reference to `aa_status_string'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x21c): undefined reference to `aa_sleep_ms'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x309): undefined reference to `aa_open'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x35a): undefined reference to `aa_configure'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x36e): undefined reference to `aa_target_power'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x399): undefined reference to `aa_spi_configure'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x3ad): undefined reference to `aa_spi_bitrate'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x3e5): undefined reference to `aa_close'

collect2.exe: error: ld returned 1 exit status

 

C:\ash>gcc aaspi_file.c -l aardvark.dll -o prog_ice.exe

 

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 aardvark.h -o prog_ice.exe

 

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -laardvark.h

collect2.exe: error: ld returned 1 exit status

 

Thanks, and Happy Holidays!

 

Ralph Hipps

 

 

 

 

Ralph

>+<
 |    /\
 |___/  \
 [_@_]   `<
 O O O   
      IRS!
------------------------------------------------------------------------------------
In the twenty-first century, the robot will take the place
which slave labor occupied in ancient civilization.
 -- Nikola Tesla
------------------------------------------------------------------------------------


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

_______________________________________________
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: newbie errors

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

On 24/11/16 21:06, Ralph Hipps wrote:
> Ok, I know I’m a newb, but I need help getting started on something
> urgent.

FWIW, it may be urgent for you, but likely not for anyone else here;
never assume you'll get a quicker reply by pleading urgency.

> I’ve installed gcc, seems to be working, path is set, etc.

So far, so good.

> I’m getting errors about not finding stuff even tho it’s in the
> directory my source is in, and I’m in that dir when I invoke the
> tools. Seems a bit odd. I’m running on Win7 Enterprise.

Not odd at all, if you don't specify it correctly.

> aaspi_file.c has:
>
> #include <stdio.h> #include <stdlib.h>

System headers; these should be found by system include path search.

> #include "aardvark.h"

Local header; nominally expected in same directory as aaspi_file.c,
but failing that, system include path will also be searched.

> But….
>
> C:\ash>gcc aaspi_file.c aardvark.h -o prog_ice.exe
> C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xa0):
>
>
undefined reference to `aa_spi_write'
> ...more like this snipped... collect2.exe: error: ld returned 1
> exit status

So, what provides function aa_spi_write()?  I guess it isn't defined
in aaspi_file.c, and you didn't give the linker any clue where to find
it, so linking (i.e. the ld phase of the gcc command) failed.

> C:\ash>gcc aaspi_file.c -l aardvark.dll -o prog_ice.exe
> 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

So, aa_spi_write() and friends are in aardvark.dll?  However,

    -l aardvark.dll

tells ld to search for libaardvark.dll.dll.a, then libaardvark.dll.a,
then aardvark.dll.dll, none of which is right; either omit the -l, or
specify it as -laardvark (without the .dll suffix); also, if you adopt
the latter convention, you likely need "-L. -laardvark", so ld knows
to look for libraries in the current directory, in addition to the
system library path.

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

Well, aardvark.h is a header file, not a library; specifying

    -laardvark.h

is just plain wrong, however you look at it.  Please read:

    http://www.mingw.org/wiki/LibraryPathHOWTO

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

iQIcBAEBAgAGBQJYN2VYAAoJEMCtNsY0flo/fmoP/2/ACOOcfJh/LK3WwX/ehL5u
weei1SwwscbiijReddhGgV7/a54IdIbS4R6ZpSRwUGdjf9vjP+P1z1ElGJ4IgJrZ
WBzOSb8WfVLGYWhrMDoxLhYd8tz5URg7kWzFk/p5zSz5g8uik8GAD3blFDOW72yo
cSSmuBypSeuKt6VbxFgTDSOrs69LyvRJrO9r3IgHlmu0uK2ooRLxQ/6xHrfpT6pG
KRfpb5cwNbONywAFzaFwy99n6YVzdMQbWK9B5my2CtPdlwKVHKN7tPj1JcZ2JxtV
1KCT2DnaJ9sQt3jm2dJ2rkcvs3d3gaOznhkhtHGpOZrssMzxrwbqUHCS3M142bpL
5t27QmXIhndiRY1lFXbg1/aZ83ltxt4k4Kl8Wq7YoAvPnbS0vTJsHjKV7v9Erxhp
h2TKTy3Pl05qTG3EPW1McasR9S/lQ9/kCC0Saoxq1C/u1f86gznJmSWaZNkei/2p
3UFVXZMN6XyIBSSeFK+7grkFNT6pRErLc2HLOFCw9tFF1xjr6B9d6mRMwQaSJBWB
eleDrQ20MDiclr/NsR6UY2YRdJLYNFKv6v+Q/AH77KypGItE4gkeqH6AzWoywcgk
/vDnLwc1okzduwa911/vZbjyLvjBesHM/LI9Pmf+2QFRcG/neKOQXy2oSKxzRKpx
6gERcCJZ4PXJBZCeoH1x
=iLJe
-----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: newbie errors

John Brown
In reply to this post by Ralph Hipps
On Thursday, November 24, 2016 4:06 PM, Ralph Hipps wrote:


> Ok, I know I’m a newb, but I need help getting started on something
> urgent.
>
> I’ve installed gcc, seems to be working, path is set, etc.
>
> I’m getting errors about not finding stuff even tho it’s in the directory
> my source is in, and I’m in that dir when I invoke the tools. Seems a
>  bit odd. I’m running on Win7 Enterprise.
>
> Any suggestions?
>
> aaspi_file.c has:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include "aardvark.h"
>
> But….
>
> C:\ash>gcc aaspi_file.c aardvark.h -o prog_ice.exe
>
> C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xa0): undefined reference to >`aa_spi_write'
<snip/>

You need to include the library that contains these functions on
your commsnd line. Exactly how this is done depends.
>
> C:\ash>gcc aaspi_file.c -l aardvark.dll -o prog_ice.exe

The -l is shorthand for the actual library name. -labc could match
libabc.a
libabc.dll.a
libabc.dll
abc.dll

The location of the alias specified by -l is a directory in the library search
path. The current directory is not in the search path by default; use -L to
specify it. The working command would be:
C:\ash>gcc aaspi_file.c -L. -laardvark -o prog_ice.exe
where . (dot) stands for the current directory or
C:\ash>gcc aaspi_file.c -L/directory/containing/library -l aardvark -o prog_ice.exe
or you could omit the -L and -l and specify the full path to the
library. In this case that would be:
 C:\ash>gcc aaspi_file.c aardvark.dll -o prog_ice.exe

Regards,
John Brown.

------------------------------------------------------------------------------
_______________________________________________
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: newbie errors

Keith Marshall-3
In reply to this post by Ralph Hipps
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[Resend, due to Thunderbird/EnigMail hosing layout]

On 24/11/16 21:06, Ralph Hipps wrote:
> Ok, I know I’m a newb, but I need help getting started on something
> urgent.

FWIW, it may be urgent for you, but likely not for anyone else here;
never assume you'll get a quicker reply by pleading urgency.

> I’ve installed gcc, seems to be working, path is set, etc.

So far, so good.

> I’m getting errors about not finding stuff even tho it’s in the
> directory my source is in, and I’m in that dir when I invoke the
> tools. Seems a bit odd. I’m running on Win7 Enterprise.

Not odd at all, if you don't specify it correctly.

> aaspi_file.c has:
>
> #include <stdio.h>
> #include <stdlib.h>


System headers; these should be found by system include path search.

> #include "aardvark.h"

Local header; nominally expected in same directory as aaspi_file.c,
but failing that, system include path will also be searched.

> But….
>
> C:\ash>gcc aaspi_file.c aardvark.h -o prog_ice.exe
> C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xa0):
> undefined reference to `aa_spi_write'
> ...more like this snipped...
> collect2.exe: error: ld returned 1 exit status

So, what provides function aa_spi_write()?  I guess it isn't defined
in aaspi_file.c, and you didn't give the linker any clue where to find
it, so linking (i.e. the ld phase of the gcc command) failed.

> C:\ash>gcc aaspi_file.c -l aardvark.dll -o prog_ice.exe
> 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

So, aa_spi_write() and friends are in aardvark.dll?  However,

    -l aardvark.dll

tells ld to search for libaardvark.dll.dll.a, then libaardvark.dll.a,
then aardvark.dll.dll, none of which is right; either omit the -l, or
specify it as -laardvark (without the .dll suffix); also, if you adopt
the latter convention, you likely need "-L. -laardvark", so ld knows
to look for libraries in the current directory, in addition to the
system library path.

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

Well, aardvark.h is a header file, not a library; specifying

    -laardvark.h

is just plain wrong, however you look at it.  Please read:

    http://www.mingw.org/wiki/LibraryPathHOWTO

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

iQIcBAEBAgAGBQJYN26DAAoJEMCtNsY0flo/YPYQAK1jd6f/TCVTOjoQgiXzVQgO
Gpk2oUcrwKpVPRNjYFsx0CfncvBmWf0Zd751fQlGLYCB/IhqoLpeekhvuC0L0DSf
sa48+xAR2xOgMasZ3tf5RnIReBB+snwEmVfv0ank5tKiZ1bcQwdhgrYzyTE5mfyc
NEoveNEUR5wVJK7ovD+0rG31Qe0FgyHwk4nZV/fh4156dwY81Emh8OPF6/sdHsrH
ZwNPO/2onC2cQlABIxpQC0pJrVDgT2oAHWB23DqIaEZZRJgCPyeF69P1ggsEvAUG
duUgK2dpvCZGaFHv2ASUxgaVD77iUMxtjX7JxqRu7Lm6rc/UbOQXxovtEM4l7LK4
xFHkw2MVtP3YNrnPHvM1KYzSLW+XzPpzjJTLJf+6X5OXLs29VY9qZS92xFjjkeh9
v/7QwAFF0omrZ0zJ2J96tWFLWJt+oI3Oqf47JDRBU7vCzTB/lzohJOwdVRcjoXZG
Hmi3ShtWKE0/ccpEbfhk+Eh+StNdabbjONp90mLqW6y91MRX48jZP4Bi6TSUYqnR
bQ1SM/LSGKPCBSKdoQltEwN3HVG1C2sNuR532VRbkRkby/rCqMYCycN9zb4xYPbh
YZZEr5G9GJsNRUJRGEq+7HAn0nh/n9uQc1FEHSzoAitw8k0FWef/BfkqRqEWyHUT
m8azfPtSSf/5HHgBiiOC
=gwG9
-----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: newbie errors

Riccardo Mottola
In reply to this post by Ralph Hipps
Hi,

Ralph Hipps wrote:
>
> c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe:
> cannot find -laardvark.h
>
> collect2.exe: error: ld returned 1 exit status
>

Keith and John gave you already consistent answers: you are failing to
link in the proper libraries.

If you are writing a program yourself, take a seat, relax and dust out
some C primer book or tutorial: you are not hitting yet a MinGW issue,
but just standard build issues.
If you are instead porting something existing from Unix to windows, then
look if you have makefiles (e.g. look for Makefile or GNUMakefile) which
do handle the compilation of multiple source files and linking
parameters. Furthermore, it might be that your program might have a
"configure" script to automatically write Makefiles for you.

Riccardo

------------------------------------------------------------------------------
_______________________________________________
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: newbie errors

Ralph Hipps
In reply to this post by Ralph Hipps
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

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

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

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

C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0xa0): undefined reference to `aa_spi_write'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0xb4): undefined reference to `aa_status_string'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x21c): undefined reference to `aa_sleep_ms'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x309): undefined reference to `aa_open'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x35a): undefined reference to `aa_configure'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x36e): undefined reference to `aa_target_power'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x399): undefined reference to `aa_spi_configure'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x3ad): undefined reference to `aa_spi_bitrate'
C:\Users\rhipps\AppData\Local\Temp\cc4yOh2W.o:aaspi_file.c:(.text+0x3e5): undefined reference to `aa_close'
collect2.exe: error: ld returned 1 exit status


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


/*
 * Return the status string for the given status code.
 * If the code is not valid or the library function cannot
 * be loaded, return a NULL string.
 */
const char * aa_status_string (
    int status
);


etc.


fyi:

 Directory of C:\ash

11/25/2016  07:08 AM    <DIR>          .
11/25/2016  07:08 AM    <DIR>          ..
02/28/2014  12:00 PM             2,749 aadetect.c
02/28/2014  12:00 PM            28,126 aardvark.c
02/28/2014  12:00 PM            55,598 aardvark.dll
02/28/2014  12:00 PM            25,398 aardvark.h
11/24/2016  12:36 PM             5,726 aaspi_file.c
02/28/2014  12:00 PM             2,919 Makefile


perhaps the makefile has some useful info.... I've looked at it but so far not sure I can use it right now.

Ralph

>+<
 |    /\
 |___/  \
 [_@_]   `<
 O O O   
      IRS!
------------------------------------------------------------------------------------
In the twenty-first century, the robot will take the place
which slave labor occupied in ancient civilization.
 -- Nikola Tesla
------------------------------------------------------------------------------------


On Thu, Nov 24, 2016 at 1:06 PM, Ralph Hipps <[hidden email]> wrote:

Ok, I know I’m a newb, but I need help getting started on something urgent.

 

I’ve installed gcc, seems to be working, path is set, etc.

 

I’m getting errors about not finding stuff even tho it’s in the directory my source is in, and I’m in that dir when I invoke the tools. Seems a bit odd. I’m running on Win7 Enterprise.

 

Any suggestions?

 

aaspi_file.c has:

 

#include <stdio.h>

#include <stdlib.h>

#include "aardvark.h"

 

But….

 

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

 

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xa0): undefined reference to `aa_spi_write'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0xb4): undefined reference to `aa_status_string'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x21c): undefined reference to `aa_sleep_ms'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x309): undefined reference to `aa_open'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x35a): undefined reference to `aa_configure'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x36e): undefined reference to `aa_target_power'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x399): undefined reference to `aa_spi_configure'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x3ad): undefined reference to `aa_spi_bitrate'

C:\Users\rhipps\AppData\Local\Temp\cc6bFg5w.o:aaspi_file.c:(.text+0x3e5): undefined reference to `aa_close'

collect2.exe: error: ld returned 1 exit status

 

C:\ash>gcc aaspi_file.c -l aardvark.dll -o prog_ice.exe

 

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 aardvark.h -o prog_ice.exe

 

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -laardvark.h

collect2.exe: error: ld returned 1 exit status

 

Thanks, and Happy Holidays!

 

Ralph Hipps

 

 

 

 

Ralph

>+<
 |    /\
 |___/  \
 [_@_]   `<
 O O O   
      IRS!
------------------------------------------------------------------------------------
In the twenty-first century, the robot will take the place
which slave labor occupied in ancient civilization.
 -- Nikola Tesla
------------------------------------------------------------------------------------



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

_______________________________________________
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: newbie errors

Riccardo Mottola
Hi Ralph,

Ralph Hipps wrote:
> perhaps the makefile has some useful info.... I've looked at it but so
> far not sure I can use it right now.
>

what about just typing "make" ?

Riccardo

------------------------------------------------------------------------------
_______________________________________________
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: newbie errors

Keith Marshall-3
In reply to this post by Ralph Hipps
-----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
[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: newbie errors

Sergio NNX
> 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.

> perhaps the makefile has some useful info.... I've looked at it but so far not sure I can use it right now.

> Thanks, and Happy Holidays!
Which holidays are you talking about? School holidays?

> If you are writing a program yourself, take a seat, relax and dust out
> some C primer book or tutorial: you are not hitting yet a MinGW issue,
> but just standard build issues.
It seems to be quite hard to explain (or teach) something to beginners via this 'medium', doesn't it?

The steps below work fine for me!

$ gcc -Iinclude -o aaspi_file.o -c aaspi_file.c

$ gcc -Wl,--no-undefined -Llib -o aaspi_file.exe aaspi_file.o -laardvark

$ dir
total 143
drwxr-xr-x 5 Administrator Administrators  4096 Nov 25 20:43 .
drwxr-xr-x 4 Administrator Administrators  8192 Nov 25 20:20 ..
-rwxr-xr-x 1 Administrator Administrators 61737 Nov 25 20:37 aardvark.dll
-rw-r--r-- 1 Administrator Administrators  5558 Feb 28  2014 aaspi_file.c
-rwxr-xr-x 1 Administrator Administrators 60741 Nov 25 20:43 aaspi_file.exe
-rw-r--r-- 1 Administrator Administrators  3561 Nov 25 20:43 aaspi_file.o
drwxr-xr-x 2 Administrator Administrators     0 Nov 25 20:33 bin
drwxr-xr-x 2 Administrator Administrators     0 Nov 25 20:34 include
drwxr-xr-x 2 Administrator Administrators     0 Nov 25 20:34 lib

Administrator@melbourne /src/aardvark
$ aaspi_file.exe
usage: aaspi_file PORT MODE filename
  mode 0 : pol = 0, phase = 0
  mode 1 : pol = 0, phase = 1
  mode 2 : pol = 1, phase = 0
  mode 3 : pol = 1, phase = 1

  'filename' should contain data to be sent
  to the downstream spi device


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

_______________________________________________
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: newbie errors

frank muhoro
In reply to this post by Riccardo Mottola
Please don't spam my mail , but you can't run make without a makefile
since make will look for a file known as Makefile

On 25/11/2016, Riccardo Mottola <[hidden email]> wrote:

> Hi Ralph,
>
> Ralph Hipps wrote:
>> perhaps the makefile has some useful info.... I've looked at it but so
>> far not sure I can use it right now.
>>
>
> what about just typing "make" ?
>
> Riccardo
>
> ------------------------------------------------------------------------------
> _______________________________________________
> 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
>

------------------------------------------------------------------------------
_______________________________________________
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...