:: Re: [DNG] Making sense of C pointer…
Página Inicial
Delete this message
Reply to this message
Autor: aitor_czr
Data:  
Para: Edward Bartolo, Rainer Weikusat, dng
Assunto: Re: [DNG] Making sense of C pointer syntax.

El 25/05/16 a las 10:50, aitor_czr escribió:
> Hi Edward,
>
> El 29/03/16 a las 00:58, Edward Bartolo <edbarx@???> escribió:
>> I found using the return value of a function makes code much more
>> >readable and probably more reliable. Multiple return values can be
>> >encapsulated inside a structure which would be returned by a function.
>> >I used this construct in simple-netaid-lightweight which avoids the
>> >use of GtkBuilder.
>> >
>> >Edward
>
> Building your simple-netaid-lightweight, this is what i get:
>
>
> aitor@localhost:~/simple-netaid-lightweight$ make
> rm -f sn-lightweight
> gcc -Iinclude `pkg-config --libs --cflags gtk+-2.0` -c
> src/auxiliaries.c src/signal_functions.c src/main_gui.c
> src/dialog_gui.c rc/sn-lightweight.c
> mv *.o obj/
> mv: el objetivo «obj/» no es un directorio
> Makefile:16: recipe for target 'compile-objs' failed
> make: *** [compile-objs] Error 1
>
>
>
> So, you need to modify the Makefile to something like this:
>
> CC=gcc
> CFLAGS=-Iinclude
> GTK2FLAGS=`pkg-config --libs --cflags gtk+-2.0`
> D=src
> OBJ=obj
>
> src0=auxiliaries.c signal_functions.c main_gui.c
> src1=dialog_gui.c sn-lightweight.c
>
> SOURCEFILES=$(addprefix $(D)/, $(src0) $(src1))
> OBJFILES=$(addprefix $(OBJ)/, $(src0:.c=.o) $(src1:.c=.o))
>
> all: clean compile-objs sn-lightweight
>
> compile-objs:
>     $(CC) $(CFLAGS) $(GTK2FLAGS) -c $(SOURCEFILES)
>     mkdir obj
>     mv *.o obj/

>
> sn-lightweight:
>     $(CC) $(CFLAGS) $(GTK2FLAGS) -o sn-lightweight $(OBJFILES)

>
> clean:
>     rm -f sn-lightweight

>
> After doing this change, it works :)
>
> Cheers,
>
> Aitor.
>
> [*] Added "mkdir obj" line.
>


You must also include:

rm -rf obj

at the end of the Makefile.

Aitor.