bacnet-stack icon indicating copy to clipboard operation
bacnet-stack copied to clipboard

Compile issue on Linux (Fedora 24 and raspian Jessy 2017)

Open jlcox1970 opened this issue 7 years ago • 4 comments

Hi have been trying to compile but have struck an issue with the current master. When I compile I get the following on any commit after 1b4cb0eee52d158b90924904fee23cd406bc3353 cc -pthread main.o ../../demo/object/device.o ../../demo/object/nc.o ../../demo/object/access_credential.o ../../demo/object/access_door.o ../../demo/object/access_point.o ../../demo/object/access_rights.o ../../demo/object/access_user.o ../../demo/object/access_zone.o ../../demo/object/credential_data_input.o ../../demo/object/bacfile.o -Wl,-L../../lib,-lbacnet,-lc,-lgcc,-lrt,-lm -o bacserv ../../demo/object/nc.o: In functionNotification_Class_Load_UCI_List': nc.c:(.text+0x1e): undefined reference to ucix_get_option_int' ../../demo/object/nc.o: In function Notification_Class_Init': nc.c:(.text+0xcb): undefined reference to ucix_init' nc.c:(.text+0x122): undefined reference to ucix_for_each_section_type' nc.c:(.text+0x13d): undefined reference to ucix_get_option' nc.c:(.text+0x1b6): undefined reference to ucix_get_option' nc.c:(.text+0x1da): undefined reference to ucix_get_option_int' nc.c:(.text+0x235): undefined reference to ucix_string_copy' nc.c:(.text+0x253): undefined reference to ucix_get_option' nc.c:(.text+0x2d8): undefined reference to ucix_string_copy' nc.c:(.text+0x31d): undefined reference to ucix_get_list' nc.c:(.text+0x537): undefined reference to ucix_cleanup' ../../demo/object/nc.o: In function Notification_Class_Write_Property': nc.c:(.text+0xb7a): undefined reference to ucix_init' nc.c:(.text+0xe26): undefined reference to ucix_add_option' nc.c:(.text+0x1430): undefined reference to ucix_set_list' nc.c:(.text+0x1441): undefined reference to ucix_commit' nc.c:(.text+0x144d): undefined reference to ucix_cleanup' collect2: error: ld returned 1 exit status Makefile:99: recipe for target 'bacserv' failed `

When checkout 1b4cb0eee52d158b90924904fee23cd406bc3353 compiles complete successfully

Any ideas on how to fix ?

jlcox1970 avatar Mar 05 '17 05:03 jlcox1970

Hi This software is for usage in LEDE or OpenWRT. What is your make comand? Try add "-DBAC_UCI" to BACNET_DEFINES=""

make clean;make BUILD=debug BACNET_PORT=linux BACDL_DEFINE=-DBACDL_BIP=1 BACNET_DEFINES=" -DPRINT_ENABLED=1 -DINTRINSIC_REPORTING -DBACFILE -DBACAPP_ALL -DBAC_UCI"

Here is the Makefile for OpenWRT/LEDE https://github.com/stargieg/packages-automation/blob/master/bacnet-stack/Makefile

stargieg avatar Mar 06 '17 10:03 stargieg

Same issue when trying to compile latest master d4767d3 under Linux. Tried the make command above, still same errors.

ubuntu:~/bacnet-stack$ make clean all
make -s -C lib clean
make -s -C demo clean
make -s -C demo/router clean
make -s -C demo/router-ipv6 clean
make -s -C demo/gateway clean
make -s -C lib all
make -C demo all
make[1]: Entering directory `/home/rmn87/bacnet-stack/demo'
make -s -b -C  readprop all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/readprop'
   text	   data	    bss	    dec	    hex	filename
 107571	   1224	 416720	 525515	  804cb	bacrp
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/readprop'
make -s -b -C  writeprop all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/writeprop'
   text	   data	    bss	    dec	    hex	filename
 108420	   1224	 512464	 622108	  97e1c	bacwp
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/writeprop'
make -s -b -C  readfile all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/readfile'
   text	   data	    bss	    dec	    hex	filename
  96204	   1192	 416704	 514100	  7d834	bacarf
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/readfile'
make -s -b -C  writefile all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/writefile'
   text	   data	    bss	    dec	    hex	filename
  94296	   1176	 418176	 513648	  7d670	bacawf
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/writefile'
make -s -b -C  reinit all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/reinit'
   text	   data	    bss	    dec	    hex	filename
  92976	   1160	 416704	 510840	  7cb78	bacrd
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/reinit'
make -s -b -C  server all
make[2]: Entering directory `/home/rmn87/bacnet-stack/demo/server'
../../demo/object/nc.o: In function `Notification_Class_Load_UCI_List':
nc.c:(.text+0x1e): undefined reference to `ucix_get_option_int'
../../demo/object/nc.o: In function `Notification_Class_Init':
nc.c:(.text+0xde): undefined reference to `ucix_init'
nc.c:(.text+0x135): undefined reference to `ucix_for_each_section_type'
nc.c:(.text+0x150): undefined reference to `ucix_get_option'
nc.c:(.text+0x1c7): undefined reference to `ucix_get_option'
nc.c:(.text+0x1eb): undefined reference to `ucix_get_option_int'
nc.c:(.text+0x25c): undefined reference to `ucix_string_copy'
nc.c:(.text+0x27a): undefined reference to `ucix_get_option'
nc.c:(.text+0x2ff): undefined reference to `ucix_string_copy'
nc.c:(.text+0x346): undefined reference to `ucix_get_list'
nc.c:(.text+0x560): undefined reference to `ucix_cleanup'
../../demo/object/nc.o: In function `Notification_Class_Write_Property':
nc.c:(.text+0xbaa): undefined reference to `ucix_init'
nc.c:(.text+0xe6d): undefined reference to `ucix_add_option'
nc.c:(.text+0x15a0): undefined reference to `ucix_set_list'
nc.c:(.text+0x15b1): undefined reference to `ucix_commit'
nc.c:(.text+0x15bd): undefined reference to `ucix_cleanup'
collect2: error: ld returned 1 exit status
make[2]: *** [bacserv] Error 1
make[2]: Leaving directory `/home/rmn87/bacnet-stack/demo/server'
make[1]: *** [server.all] Error 2
make[1]: Leaving directory `/home/rmn87/bacnet-stack/demo'
make: *** [demos] Error 2
ubuntu:~/bacnet-stack$ make clean;make BUILD=debug BACNET_PORT=linux BACDL_DEFINE=-DBACDL_BIP=1 BACNET_DEFINES=" -DPRINT_ENABLED=1 -DINTRINSIC_REPORTING -DBACFILE -DBACAPP_ALL -DBAC_UCI"
make -s -C lib clean
make -s -C demo clean
make -s -C demo/router clean
make -s -C demo/router-ipv6 clean
make -s -C demo/gateway clean
make -s -C lib all
../demo/handler/h_rp_a.c: In function ‘rp_ack_print_data’:
../demo/handler/h_rp_a.c:58:10: warning: variable ‘print_brace’ set but not used [-Wunused-but-set-variable]
     bool print_brace = false;
          ^
../demo/handler/h_rp_a.c:52:34: warning: variable ‘object_value’ set but not used [-Wunused-but-set-variable]
     BACNET_OBJECT_PROPERTY_VALUE object_value;  /* for bacapp printing */
                                  ^
../demo/handler/h_rpm_a.c: In function ‘rpm_ack_print_data’:
../demo/handler/h_rpm_a.c:210:10: warning: unused variable ‘array_value’ [-Wunused-variable]
     bool array_value = false;
          ^
../demo/handler/h_rpm_a.c:207:34: warning: variable ‘object_value’ set but not used [-Wunused-but-set-variable]
     BACNET_OBJECT_PROPERTY_VALUE object_value;  /* for bacapp printing */
                                  ^
../demo/handler/h_rr.c: In function ‘handler_read_range’:
../demo/handler/h_rr.c:101:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/h_rr_a.c: In function ‘PrintReadRangeData’:
../demo/handler/h_rr_a.c:55:10: warning: variable ‘print_brace’ set but not used [-Wunused-but-set-variable]
     bool print_brace = false;
          ^
../demo/handler/h_rr_a.c:49:34: warning: variable ‘object_value’ set but not used [-Wunused-but-set-variable]
     BACNET_OBJECT_PROPERTY_VALUE object_value;  /* for bacapp printing */
                                  ^
../demo/handler/h_alarm_ack.c: In function ‘handler_alarm_ack’:
../demo/handler/h_alarm_ack.c:83:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/h_arf.c: In function ‘handler_atomic_read_file’:
../demo/handler/h_arf.c:109:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/h_awf.c: In function ‘handler_atomic_write_file’:
../demo/handler/h_awf.c:89:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/h_ucov.c: In function ‘handler_ucov_notification’:
../demo/handler/h_ucov.c:68:9: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
     int len = 0;
         ^
../demo/handler/h_getevent.c: In function ‘handler_get_event_information’:
../demo/handler/h_getevent.c:92:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/h_pt.c: In function ‘handler_conf_private_trans’:
../demo/handler/h_pt.c:212:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent;
         ^
../demo/handler/h_upt.c: In function ‘private_transfer_print_data’:
../demo/handler/h_upt.c:51:10: warning: variable ‘print_brace’ set but not used [-Wunused-but-set-variable]
     bool print_brace = false;
          ^
../demo/handler/h_upt.c:45:34: warning: variable ‘object_value’ set but not used [-Wunused-but-set-variable]
     BACNET_OBJECT_PROPERTY_VALUE object_value;  /* for bacapp printing */
                                  ^
../demo/handler/s_arfs.c: In function ‘Send_Atomic_Read_File_Stream’:
../demo/handler/s_arfs.c:62:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_awfs.c: In function ‘Send_Atomic_Write_File_Stream’:
../demo/handler/s_awfs.c:62:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_dcc.c: In function ‘Send_Device_Communication_Control_Request’:
../demo/handler/s_dcc.c:71:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_ptransfer.c: In function ‘Send_Private_Transfer_Request’:
../demo/handler/s_ptransfer.c:72:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_rd.c: In function ‘Send_Reinitialize_Device_Request’:
../demo/handler/s_rd.c:68:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_readrange.c: In function ‘Send_ReadRange_Request’:
../demo/handler/s_readrange.c:61:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_rpm.c: In function ‘Send_Read_Property_Multiple_Request’:
../demo/handler/s_rpm.c:71:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_ts.c: In function ‘Send_TimeSync_Remote’:
../demo/handler/s_ts.c:62:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_ts.c: In function ‘Send_TimeSyncUTC_Remote’:
../demo/handler/s_ts.c:120:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_cevent.c: In function ‘Send_CEvent_Notify’:
../demo/handler/s_cevent.c:56:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_whohas.c: In function ‘Send_WhoHas_Name’:
../demo/handler/s_whohas.c:66:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_whohas.c: In function ‘Send_WhoHas_Object’:
../demo/handler/s_whohas.c:121:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_whois.c: In function ‘Send_WhoIs_To_Network’:
../demo/handler/s_whois.c:66:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_wpm.c: In function ‘Send_Write_Property_Multiple_Request_Data’:
../demo/handler/s_wpm.c:70:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_wp.c: In function ‘Send_Write_Property_Request_Data’:
../demo/handler/s_wp.c:66:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../demo/handler/s_getevent.c: In function ‘Send_GetEvent’:
../demo/handler/s_getevent.c:59:9: warning: variable ‘bytes_sent’ set but not used [-Wunused-but-set-variable]
     int bytes_sent = 0;
         ^
../src/ucix.c:25:24: fatal error: uci_config.h: No such file or directory
 #include <uci_config.h>
                        ^
compilation terminated.
make[1]: *** [../src/ucix.o] Error 1
make: *** [library] Error 2

rmn87 avatar Sep 05 '17 15:09 rmn87

@stargieg - I just ran into the same issue as @rmn87 . Please advise on possible resolution.

willcharlton avatar May 11 '18 16:05 willcharlton

Met same issue. Just work around by not touching the inconsistent conditioned code

make BUILD=debug BACNET_PORT=linux BACDL_DEFINE=-DBACDL_BIP=1 BACNET_DEFINES=" -DPRINT_ENABLED=1 -DBACFILE -DBACAPP_ALL -DBACNET_PROPERTY_LISTS"

Then I will be able to build it on ubuntu.

bing-mao avatar Jul 02 '18 18:07 bing-mao