v.1.2.2 Static Agent Build with ODBC fails

Started by xatteg, July 25, 2012, 11:13:40 AM

Previous topic - Next topic

xatteg

Hello Victor,

I've got a problem compiling Static Agent when enabling ODBC subagent.
Configure string:
./configure --with-static-agent --disable-encryption --with-static-subagents=ODBCQuery --without-sqlite --with-all-static

Error:
make[4]: Entering directory `/distr/netxms-1.2.2/src/agent/core'
  CXXLD  nxagentd
static_subagents.o: In function `InitStaticSubagents()':
/distr/netxms-1.2.2/src/agent/core/static_subagents.cpp:13: undefined reference to `NxSubAgentRegister_ODBCQUERY'
collect2: ld returned 1 exit status
make[4]: *** [nxagentd] Error 1
make[4]: Leaving directory `/distr/netxms-1.2.2/src/agent/core'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/distr/netxms-1.2.2/src/agent'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/distr/netxms-1.2.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/distr/netxms-1.2.2'
make: *** [all] Error 2
[root@netxms netxms-1.2.2]#


Static agent without ODBC subagent compiles fine and Not static agent with ODBC subagent also compiles fine.

Victor Kirhenshtein

Hi!

Try to use

--with-static-subagents=odbcquery

(with all small letters).

Best regards,
Victor

xatteg


Victor Kirhenshtein

I have fixed this error. Agent compiles both with and without all-static flag. I'm not sure if it will work correctly with ODBC and all-static, because ODBC uses dynamic linking internally to load drivers, but you can check. Agent compiled without all-static should work without problem, but it will depend on system shared libraries - only NetXMS libraries and subagents will be included into nxagentd binary. Updated source package can be downloaded from here: https://netxms.org/download/patches/014/netxms-1.2.2.tar.gz.

Best regards,
Victor

xatteg

Hello Victor,

It is working now! It compiled in both cases with and without --with-all-static (I'm using without). The thing is it was trying to copy odbc.so to <netxms-install-dir>/odbc.ddr when I issued "make install". So I had to go to "src/agent" subdir and issue "make install" there, and everything installed fine.