Include C++ library in Netbeans 7.0

后端 未结 2 1229
猫巷女王i
猫巷女王i 2021-01-05 18:43

I\'m trying the use this library (RollPlay) in my project but I don\'t know how to include it in my C++ project in Netbeans. Would I just add the .dll and .h files into the

相关标签:
2条回答
  • 2021-01-05 18:50

    In Netbeans 8.2, to include a header file (.h) folder in your IDE, you would do something like this:

    1. On the top menu bar, Select Tools -> Options
    2. Select C/C++ -> Code Assistance tab, Select C++ Compiler Tab, then click 'Add' (Image below shows highlighted folder added after clicking add)

    But this will not be enough, code will not compile. Because some how this option will only remove the error in IDE.

    To remove the error during compilation you need to pass the include folder as parameter to MinGw toolset.

    1. Right click your C++ project and select 'Properties' from the context menu
    2. Select 'General' from the tree on the left, then 'Add' the same folder which you added in the previous steps.

    Now on running you should see the folder added as argument in the following command:

    g++    -c -g -I../../../../../dev/vcpkg/installed/x64-windows/include -MMD .....
    

    I am using MinGw from: nuwen and adding header files from vcpkg. But any MinGw you are using it should not matter, also you can include any libraries/header files' folder this way.

    0 讨论(0)
  • 2021-01-05 18:57

    A library would normally reside in its own installation directory so you would need to point NB to where that is. If you right-click the project name in the "Projects" window, you'll have a Properties option.

    • Select the Build/C++ compiler option to add the directory for the .h files.
    • Select the Build/Linker to add the directory for the dll file.
    0 讨论(0)
提交回复
热议问题