help needed to compile a C program

Rainer Müller raimue at macports.org
Fri Apr 13 19:40:38 UTC 2018


On 2018-04-13 21:26, macports at parvis.nl wrote:
> 
>> On 2018-04-13, at 20:17, Rainer Müller <raimue at macports.org> wrote:
>>
>> On 2018-04-13 18:21, macports at parvis.nl wrote:
>>> with makefile:
>>> ---
>>> pango-list-typefaces:   pango-list-typefaces.c
>>>         cc -o $@ -Wall -g pango-list-typefaces.c \
>>>         $(pkg-config --cflags --libs pango) \
>>>         $(pkg-config --cflags --libs cairo) \
>>>         $(pkg-config --cflags --libs pangocairo) \Currently 
>>>         $(pkg-config --cflags --libs glib-2.0)
>>
>> The Makefile is your problem. $(foo) is a normal variable expansion.
>> This should be: $(shell pkg-config ...)
>>
>> Rainer
> 
> my mistake: I changed `pkg-config ..` to $(..).
> but neither $(shell pkg-config nor `pkg-config helped. same error.
> question remains open.

Works for me. Use "Download ZIP" to the upper right here, extract and
run make in the directory:
https://gist.github.com/raimue/634213828f7ff86b9a6f4698ed488d85
> any suggestions on my aother questions?
> 
> Currently I have glib2 installed, but there is also glib2-devel, and they conflict with each other.
> Same for pango and pango-devel.
> - What is the difference?
> - Which should I use?

*-devel ports are pre-releases, beta or unstable. You usually do not
want them unless you really need the bleeding edge.

> I don't know what the include path will be. 
> - How should I use 'port provides glib.h' ?

Use an absolute path:

$ port provides /opt/local/include/glib-2.0/glib.h
/opt/local/include/glib-2.0/glib.h is provided by: glib2

If instead you meant you do not know which ports provides a specific
file, there is unfortunately no index available for that.

Rainer


More information about the macports-users mailing list