Trouble locating gc.h with gcc/MinGW

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble locating gc.h with gcc/MinGW

Andrew Pennebaker
I have download, configured, compiled, and installed BoehmGC in MinGW, but when I try to compile a test program that uses BoehmGC, gcc fails to find the library.

$ make
gcc -o boehmtest boehmtest.c -lgc
boehmtest.c:3:16: fatal error: gc.h: No such file or directory

I found gc.h in MinGW's /usr/local/include/gc directory, but adding -I/usr/local/include/gc and -L/usr/local/include/gc don't help.

Specs:
  • BoehmGC from cvs
  • gcc 4.5.2
  • MinGW 0.1-alpha-5.1
  • MSYS 1.0
  • Windows 7 Professional x64
  • MacBook Pro
Cheers,

Andrew Pennebaker

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
|

Re: Trouble locating gc.h with gcc/MinGW

gvanem
"Andrew Pennebaker" <[hidden email]> wrote:

>I have download, configured, compiled, and installed BoehmGC in MinGW, but
> when I try to compile a test program that
> uses BoehmGC, gcc fails to find the library.
>
> $ make
> gcc -o boehmtest boehmtest.c -lgc
> boehmtest.c:3:16: fatal error: gc.h: No such file or directory
>
> I found gc.h in MinGW's /usr/local/include/gc directory, but adding
> -I/usr/local/include/gc and -L/usr/local/include/gc don't help.


gcc doesn't "fail to find the library", but the header. Try 'gcc -v' and see where
it looks. Are you sure '/usr/local/include/gc' exist (visible and valid) in a plain
cmd shell?

If you really have made a BoehmGC lib in /usr/local/lib/gc and a gc.h in
/usr/local/include/gc, you only need this compile and link command:

gcc -o boehmtest boehmtest.c -I/usr/local/include/gc /usr/local/lib/gc/libgc.a

Btw. my gc.h belongs to Gtk/Glib and has nothing to do with the Boehm garbarge
collector.

--gv

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
LRN
Reply | Threaded
Open this post in threaded view
|

Re: Trouble locating gc.h with gcc/MinGW

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

On 13.09.2012 10:25, Gisle Vanem wrote:

> "Andrew Pennebaker" <[hidden email]> wrote:
>
>> I have download, configured, compiled, and installed BoehmGC in
>> MinGW, but when I try to compile a test program that uses
>> BoehmGC, gcc fails to find the library.
>>
>> $ make gcc -o boehmtest boehmtest.c -lgc boehmtest.c:3:16: fatal
>> error: gc.h: No such file or directory
>>
>> I found gc.h in MinGW's /usr/local/include/gc directory, but
>> adding -I/usr/local/include/gc and -L/usr/local/include/gc don't
>> help.
>
>
> gcc doesn't "fail to find the library", but the header. Try 'gcc
> -v' and see where it looks. Are you sure '/usr/local/include/gc'
> exist (visible and valid) in a plain cmd shell?
>
> If you really have made a BoehmGC lib in /usr/local/lib/gc and a
> gc.h in /usr/local/include/gc, you only need this compile and link
> command:
>
> gcc -o boehmtest boehmtest.c -I/usr/local/include/gc
> /usr/local/lib/gc/libgc.a
>
> Btw. my gc.h belongs to Gtk/Glib and has nothing to do with the
> Boehm garbarge collector.
Neither gtk, nor glib install anything into $(includedir)/, they
create separate sub-directories. And they definitely don't install gc.h.

bdw-gc does install gc.h into $(includedir)/, but it's a stub for
backward compatibility that just includes <gc/gc.h>; real headers are
in $(includedir)/gc/, as OP have discovered.

That said, he does need to either install into /mingw, which is
searched by default, or use -I and -L as you suggested.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQUYTXAAoJEOs4Jb6SI2Cw6MEIAK+SkJUPg7BanYSiXdBONrPw
9NO0q9WX+xlIr6kyVmNfMUVcKMcQ61DdhTpcL8OAI+Fvvt9GFfnrqB/dv8iCmErg
k1hbOSKWVQOdlc9fPyZ18nqAvbs4Q6yJhwwScFLk5xCseCAOmPodlN43cqdpvH3u
TGBPu7yhIBiNbEr9oCV/Ltfm6+f3Sw/vDRD12eCtlqh2zL6qS26bYDW7FbU1XMI5
qnEUfBhdPYi4QXcvq7bnvy1iy0cxFuvY0WmsQCjlpxOqQa/zw8QgW69NP+wRmMBq
FiTf4jqyaPWRpHye7Kj5bXxsr6c0JfTJGKIURy/pLxUrBgOuth5yt1e3Ys3Wd5o=
=gTTV
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
|

Re: Trouble locating gc.h with gcc/MinGW

gvanem
"LRN" <[hidden email]> wrote:

> Neither gtk, nor glib install anything into $(includedir)/, they
> create separate sub-directories. And they definitely don't install gc.h.

gc.h (once?) belonged to gtkmm; the official C++ interface for the
GUI library GTK. And here, it did install a g:\MingW32\include\gtkmm-2.0\gc.h
My file is dated in 2003.

--gv

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
|

Re: Trouble locating gc.h with gcc/MinGW

Earnie Boyd
In reply to this post by Andrew Pennebaker
On Wed, Sep 12, 2012 at 9:26 PM, Andrew Pennebaker wrote:

> I have download, configured, compiled, and installed BoehmGC in MinGW, but
> when I try to compile a test program that uses BoehmGC, gcc fails to find
> the library.
>
> $ make
> gcc -o boehmtest boehmtest.c -lgc
> boehmtest.c:3:16: fatal error: gc.h: No such file or directory
>
> I found gc.h in MinGW's /usr/local/include/gc directory, but adding
> -I/usr/local/include/gc and -L/usr/local/include/gc don't help.
>

I've read the other responses you should be able to use the following
command but I have no way to test it.  Also I assume you are within
the MSYS shell and that the file libgc.a or libgc.dll.a exists in
/usr/local/lib.

$ gcc -I/usr/local/include -L/usr/local/lib -o boehmtest boehmtest.c -lgc

To avoid needing to specify -I and -L you should use --prefix=/mingw
when building and installing the library.  The MinGW GCC while it
looks in /usr/local/[lib|include] by default doesn't find it because
the path doesn't exist at the root of the current working drive.

--
Earnie
-- https://sites.google.com/site/earnieboyd

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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