none
Net-SNMP : Unable to build in VC 2017 Version 15 RRS feed

  • Question

  • I have recently download Net-SNMP code from their website and trying to build in VC 2017 - and it fails.

    The extracted folder has win32.dsp and win32dll.dsp - when I try to open in VC IDE I get error like -

    Message

     snmptrapd\snmptrapd.dsp: Unable to convert project. Please make sure this is a valid Visual C++ 6.0 project. 
     snmptrapd\snmptrapd.dsp: Project upgrade failed. 
    
     snmptrapd\snmptrapd.dsp: Converting project file 'C:\tools\netsnmp\net-snmp-5.8\win32\snmptrapd\snmptrapd.dsp'. 
      Hide 1 additional messages  

    Almost for all projects - the build via command line 'nmake' utility also fails with below error -

        cd libagent
        nmake /nologo all
        cl.exe /I.. /I..\..\include /I..\..\agent\mibgroup /D WIN32 /D _BIND_TO_CURRENT_VCLIBS_VERSION /D _CONSOLE /D _CRT_NONSTDC_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _MBCS /D _WINSOCK_DEPRECATED_NO_WARNINGS /EHsc /FD /FR.\release\ /Fd.\release\libagent.pdb /Fo.\release\ /I C:\OpenSSL-Win32\include /c /W3 /Zi /nologo /wd4244 /wd4267 /MD  /D NDEBUG /O2 ..\..\agent\agent_handler.c ..\..\agent\agent_index.c ..\..\agent\agent_read_config.c ..\..\agent\agent_registry.c ..\..\agent\agent_sysORTable.c ..\..\agent\agent_trap.c ..\..\agent\snmp_agent.c ..\..\agent\snmp_vars.c 
    agent_handler.c
    ..\..\agent\agent_handler.c(19): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
    agent_index.c
    ..\..\agent\agent_index.c(12): fatal error C1083: Cannot open include file: 'signal.h': No such file or directory
    agent_read_config.c
    ..\..\agent\agent_read_config.c(16): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
    agent_registry.c
    ..\..\agent\agent_registry.c(32): fatal error C1083: Cannot open include file: 'signal.h': No such file or directory
    agent_sysORTable.c
    ..\..\agent\agent_sysORTable.c(3): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
    agent_trap.c
    ..\..\agent\agent_trap.c(35): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
    snmp_agent.c
    ..\..\agent\snmp_agent.c(50): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
    snmp_vars.c
    ..\..\agent\snmp_vars.c(68): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
    Generating Code...
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\nmake.EXE"' : return code '0x2'
    Stop.

    How can we resolve the issue?

    Thursday, June 6, 2019 10:42 AM

Answers

  • Hi DeveloperProgrammer,

    Sorry for the delay. I've downloaded the project and open it in VS successfully by VS2017 15.9.12. Please make sure you've encountered this page and choose Ok:

     

    For your issue, I think it may have something to do with your VS workloads. Not familiar with Net-SNMP, but this seems not be a typical C++ project.(This project comes from a quite earlier vs version, it's hard to find more info according to its project-file format after upgrading)

    1.So my suggestion is that we can try update the vs to latest 15.9.12. Moreover, we can go Tools menu=>Get Tools and Features to modify the C++ workloads:

    Please make sure you've installed: Desktop development with C++, Universal Windows Platform development , Game development with C++. 

    2.Also, please check if this page helps. 

    3.And as I mentioned above, the conversation works well in my side. But the build fails for many link2019 errors, I think there are some additional files w need to include. But I can't find related info from Net-SNMP web-site. Maybe you can trying contacting the author by mail list.

    Any update please feel free to contact me.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 10, 2019 9:30 AM

All replies

  • Hi friend,

    Welcome to MSDN forum.

    VC++ 6.0 project is too old. Please check this thread to get some info of how to upgrade VC++ 6.0 project successfully. 

    And maybe you can get some help from this thread.

    Any update please feel free to let me know.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 7, 2019 3:40 AM
  • No - it did not solved the issue - also the options mentioned in links provided are not available in VS2017 version 15.8.7

    Please let me know how to resolve the issue

    Friday, June 7, 2019 9:38 AM
  • Hi DeveloperProgrammer,

    Sorry for the delay. I've downloaded the project and open it in VS successfully by VS2017 15.9.12. Please make sure you've encountered this page and choose Ok:

     

    For your issue, I think it may have something to do with your VS workloads. Not familiar with Net-SNMP, but this seems not be a typical C++ project.(This project comes from a quite earlier vs version, it's hard to find more info according to its project-file format after upgrading)

    1.So my suggestion is that we can try update the vs to latest 15.9.12. Moreover, we can go Tools menu=>Get Tools and Features to modify the C++ workloads:

    Please make sure you've installed: Desktop development with C++, Universal Windows Platform development , Game development with C++. 

    2.Also, please check if this page helps. 

    3.And as I mentioned above, the conversation works well in my side. But the build fails for many link2019 errors, I think there are some additional files w need to include. But I can't find related info from Net-SNMP web-site. Maybe you can trying contacting the author by mail list.

    Any update please feel free to contact me.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 10, 2019 9:30 AM
  • Thanks the second option worked perfectly for me. Thanks a lot.

    However I need a small help again - I see the following libs:

    MINGW64 /c/tools/netsnmp/net-snmp-5.8
    $ find . -name "lib*.*"
    ./include/net-snmp/library/libsnmp.h
    ./m4/libtool.m4
    ./python/build/lib.win-amd64-2.7
    ./win32/libagent/libagent.dsp
    ./win32/libagent/libagent.vcxproj
    ./win32/libagent/libagent.vcxproj.filters
    ./win32/libagent/release/libagent.idb
    ./win32/libagent/release/libagent.pdb
    ./win32/libnetsnmptrapd/libnetsnmptrapd.dsp
    ./win32/libnetsnmptrapd/libnetsnmptrapd.vcxproj
    ./win32/libnetsnmptrapd/release/libnetsnmptrapd.idb
    ./win32/libnetsnmptrapd/release/libnetsnmptrapd.pdb
    ./win32/libsnmp/libsnmp.dsp
    ./win32/libsnmp/libsnmp.vcxproj
    ./win32/libsnmp/release/libsnmp.idb
    ./win32/libsnmp/release/libsnmp.pdb
    ./win32/libsnmp_dll/libsnmp.def
    ./win32/libsnmp_dll/libsnmp_dll.dsp
    ./win32/libsnmp_dll/libsnmp_dll.vcxproj

    Now I am trying to write my own C Application as provided here.

    I am new to VC programming but have to use it since we are building tools for Windows OS.

    My issue is that how to create a 'nmake' file so that my code is compiled and linked with required libraries and creates an executable?

    Tuesday, June 11, 2019 10:00 AM
  • Hi friend,

    Glad to know it helps in some aspects. As for nmake file, you could check if this document helps.

    And in MSDN forum, one question for one issue. Since nmake topic is more related to C++, and this is MSBuild forum(talking about loading project, build process with msbuild). I suggest you can open a new thread in MSDN C++ forum. You can get more professional support there.

    And if my reply is helpful to resolve your original issue, you could consider marking it as answer.

    Thanks for your understanding. Have a nice day!

    Sincerely

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 11, 2019 10:13 AM