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):
'File' -> 'New' -> 'Project...' (or Ctrl + Shift + N)
Choose 'Win32 Project' (located under 'Installed Templates' -> 'Visual C++'), I named it NTLlib, click 'Ok'
Click 'Next >', Application type: 'Static library', in Additional options: uncheck 'Precompiled header', click 'Finish'
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)
Download the latest NTL library, extract it in your project
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'
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'
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'/
Related
I have created my framework that i want to add in my project. What i do is:
In my project i chose Xcode -> File -> Add Files to..
In prompt window i go for framework directory, chose .xcodeproj file
Check "Copy items if needed" and "Added folders - Create groups" radio button
What i expect - .xcodeproj that contain my framework is added and copied to my project
What i got - i can see file in Xcode, but not in folder when my app exist. So, when i try to Delete -> Move to trash my framework, it delete it in folder when it was created (not my project folder).
I can't figure out how to actually add and copy file instead of reference to it.
I added a file "IntegerArray.txt" as follows, first I went to File -> Add file to "project name", I selected my file and it was copied into the root folder of my project, the same one that contains the .xcodeproj file. Then I clicked on my project's .xcodeproj file in Xcode, after which I went to Build Phases -> Copy Files -> "IntegerArray.txt", however when I build my project, the following code doesn't work
let bundle = NSBundle.mainBundle()
let path = bundle.pathForResource("IntegerArray", ofType: "txt")
println(path)
I expect to see the path to the file as output, but instead I see nil.
So I want to copy a file to my project in such a way that the above code works. How can I do this?
If I have a normal Cocoa Application, then when I add files they are automatically copied to the built program's bundle. However, with Command Line Tool's this doesn't seem to be the case, I'm starting to suspect a bug with Xcode.
If you don't have a Resources directory in your project, select your project:
Then from the File Menu select Add Files:
In the window that opens click on the "New Folder" button in the lower left hand corner of the window.
A small pop-up window will open; type Resources in that window for the folder name then click the "Create" button. You should now have a Resources folder in your project.
Then the way I do it is to use Finder to copy the file into the Resources Directory of my project.
After the file is in the Resources Directory (in Finder), back in Xcode select the Resources directory in your project:
and use the File-> Add Files menu selection again. You should see your file highlighted (affineOutput.txt in this case):
Double Click on it and it will become part of the bundle.
As Milliways says, then check the Build Phases in your project to be sure the file is in the Copy Bundle Resources. If it's somewhere else, just drag it into the Copy Bundle Resources.
If you include in the Resources Folder it should be included.
You may need to select the Project and Target.
In Build Phases check is there is entry under Copy Bundle Resources
I am writing a simple program and trying to include this file in my code #include <cutil_inline.h> but I am getting an error..
fatal error C1083: Cannot open include file: 'cutil_inline.h': No such file or directory
I have tried this but still getting the error
Error:
fatal error C1083: Cannot open include file: 'cutil_inline.h': No such file or directory
Solution:
1- right-click on project name in solution explorer window
2- Click "Properties"
3- in left window Click Configuration Properties -> Linker
4- set the value of "Additional Library Directories" to
"$(CUDA_PATH)/lib/$(PlatformName)";"$(NVSDKCOMPUTE_ROOT)/C/common/lib"
5- Right-click on your .cu file
6- Click Properties
7- Click on Cuda Runtime API
8- Set Additional Include Directories to :
$(CUDA_PATH)/include;./;$(NVSDKCOMPUTE_ROOT)/C/common/inc;$(NVSDKCOMPUTE_ROOT)/shared/inc
Can anybody help me out here. ?
Note you are missing a header, not a library. Making changes in Additional Library Directories will not help you.
Find the path cutil_inline.h is in. Make sure your SDK version includes it; if it doesn't, see if your code can do without it. Also note that according to the comment from #talonmies, the cutil package doesn't exist in CUDA 5.
Put the path into Configuration Properties -> C/C++ -> General -> Additional Include Directories.
For me it's under $(NVSDKCUDA_ROOT)\common\inc, but your mileage may vary.
I as using visual studio 2010. My solution is having more than one projects in it which are have relationships to each. When I adding a reference to a other project I can use public components (classes,enums ) of that. But when I compile it it gives error saying that those classes are not referenced(Not available).
But when I change the folder structure(When I reduce the level of folder hierarchy/when project folders borings to the root folder ex: d:\ ) it works fine.
Is it because of the length of the folder hierarchi ?
Check your namespaces
When you're adding reference, add it using Project References. So what it does is it compiles the dependencies first. Check if all projects are compiling individually.
Verify target framework versions
No, it is not because of folder hierarchy.... it is because not setting hierarchy properly !!
Follow this steps:
Lets say you have project A and project B.
Project A is dependent on Project B. So we need to add dependency of Project B to Project A.
So right click on Project A -> Open Folder in File Explorer.
Then check which folder it opens into (Lets call it "source folder") and check where the project files whose dependency to be added (Lets call it "destination folder") are located from that folder location. Add the relative path from source to destination folder. (Ex: "..\..\destination folder" ).
Add this relative path in Project A Properties -> Configuration Properties -> C/C++ ->Additional Include Directories.
Good luck.
Yes, hangar18 has suggested correctly. Add reference of each project (Static Libraries) to you execuatble project ( Console Application Project / Startup project).
Also add path of each folder where the header files and corresponding C/C++ files are residing.
I want to change the build system path for building my VC++ project in VS2005.
When I try to build the project, I'm getting an error that a specified header file cannot be opened. I have that header file in "Microsoft SDKs\Windows\v7.0\Include".
But the path present in 'Build system path' is "Microsoft SDKs\Windows\v7.0\Include" which i found in the Error dialog box when i tried to open that header file through the code.
So I want to change the path in build system path to "Microsoft SDKs\Windows\v7.0\Include".
How can i do this.? How to open Build system paths in VS2005.?
You can add include directives rather than change the build system path. Right click the project in Solution Explorer | properties
C/C++ | General
Select 'Additional include directives'
Here browse to the location of where you include files are.