سؤال

I am trying to configure NTL library in my first Visual Studio 2010 project. I am following the instructions from: http://www.shoup.net/ntl/doc/tour-win.html

I created a new Win32 project, named ntl.

Then, from Project -> Add Existing Items and selected all the files in the src file NTL library folder.

Then, I clicked in Project -> Properties -> Configuration Properties -> C/C++ -> Additional Include Directories and I selected the include directory in the NTL library folder.

Finally, I tried to Build-> Build ntl but I am getting error says (for every file in the src):

c:\program files\winntl-5_5_2\src\ctools.cpp(2): fatal error C1083: Cannot open include file: 'NTL/ctools.h': No such file or directory
1>  Generating Code...
هل كانت مفيدة؟

المحلول

Simple, follow this help step by step Compiling NTL.

You must be doing something wrong, follow the instructions step by step it will work.
Save NTL in a path like it : C:\Library\WinNTL-5_5_2, and follow instructions of site.

نصائح أخرى

you probably don't need the answer for this question, but maybe for others who want to do it.

In Visual Studio (2010):

  1. 'File' -> 'New' -> 'Project...' (or Ctrl + Shift + N)
  2. Choose 'Win32 Project' (located under 'Installed Templates' -> 'Visual C++'), I named it NTLlib, click 'Ok'
  3. Click 'Next >', Application type: 'Static library', in Additional options: uncheck 'Precompiled header', click 'Finish'
  4. Right-click on created project in Solution Explorer 'Add' -> 'New Item...', (or Ctrl + Shift + A) choose C++ File (.cpp) name it and click 'Add' (it is necessary to set the C/C++ settings)
  5. Download the latest NTL library, extract it in your project
  6. Right-click on your project go to Properties (or Alt + Enter) in 'Configuration Properties' -> 'C/C++', click on 'Additional Include Directories' from Dropdown menu choose edit -> 'New Line' (yellow Folder) -> set path to the downloaded NTL library include folder (no folder in include folder), click 'OK'
  7. Right-click on your project in Solution Explorer 'Add' -> 'Existing item...' (or Shift + Alt + a), and select all files from downloaded NTL library in src directory click 'Add'
  8. After loading all files at bottom left print VS ready, now click 'Build' -> 'Build NTLlib' and wait for 'Build: 1 succeeded'. Static library is created in Debug/Release folder.

For using the created library in another project just follow step 6., and set path to the created library folder: Right-Click on project -> 'Properties' -> 'Configuration Properties' -> 'VC++ Directories' -> 'Library Directories'/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top