I am trying to incorporate Root libraries in a C++ software under XP with VC++ express 2008.
I get the following error message when building. I have added “/FIw32pragma.h” as an option in the Makefile.
This error is caused because “/FIw32pragma.h” it’s not an option for VC++.
To compile correctly this application you must have to:
open Options->Projects and Solutions->Directory VC++ and add:
a) the root’s bin location in the first list
b) the root’s include directory in include files (combobox in the right)
c) the root’s lib directory in lib files.
Create a win32 console application, open the project options (configuration Release) and in the Linker->Input add manually in the first line the name of all root’s libraries that you will use. (you can add all)
include in the first line of main.cpp #include “w32pragma.h” or if you want you can add all root’s includes in the stdafx.h but w32pragma.h must be the first.
Thank you for your answer. I understand most of it but don’t know how to enter the libraries in the Linker. Sounds a bit silly but I have never used VC++ before.
To include the libraries you must open the project options, click in the Linker->Input tab. Click in the first line (additional dependencies) and paste it:
C:\root\lib\libASImage.lib
C:\root\lib\libASImageGui.lib
C:\root\lib\libCint.lib
C:\root\lib\libCore.lib
C:\root\lib\libMathCore.lib
C:\root\lib\libEG.lib
C:\root\lib\libEGPythia6.lib
C:\root\lib\libGed.lib
C:\root\lib\libGeom.lib
C:\root\lib\libGeomPainter.lib
C:\root\lib\libGpad.lib
C:\root\lib\libGraf.lib
C:\root\lib\libGraf3d.lib
C:\root\lib\libGui.lib
C:\root\lib\libHist.lib
C:\root\lib\libHistPainter.lib
C:\root\lib\libHtml.lib
C:\root\lib\libPhysics.lib
C:\root\lib\libPostscript.lib
C:\root\lib\libRGL.lib
C:\root\lib\libRint.lib
C:\root\lib\libTree.lib
C:\root\lib\libTreePlayer.lib
C:\root\lib\libTreeViewer.lib
Now you have all root’s libs in you project!
In attachment there is an example configured correctly (if root is installed in C:\root)