baboom09 / sma-bluetooth

Automatically exported from code.google.com/p/sma-bluetooth
0 stars 0 forks source link

Compile issues on Ubuntu 12.04 #108

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. gcc -lbluetooth -lcurl -lmysqlclient -g -o smatool smatool.c 
2.
3.

What is the expected output? What do you see instead?
Not meant to have any output which means that all ran well.
When I try to compile smatool I get this
masda@Masda-srv:~/sma-bluetooth18$ gcc -lbluetooth -lcurl -lmysqlclient -g -o 
sm                              atool smatool.c
smatool.c: In function âGetInverterSettingâ:
smatool.c:1470:24: warning: format â%Xâ expects argument of type âunsigned 
int *                              â, but argument 3 has type âunsigned char 
*â [-Wformat]
smatool.c:1473:24: warning: format â%Xâ expects argument of type âunsigned 
int *                              â, but argument 3 has type âunsigned char 
*â [-Wformat]
smatool.c:1475:24: warning: format â%Xâ expects argument of type âunsigned 
int *                              â, but argument 3 has type âunsigned char 
*â [-Wformat]
smatool.c:1477:24: warning: format â%Xâ expects argument of type âunsigned 
int *                              â, but argument 3 has type âunsigned char 
*â [-Wformat]
/tmp/ccJNoFHW.o: In function `OpenMySqlDatabase':
/home/masda/sma-bluetooth18/mysql.c:17: undefined reference to `mysql_init'
/home/masda/sma-bluetooth18/mysql.c:19: undefined reference to 
`mysql_real_conne                              ct'
/home/masda/sma-bluetooth18/mysql.c:21: undefined reference to `mysql_error'
/tmp/ccJNoFHW.o: In function `CloseMySqlDatabase':
/home/masda/sma-bluetooth18/mysql.c:29: undefined reference to 
`mysql_free_resul                              t'
/home/masda/sma-bluetooth18/mysql.c:30: undefined reference to 
`mysql_free_resul                              t'
/home/masda/sma-bluetooth18/mysql.c:31: undefined reference to 
`mysql_free_resul                              t'
/home/masda/sma-bluetooth18/mysql.c:32: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `DoQuery':
/home/masda/sma-bluetooth18/mysql.c:38: undefined reference to 
`mysql_real_query                              '
/home/masda/sma-bluetooth18/mysql.c:39: undefined reference to `mysql_error'
/home/masda/sma-bluetooth18/mysql.c:41: undefined reference to 
`mysql_store_resu                              lt'
/home/masda/sma-bluetooth18/mysql.c:42: undefined reference to `mysql_error'
/tmp/ccJNoFHW.o: In function `DoQuery1':
/home/masda/sma-bluetooth18/mysql.c:48: undefined reference to 
`mysql_real_query                              '
/home/masda/sma-bluetooth18/mysql.c:49: undefined reference to `mysql_error'
/home/masda/sma-bluetooth18/mysql.c:51: undefined reference to 
`mysql_store_resu                              lt'
/home/masda/sma-bluetooth18/mysql.c:52: undefined reference to `mysql_error'
/tmp/ccJNoFHW.o: In function `DoQuery2':
/home/masda/sma-bluetooth18/mysql.c:58: undefined reference to 
`mysql_real_query                              '
/home/masda/sma-bluetooth18/mysql.c:59: undefined reference to `mysql_error'
/home/masda/sma-bluetooth18/mysql.c:61: undefined reference to 
`mysql_store_resu                              lt'
/home/masda/sma-bluetooth18/mysql.c:62: undefined reference to `mysql_error'
/tmp/ccJNoFHW.o: In function `conv':
/home/masda/sma-bluetooth18/smatool.c:358: undefined reference to `pow'
/tmp/ccJNoFHW.o: In function `sunrise':
/home/masda/sma-bluetooth18/smatool.c:673: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:673: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:677: undefined reference to `tan'
/home/masda/sma-bluetooth18/smatool.c:677: undefined reference to `atan'
/home/masda/sma-bluetooth18/smatool.c:679: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:680: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:686: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:687: undefined reference to `asin'
/home/masda/sma-bluetooth18/smatool.c:687: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:689: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:689: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:689: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:698: undefined reference to `acos'
/home/masda/sma-bluetooth18/smatool.c:715: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:715: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:715: undefined reference to `floor'
/tmp/ccJNoFHW.o: In function `sunset':
/home/masda/sma-bluetooth18/smatool.c:756: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:756: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:760: undefined reference to `tan'
/home/masda/sma-bluetooth18/smatool.c:760: undefined reference to `atan'
/home/masda/sma-bluetooth18/smatool.c:762: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:763: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:769: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:770: undefined reference to `asin'
/home/masda/sma-bluetooth18/smatool.c:770: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:772: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:772: undefined reference to `sin'
/home/masda/sma-bluetooth18/smatool.c:772: undefined reference to `cos'
/home/masda/sma-bluetooth18/smatool.c:779: undefined reference to `acos'
/home/masda/sma-bluetooth18/smatool.c:791: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:791: undefined reference to `floor'
/home/masda/sma-bluetooth18/smatool.c:791: undefined reference to `floor'
/tmp/ccJNoFHW.o: In function `install_mysql_tables':
/home/masda/sma-bluetooth18/smatool.c:807: undefined reference to 
`mysql_fetch_r                              ow'
/home/masda/sma-bluetooth18/smatool.c:867: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `update_mysql_tables':
/home/masda/sma-bluetooth18/smatool.c:887: undefined reference to 
`mysql_fetch_r                              ow'
/home/masda/sma-bluetooth18/smatool.c:891: undefined reference to 
`mysql_free_re                              sult'
/home/masda/sma-bluetooth18/smatool.c:900: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `check_schema':
/home/masda/sma-bluetooth18/smatool.c:915: undefined reference to 
`mysql_fetch_r                              ow'
/home/masda/sma-bluetooth18/smatool.c:920: undefined reference to 
`mysql_free_re                              sult'
/home/masda/sma-bluetooth18/smatool.c:921: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `todays_almanac':
/home/masda/sma-bluetooth18/smatool.c:941: undefined reference to 
`mysql_fetch_r                              ow'
/home/masda/sma-bluetooth18/smatool.c:945: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `update_almanac':
/home/masda/sma-bluetooth18/smatool.c:958: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `auto_set_dates':
/home/masda/sma-bluetooth18/smatool.c:977: undefined reference to 
`mysql_fetch_r                              ow'
/home/masda/sma-bluetooth18/smatool.c:981: undefined reference to 
`mysql_free_re                              sult'
/home/masda/sma-bluetooth18/smatool.c:982: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `is_light':
/home/masda/sma-bluetooth18/smatool.c:1013: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:1021: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:1027: undefined reference to `mysql_close'
/tmp/ccJNoFHW.o: In function `ConvertStreamtoLong':
/home/masda/sma-bluetooth18/smatool.c:1115: undefined reference to `pow'
/tmp/ccJNoFHW.o: In function `ConvertStreamtoFloat':
/home/masda/sma-bluetooth18/smatool.c:1134: undefined reference to `pow'
/tmp/ccJNoFHW.o: In function `ConvertStreamtoInt':
/home/masda/sma-bluetooth18/smatool.c:1220: undefined reference to `pow'
/tmp/ccJNoFHW.o: In function `ConvertStreamtoTime':
/home/masda/sma-bluetooth18/smatool.c:1239: undefined reference to `pow'
/tmp/ccJNoFHW.o: In function `main':
/home/masda/sma-bluetooth18/smatool.c:1845: undefined reference to `str2ba'
/home/masda/sma-bluetooth18/smatool.c:2554: undefined reference to `mysql_close'
/home/masda/sma-bluetooth18/smatool.c:2636: undefined reference to 
`mysql_num_ro                              ws'
/home/masda/sma-bluetooth18/smatool.c:2638: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:2644: undefined reference to 
`curl_easy_in                              it'
/home/masda/sma-bluetooth18/smatool.c:2646: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2647: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2648: undefined reference to 
`curl_easy_pe                              rform'
/home/masda/sma-bluetooth18/smatool.c:2650: undefined reference to 
`curl_easy_cl                              eanup'
/home/masda/sma-bluetooth18/smatool.c:2673: undefined reference to 
`curl_easy_in                              it'
/home/masda/sma-bluetooth18/smatool.c:2677: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2678: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2679: undefined reference to 
`curl_easy_pe                              rform'
/home/masda/sma-bluetooth18/smatool.c:2682: undefined reference to 
`curl_easy_cl                              eanup'
/home/masda/sma-bluetooth18/smatool.c:2688: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:2694: undefined reference to 
`mysql_free_r                              esult'
/home/masda/sma-bluetooth18/smatool.c:2663: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:2705: undefined reference to 
`curl_easy_in                              it'
/home/masda/sma-bluetooth18/smatool.c:2709: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2710: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2711: undefined reference to 
`curl_easy_pe                              rform'
/home/masda/sma-bluetooth18/smatool.c:2714: undefined reference to 
`curl_easy_cl                              eanup'
/home/masda/sma-bluetooth18/smatool.c:2720: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:2726: undefined reference to 
`mysql_free_r                              esult'
/home/masda/sma-bluetooth18/smatool.c:2732: undefined reference to 
`mysql_free_r                              esult'
/home/masda/sma-bluetooth18/smatool.c:2733: undefined reference to `mysql_close'
/home/masda/sma-bluetooth18/smatool.c:2765: undefined reference to 
`curl_easy_in                              it'
/home/masda/sma-bluetooth18/smatool.c:2767: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2768: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2769: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2771: undefined reference to 
`curl_easy_pe                              rform'
/home/masda/sma-bluetooth18/smatool.c:2794: undefined reference to 
`curl_easy_cl                              eanup'
/home/masda/sma-bluetooth18/smatool.c:2796: undefined reference to 
`curl_easy_in                              it'
/home/masda/sma-bluetooth18/smatool.c:2800: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2801: undefined reference to 
`curl_easy_se                              topt'
/home/masda/sma-bluetooth18/smatool.c:2802: undefined reference to 
`curl_easy_pe                              rform'
/home/masda/sma-bluetooth18/smatool.c:2805: undefined reference to 
`curl_easy_cl                              eanup'
/home/masda/sma-bluetooth18/smatool.c:2758: undefined reference to 
`mysql_fetch_                              row'
/home/masda/sma-bluetooth18/smatool.c:2819: undefined reference to `mysql_close'
collect2: ld returned 1 exit status
masda@Masda-srv:~/sma-bluetooth18$

What version of the product are you using? On what operating system?
I am using SMA-Bluetooth 18. the latest version.
I upgraded Ubuntu from version 10.04 to 12.04

Please provide any additional information below.
I am not sure if any dependancies were removed during the upgrade.

Original issue reported on code.google.com by masd...@gmail.com on 4 Nov 2012 at 3:16

GoogleCodeExporter commented 8 years ago
Hi there,

I understood that gcc does not automatically include the math library. 
Therefore, the compiler statement needs to be enhanced by "-lm". Nevertheless, 
this does not help with the sql and curl errors. I also encounter these 
problems with the latest sma-bluetooth version (although I checked version 14, 
too) with Ubuntu server 13.04.

Any help would be appreciated.

Thanks

Original comment by anton.s...@gmail.com on 17 Sep 2013 at 7:53