Web lists-archives.com

Re: [Mingw-users] newbie errors




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