tjko / nxgipd

nxgipd - a monitoring daemon for UTC Interlogix / GE Security / Caddx NetworX series alarm systems
GNU General Public License v2.0
39 stars 19 forks source link

Will not compile with current version of Mini-XML #12

Closed eschuler21 closed 1 year ago

eschuler21 commented 5 years ago

I read through all the other issues and comments, and got it to compile with Mini-XML ver 2.9. With the current version of Mini-XML (2.12), I was getting the following error:

gcc -Wall -g -O2 -DHAVE_CONFIG_H -DVERSION=\"1.1.1beta\" -DBUILDDATE=\"2019-01-12\" -c -o configuration.o configuration.c configuration.c: In function ‘search_xml_tree’: configuration.c:70:11: error: dereferencing pointer to incomplete type ‘mxml_node_t {aka struct _mxml_node_s}’ if (node->type != type) { ^~ configuration.c: In function ‘xml_whitespace_cb’: configuration.c:85:39: warning: ‘~’ on a boolean expression [-Wbool-operation] } else if ( !strcmp(name,"Zone") || ~!strcmp(name,"Partition") ) { ^ configuration.c:85:39: note: did you mean to use logical not? } else if ( !strcmp(name,"Zone") || ~!strcmp(name,"Partition") ) { ^ !

: recipe for target 'configuration.o' failed make: *** [configuration.o] Error 1
juanjoSanz commented 2 years ago

Have you managed to solve this issue?

I tried to compile on an arm system with ubuntu linux, but I found two issues:

1) config/config.guess file does not recognize my system. Workaround: replace config/config.guess with /usr/share/automake-1.xx/config.guess

2) you're same error. How did you solve it?

user@hostname:~/nx/nxgipd$ make
gcc  -Wall -g -O2  -DHAVE_CONFIG_H -DVERSION=\"1.1.1beta\" -DBUILDDATE=\"2021-11-04\"   -c -o configuration.o configuration.c
configuration.c: In function ‘search_xml_tree’:
configuration.c:70:11: error: dereferencing pointer to incomplete type ‘mxml_node_t’ {aka ‘struct _mxml_node_s’}
   70 |   if (node->type != type) {
      |           ^~
configuration.c: In function ‘xml_whitespace_cb’:
configuration.c:85:39: warning: ‘~’ on a boolean expression [-Wbool-operation]
   85 |   } else if ( !strcmp(name,"Zone") || ~!strcmp(name,"Partition") ) {
      |                                       ^
configuration.c:85:39: note: did you mean to use logical not?
   85 |   } else if ( !strcmp(name,"Zone") || ~!strcmp(name,"Partition") ) {
      |                                       ^
      |                                       !
make: *** [<builtin>: configuration.o] Error 1

update: I re-read your post, then I saw the issue is related with Mini-XML version

https://www.msweet.org/mxml/
Note: Version 3.0 hides the definition of the mxml_node_t structure, requiring the use of the various accessor functions that were introduced in version 2.0.

-> Solution:
1.- Download https://github.com/michaelrsweet/mxml/releases/download/release-2.9/mxml-2.9.tar.gz
2.- Compile and install (./configure ./make ./make install)
tjko commented 1 year ago

There is now fix for Mini-XML v3.x checked in: 5123887c520010ee9716d7ffc06a88e071447c80

It would be great if someone could validate that it works ok, since I can't immediately test this change.