:: Re: [DNG] Pointer error in the back…
Top Page
Delete this message
Reply to this message
Author: Rainer Weikusat
Date:  
To: dng
Subject: Re: [DNG] Pointer error in the backend of Netman
aitor_czr <aitor_czr@???> writes:
> Now i get the following error trying to compile the backend:
>
> " ... automated_scanner.c:291: undefined reference to `pow' ... "
>
> The 'pow' function is part of the 'math' library. Therefore, the
> invokation of the compiler should be as follows:
>
> $ gcc -g -lm [...]
>
> in order to link with the math library, but it doesn't work for me
> even though the headers <math.h> are included in 'automated_scanner.c'
>
> Aitor.
>
> Note.- I'm using the latest version in your git repository.
>
> https://git.devuan.org/edbarx/netman


Works for me with the following changes

----------
diff --git a/backend_src/Makefile b/backend_src/Makefile
index 0b48a1d..63911a3 100644
--- a/backend_src/Makefile
+++ b/backend_src/Makefile
@@ -7,7 +7,8 @@ OBJECTS=\
        obj/caller.o \
        obj/core_functions.o \
        obj/file_functions.o \
-       obj/essid_encoder.o
+       obj/essid_encoder.o \
+       obj/automated_scanner.o


 CFLAGS += -Wall -Wextra -Iinclude -g -O2
 #CFLAGS += -Wall -Wextra -Iinclude -ggdb
@@ -18,7 +19,7 @@ clean:
        rm -f $(OBJECTS) bin/backend


 bin/backend: $(OBJECTS)
-       $(CC) -o $@ $(OBJECTS)
+       $(CC) -lm -o $@ $(OBJECTS)


 obj/%.o : src/%.c
        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
------------


NB: This also fixes the silly autoWirelessScanPlus_RN omission (by
including all object files). But this is positively the last time I've
either

    - created backend_src/obj by hand
        - created backend_src/bin by hand
        - added automated_scanner.o by hand
        - added the required library by hand


You're free to publish broken stuff on the web and refuse to fix it and
other people are as free to ignore the project if even the most simple
bugs never get fixed.