locked
C++, 3rd party libraries work in one project, but not in another. RRS feed

  • Question

  • Hello, I come from an Eclipse/Intelli-J (Java) background, so I find Visual Studio for C++ a bit overwhelming ( 2015 Community, 64-bit on Windows 8.1 and 10).

    I was given a "Hello World" project (fully with *.sln file) that requires NLib.lib and NMTLib.lib from Solid Modelling Solutions (NURBS). I got it working fine on any number of computers by ensuring the correct path to those libraries in the project properties (Linker and C/C++ sections).
    ... it's more than a Hello World, it does real computations, but the code is little more than a delegation to the libraries - really nothing extravagant ...

    Now, I need to integrate this into a QT GUI environment. No problem, right? QT provides excellent plugins for Visual Studio 2015. I have another project with a reasonably elaborate Graphical User Interface already designed: it's working fine in Visual Studio.

    Here's the catch:

    - I can take my existing QT GUI project (or create a new one in VS 2015), link the *.lib files, insert all the #include <...>  statements from the Hello World project and all builds fine and also runs fine.

    - As soon as I insert C++ code that actually makes use of the included headers, the build gives me LNK2019, LNK2001 and LNK1120 errors: unresolved symbols.

    - Compiling the solution (Ctrl-F7) is very happy: it's building the solution that complains of unresolved dependencies

    - No problem with the SAME CODE in the Hello World example.

    What gives?

    I verified that the project properties are the same, no good.

    Can anyone point me in the right direction?
    Frustrated but thankful for your help!




    • Edited by RingAndReed Saturday, May 13, 2017 4:50 PM
    • Moved by 宝宝徐 Tuesday, May 16, 2017 5:27 AM
    Saturday, May 13, 2017 4:41 PM

All replies

  • Hi,

    This forum is discussing Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. Qt Visual Studio Tools is not supported by us, I recommend you could ask question in QT forum: https://forum.qt.io/category/4/qt-development

    Best regards,

    Joyce


    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, May 15, 2017 5:46 AM