[ gpsdrive ] error: implicit declaration of function

Hamish hamish_b at yahoo.com
Tue Mar 3 02:13:24 AKST 2009


Hi.

Now that I know how to set CFLAGS in cmake I could flush out some errors.

(edit build/CMakeCache.txt,
 CMAKE_BUILD_TYPE:STRING=None
 ...
 //Flags for C compiler.
CMAKE_C_FLAGS:STRING=-g -Wall -Werror-implicit-function-declaration -Wextra -Wunused -fno-common
)



first what -Werror-implicit-function-declaration found:

I've just fixed a whole pile of missing includes and fn declarations which
hopefully will fix the Ubuntu compiling problem.


that found one mis-match in unit_test.c:   (too few terms)

-    res = db_poi_edit (0, 999.9, 999.9, "Testpoint", "test", "Test Description", 1);
+    res = db_poi_edit (0, 999.9, 999.9, "Testpoint", "test", "Test Description", 1, FALSE);


I just guessed: I am not sure if the final 1 should be the src int or
the boolean SQL UPDATE flag. it seems like a new record so I guessed
that SQL INSERT was more appropriate so the 1 must be for the src int.
????



next what -fno-common found:

(I haven't attempted to fix these as I don't know the code that well)


CMakeFiles/gpsdrive.dir/import_map.o: In function `close_import_window_cb':
/usr/src/gpsdrive/svn/trunk/src/import_map.c:190: multiple definition of `wptext2'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1960: first defined here
CMakeFiles/gpsdrive.dir/main_gui.o: In function `dash_menu_cb':
/usr/src/gpsdrive/svn/trunk/src/main_gui.c:188: multiple definition of `kontext_map'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1773: first defined here
CMakeFiles/gpsdrive.dir/routes.o: In function `saytargettext':
/usr/src/gpsdrive/svn/trunk/src/routes.c:118: multiple definition of `routelist'
CMakeFiles/gpsdrive.dir/map_handler.o:/usr/src/gpsdrive/svn/trunk/src/map_handler.c:116: first defined here
CMakeFiles/gpsdrive.dir/settings.o: In function `reinitgps_cb':
/usr/src/gpsdrive/svn/trunk/src/settings.c:118: multiple definition of `menuitem_sendmsg'
CMakeFiles/gpsdrive.dir/main_gui.o:/usr/src/gpsdrive/svn/trunk/src/main_gui.c:183: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:116: multiple definition of `wayp'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1787: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:117: multiple definition of `maxwp'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1957: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:117: multiple definition of `add_wp_name_text'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1960: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:116: multiple definition of `addwaypointwindow'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1969: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:117: multiple definition of `gotowindow'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:400: first defined here
CMakeFiles/gpsdrive.dir/waypoint.o: In function `check_and_reload_way_txt':
/usr/src/gpsdrive/svn/trunk/src/waypoint.c:117: multiple definition of `wptext2'
CMakeFiles/gpsdrive.dir/gpsdrive.o:/usr/src/gpsdrive/svn/trunk/src/gpsdrive.c:1960: first defined here
collect2: ld returned 1 exit status
make[2]: *** [src/gpsdrive] Error 1
make[1]: *** [src/CMakeFiles/gpsdrive.dir/all] Error 2
make: *** [all] Error 2



finally -Wunused found a huge amount of unused variables and parameter
which need to be removed by someone on a rainy day.



very useful to add those CFLAGS!


Hamish



      



More information about the GPSdrive mailing list