Hi, rooters:
I want to use Windows ROOT with Visual Studio Now I have installed Windows ROOT and Visual Studio 2008 on Windows XP. In windows I set the environment variables as below:
INCLUDE : C:\root\include; D:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include LIB : C:\root\lib PATH : C:\root\bin ROOTSYS : C:\root And in Visual Studio 2008, I give these configurations: Project Property Pages: C/C++ ->Genernal ->Additional Include Directories : $(ROOTSYS)/include Linker ->Input ->Additional Dependencies : $(ROOTSYS)/lib/*.lib Ant then I write a ROOTProject.cpp file:
#include "stdafx.h"
#include <iostream>
#include "TFile.h"
using namespace std; int main(int argc, char* argv[]) { TFile* fi = new TFile("output.root", "recreate"); fi->Close; delete fi; cout<< "Hello ROOT!"<< endl; return 0; }
1>Compiling... 1>ROOTProject.cpp 1>c:\root\include\tstring.h(455) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf' 1>c:\root\include\tstring.h(458) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf' 1>c:\root\include\tstring.h(473) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf' 1>c:\root\include\tstring.h(479) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf' 1>c:\root\include\tstring.h(482) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'I do not know why there are so many warnings. But after my runnring the ROOTProject.exe, I indeed get a output.root file. I am not very familiar with VS2008, so is there a step-by-step user guide about using ROOT with VS2008 I don't want to use CINT or ACLiC. I just want to use VS2008 to compile the codes with "#include "Txxx.h"" and generate a .exe file to finish my work. Is thers any tutorials about it? Thank you!
-- Best regards, ZhangYiChun Institute of High Energy Physics Yuquan street 19£¬ Shijingshan district, Beijing, China EMail: yczhang_at_ihep.ac.cnReceived on Sun Oct 10 2010 - 09:03:29 CEST
This archive was generated by hypermail 2.2.0 : Mon Oct 11 2010 - 11:50:01 CEST