1

Something I'm not getting. I want to include 3 libs in my .pro file. Created an environment variable, and then I add them to the LIBS path. This is OK for 2 times, the third time fails. In detail:

Environment variable:

NETSNMP_DIR C:/usr/net-snmp-5.6.2/win32/lib/debug

.pro file:

win32:LIBS += -L($$(NETSNMP_DIR))/netsnmp -lnetsnmpagent -lnetsnmpmibs \
...

The above fails ! If I do this however:

win32:LIBS += -L($$(NETSNMP_DIR)) -lnetsnmp -lnetsnmpagent -LC:/usr/net-snmp-5.6.2/win32/lib/debug -lnetsnmpmibs \

it builds fine. If I separate all 3 of them, same result: This fails:

win32:LIBS += -L($$(NETSNMP_DIR)) -lnetsnmp \
                -L($$(NETSNMP_DIR)) -lnetsnmpagent \
                -L($$(NETSNMP_DIR)) -lnetsnmpmibs \

This builds just fine:

win32:LIBS += -L($$(NETSNMP_DIR)) -lnetsnmp \
                -L($$(NETSNMP_DIR)) -lnetsnmpagent \
                -LC:/usr/net-snmp-5.6.2/win32/lib/debug -lnetsnmpmibs \

Toolchain: QT 4.8.5, QTCreator 2.8.1, OS Windows 7 What am I missing ? Thanks a lot in advance !

This thing is driving me nuts. I recently came across this post again, and out of the blue I tried this:

win32:LIBS +=   -L($$(WINDDK_LIB_WIN7_32B_DIR)) -lws2_32 \
                -L($$(WINDDK_LIB_WIN7_32B_DIR)) -ladvapi32 \
                -L($$(WINDDK_LIB_WIN7_32B_DIR)) -luser32 \
                -L($$(NETSNMP_DIR)/lib/debug) -lnetsnmp \
                -L($$(NETSNMP_DIR)/lib/debug) -lnetsnmpagent \
                -L($$(NETSNMP_DIR)/lib/debug) -lnetsnmpmibs \
                ...

Including some libs using an environment variable, simple. Guess what: for some silly odd reason, the WINDDK import works like a charm. The NET_SNMP doesn't. If anybody out there has even the faintest idea, anything that can bring clarity in this matter, would be highly appreciated !

ED8500
  • 41
  • 1
  • 9
  • Seems like code snippets are a bit messed up, and there's a typo in the first line. This is the first code snippet (win32:LIBS += -L($$(NETSNMP_DIR)) -lnetsnmp -lnetsnmpagent -lnetsnmpmibs) and it fails and I have absolutely no idea why. – ED8500 Nov 26 '13 at 10:54
  • Where are these netsnmp libraries location? Also, what does it mean that they do not work? What exactly is the error message? – László Papp Jan 06 '14 at 15:31
  • The net-snmp libs are located in the default install directory: C:/usr/net-snmp-5.6.2/win32/lib/debug. I use an environment variable NETSNMP_DIR C:/usr/net-snmp-5.6.2/win32/lib/debug. Exactly the same way I did for the WINDDK_LIB_WIN7_32B_DIR C:\WinDDK\7600.16385.1\lib\win7\i386 to include the -lws2_32 -ladvapi32 -luser32 libs. Result is linker says : error: LNK1104: cannot open file 'netsnmp.lib'. Changing the order of the libs, doesn't matter. Error stays. – ED8500 Jan 07 '14 at 10:01

0 Answers0