Cannot compile using ACLiC, VC++ 2010, Windows 7

Hi,

I have just started working with ROOT for a few days. After reading previous posts, I have managed to fixed the error with “cl.exe” by setting environment variables with VC++ 2010. Unfortunately, the problem with ACLic remains.

Here’s my macro file.

{ gROOT->ProcessLine(".L Qfuncs.cxx+"); gROOT->ProcessLine(".L RLAfuncs.cxx+"); gROOT->ProcessLine(".L ConvoluteRLAQ.C+"); gROOT->ProcessLine("ConvoluteRLAQ(500)"); }

And here’s the result.

[code]Setting environment for using Microsoft Visual Studio 2010 x86 tools.

c:\program files (x86)\microsoft visual studio 10.0\vc\bin>D:\root\bin\thisroot.
bat

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin>root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/25 12 January 2015 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/25 (v5-34-25@v5-34-25, Jan 12 2015, 15:29:06 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x macroRunRLAQ.C
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\RLAfuncs_c
xx.dll
fopen slept for 10 seconds until it succeeeded.
Error opening RLAfuncs_cxx_ACLiC_dict.def: Permission denied
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\ConvoluteR
LAQ_C.dll
fopen slept for 10 seconds until it succeeeded.
Error opening ConvoluteRLAQ_C_ACLiC_dict.def: Permission denied
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Error: Function ConvoluteRLAQ(500) is not defined in current scope (tmpfile)(1)

*** Interpreter error recovered ***
root [1][/code]

What should I do?

Hi,

What kind of file system do you build on - is D: a local drive?

Can you do

gDebug=7 .x macroRunRLAQ.C .! dir
and post the output of everything?

Cheers, Axel.

Hi,

You cannot run from the “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin>” directory. Please start root from a directory you can write in.

Cheers, Bertrand

Hi Bertrand, I’m sorry but do you mean that I should start ROOT with cmd? If I don’t start ROOT within MS VC++, there will be an error about the file “cl.exe”.

Hi Axel, I downloaded the tar file from the website, unzipped that and used MS VC++ Command Prompt to start ROOT (second and third lines). Yes, D: is a local disk in my laptop. I unzipped ROOT tar file on that since there was more space. Here’s the output when I tried your commands. It also said “rootcint.exe has stopped working” twice during the process.

[code]root [3] gDebug=7
(const int)7
root [4] .x macroRunRLAQ.C
Info in : unmodified script has already been compiled and loaded
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\RLAfuncs_c
xx.dll
Info in : echo # > “D:\root\macros\RLAfuncs_cxx.d"
Info in : rmkdepend “-fD:\root\macros\RLAfuncs_cxx.d” -o_cxx.dll “-p/cyg
drive/D\root\macros/” -Y – “-ID:\root/include” -I%ROOTSYS%/include -I"C:\Pr
ogram Files (x86)\Microsoft Visual Studio 10.0\VC\bin…\include” -I"D:\root
/include" -I"D:\root\macros" -I"C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin" -D_WIN32 -DLL – “D:\root\macros\RLAfuncs.cxx” “-t/cygdrive/D\r
oot\macros\RLAfuncs_cxx.dll” > D:\root\macros\stderr.tmp 2>&1
Info in : echo /cygdrive/D\root\macros\RLAfuncs_cxx.dll: /cygdrive/D\root
\include\cintdictversion.h /cygdrive/D\root\include\RVersion.h >> “D:\root\macr
os\RLAfuncs_cxx.d"
Info in TWinNTSystem::ACLiC: looking for header in: D:\root\macros:C:\Program
Files (x86)\Microsoft Visual Studio 10.0\VC\bin:.::%ROOTSYS%/include:”…/…/incl
ude":“D:\root/include”:
Info in : creating the dictionary files
Info in : D:\root\bin\rootcint “–lib-list-prefix=D:\root\macros\RLAfuncs
cxx_ACLiC_map" -f “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.cxx” -c -p -I%ROOTSYS
%/include -I"…/…/include" -I"D:\root/include" -D__ACLIC
_ -DR__ACLIC_ROOTMA
P “D:\root\macros\RLAfuncs.cxx” “D:\root\macros\RLAfuncs_cxx_ACLiC_linkdef.h"
fopen slept for 10 seconds until it succeeeded.
Error opening RLAfuncs_cxx_ACLiC_dict.def: Permission denied
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in : cl -Z7 -nologo -TP -c -nologo -IC:/Users/bellenot/root_build/so
urce/root_v5.34.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3
-wd4244 -D_WIN32 /MP -I%ROOTSYS%/include -I"C:\Program Files (x86)\Microsoft
Visual Studio 10.0\VC\bin…\include” -I"D:\root/include” -I"D:\root\macros
" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" D:\root\macro
s\RLAfuncs.cxx -FoD:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj && bindexplib RLAfu
ncs_cxx D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj > D:\root\macros\RLAfuncs_cxx
.def && lib -nologo -MACHINE:IX86 -out:D:\root\macros\RLAfuncs_cxx.lib D:\root\m
acros\RLAfuncs_cxx_ACLiC_dict.obj -def:D:\root\macros\RLAfuncs_cxx.def && link -
nologo D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj -DLL -out:D:\root\macros\RLAfu
ncs_cxx.dll D:\root\macros\RLAfuncs_cxx.exp -LIBPATH:%ROOTSYS%\lib libRint.lib
libCint.lib libCore.lib -LIBPATH:%ROOTSYS% libCint.lib libCore.lib libRint.lib l
ibMathCore.lib libRIO.lib libThread.lib D:\root\macros\Qfuncs_cxx.lib libCore.li
b libCint.lib kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspo
ol.lib && if EXIST “D:\root\macros\RLAfuncs_cxx.dll.manifest” ( mt -nologo -mani
fest “D:\root\macros\RLAfuncs_cxx.dll.manifest” “-outputresource:D:\root\macros
RLAfuncs_cxx.dll
D:\root\bin\rootcint “–lib-list-prefix=D:\root\macros\RLAfuncs_cxx_ACLiC_map” -
f “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.cxx” -c -p -ID:\root/include -I”…/…
/include" -I"D:\root/include" -D__ACLIC__ -DR__ACLIC_ROOTMAP “D:\root\macros
RLAfuncs.cxx” “D:\root\macros\RLAfuncs_cxx_ACLiC_linkdef.h”
" cl -Z7 -nologo -TP -c -nologo -IC:/Users/bellenot/root_build/source/root_v5.34
.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3 -wd4244 -D_WIN3
2 /MP -ID:\root/include -I"C:\Program Files (x86)\Microsoft Visual Studio 10.
0\VC\bin…\include" -I"D:\root/include" -I"D:\root\macros" -I"C:\Program F
iles (x86)\Microsoft Visual Studio 10.0\VC\bin" -D__ACLIC__ “D:\root\macros\RL
Afuncs_cxx_ACLiC_dict.cxx” -Fo"D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj" && bi
ndexplib RLAfuncs_cxx “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj” > “D:\root\ma
cros”\RLAfuncs_cxx.def && lib -nologo -MACHINE:IX86 -out:“D:\root\macros”\RLAfun
cs_cxx.lib “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj” -def:“D:\root\macros”\RL
Afuncs_cxx.def && link -nologo “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.obj” -DLL
-out:“D:\root\macros”\RLAfuncs_cxx.dll “D:\root\macros”\RLAfuncs_cxx.exp -LIBPA
TH:D:\root\lib libRint.lib libCint.lib libCore.lib -LIBPATH:D:\root libCint.lib
libCore.lib libRint.lib libMathCore.lib libRIO.lib libThread.lib D:\root\macros
\Qfuncs_cxx.lib libCore.lib libCint.lib kernel32.lib advapi32.lib user32.lib gdi
32.lib comdlg32.lib winspool.lib && if EXIST “D:\root\macros”\RLAfuncs_cxx.dll.m
anifest" ( mt -nologo -manifest “D:\root\macros”\RLAfuncs_cxx.dll.manifest" “-ou
tputresource:“D:\root\macros”\RLAfuncs_cxx.dll;2” && del “D:\root\macros”\RLAfun
cs_cxx.dll.manifest" ) “
” cl -nologo -TP -Iinclude -I…/include -c -Z7 -nologo -IC:/Users/bellenot/root_
build/source/root_v5.34.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EH
sc- -W3 -wd4244 -D_WIN32 /MP -ID:\root/include -I"C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\bin…\include" -I"D:\root/include" -I"D:\root
macros" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -D__ACL
IC__ “D:\root\macros\RLAfuncs_cxx_ACLiC_dict.cxx” && link -opt:ref “D:\root\mac
ros\RLAfuncs_cxx_ACLiC_dict.obj” libRint.lib libCint.lib libCore.lib -LIBPATH:D:
\root libCint.lib libCore.lib libRint.lib libMathCore.lib libRIO.lib libThread.l
ib D:\root\macros\Qfuncs_cxx.lib advapi32.lib -out:D:\root\macros\RLAfuncs_cxx_A
CLiC_exec && if EXIST “D:\root\macros\RLAfuncs_cxx_ACLiC_exec.exe.manifest” ( m
t -nologo -manifest “D:\root\macros\RLAfuncs_cxx_ACLiC_exec.exe.manifest” “-outp
utresource:D:\root\macros\RLAfuncs_cxx_ACLiC_exec.exe;1” && del “D:\root\macros
RLAfuncs_cxx_ACLiC_exec.exe.manifest” ) “
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\ConvoluteR
LAQ_C.dll
Info in : echo # > “D:\root\macros\ConvoluteRLAQ_C.d"
Info in : rmkdepend “-fD:\root\macros\ConvoluteRLAQ_C.d” -o_C.dll “-p/cy
gdrive/D\root\macros/” -Y – “-ID:\root/include” -I%ROOTSYS%/include -I"C:\P
rogram Files (x86)\Microsoft Visual Studio 10.0\VC\bin…\include” -I"D:\roo
t/include” -I"D:\root\macros" -I"C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin" -D_WIN32 -DLL – “D:\root\macros\ConvoluteRLAQ.C” “-t/cygdrive
/D\root\macros\ConvoluteRLAQ_C.dll” > D:\root\macros\stderr.tmp 2>&1
Info in : echo /cygdrive/D\root\macros\ConvoluteRLAQ_C.dll: /cygdrive/D\r
oot\include\cintdictversion.h /cygdrive/D\root\include\RVersion.h >> “D:\root\m
acros\ConvoluteRLAQ_C.d"
Info in TWinNTSystem::ACLiC: looking for header in: D:\root\macros:C:\Program
Files (x86)\Microsoft Visual Studio 10.0\VC\bin:.::%ROOTSYS%/include:”…/…/incl
ude":“D:\root/include”:
Info in : creating the dictionary files
Info in : D:\root\bin\rootcint “–lib-list-prefix=D:\root\macros\Convolut
eRLAQ_C_ACLiC_map” -f “D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.cxx” -c -p -I%R
OOTSYS%/include -I"…/…/include" -I"D:\root/include" -D__ACLIC__ -DR__ACLIC_
ROOTMAP “D:\root\macros\ConvoluteRLAQ.C” “D:\root\macros\ConvoluteRLAQ_C_ACLiC_
linkdef.h"
fopen slept for 10 seconds until it succeeeded.
Error opening ConvoluteRLAQ_C_ACLiC_dict.def: Permission denied
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in : cl -Z7 -nologo -TP -c -nologo -IC:/Users/bellenot/root_build/so
urce/root_v5.34.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3
-wd4244 -D_WIN32 /MP -I%ROOTSYS%/include -I"C:\Program Files (x86)\Microsoft
Visual Studio 10.0\VC\bin…\include” -I"D:\root/include" -I"D:\root\macros
" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" D:\root\macro
s\ConvoluteRLAQ.C -FoD:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj && bindexplib
ConvoluteRLAQ_C D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj > D:\root\macros
ConvoluteRLAQ_C.def && lib -nologo -MACHINE:IX86 -out:D:\root\macros\ConvoluteRL
AQ_C.lib D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj -def:D:\root\macros\Convo
luteRLAQ_C.def && link -nologo D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj -DL
L -out:D:\root\macros\ConvoluteRLAQ_C.dll D:\root\macros\ConvoluteRLAQ_C.exp -LI
BPATH:%ROOTSYS%\lib libRint.lib libCint.lib libCore.lib -LIBPATH:%ROOTSYS% libC
int.lib libCore.lib libRint.lib libMathCore.lib libRIO.lib libThread.lib D:\root
\macros\Qfuncs_cxx.lib libCore.lib libCint.lib kernel32.lib advapi32.lib user32.
lib gdi32.lib comdlg32.lib winspool.lib && if EXIST “D:\root\macros\ConvoluteRLA
Q_C.dll.manifest” ( mt -nologo -manifest “D:\root\macros\ConvoluteRLAQ_C.dll.man
ifest” “-outputresource:D:\root\macros\ConvoluteRLAQ_C.dll
D:\root\bin\rootcint “–lib-list-prefix=D:\root\macros\ConvoluteRLAQ_C_ACLiC_map
” -f “D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.cxx” -c -p -ID:\root/include -I
”…/…/include" -I"D:\root/include" -D__ACLIC__ -DR__ACLIC_ROOTMAP “D:\root\m
acros\ConvoluteRLAQ.C” “D:\root\macros\ConvoluteRLAQ_C_ACLiC_linkdef.h”
" cl -Z7 -nologo -TP -c -nologo -IC:/Users/bellenot/root_build/source/root_v5.34
.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3 -wd4244 -D_WIN3
2 /MP -ID:\root/include -I"C:\Program Files (x86)\Microsoft Visual Studio 10.
0\VC\bin…\include" -I"D:\root/include" -I"D:\root\macros" -I"C:\Program F
iles (x86)\Microsoft Visual Studio 10.0\VC\bin" -D__ACLIC__ “D:\root\macros\Co
nvoluteRLAQ_C_ACLiC_dict.cxx” -Fo"D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj"
&& bindexplib ConvoluteRLAQ_C “D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj” >
“D:\root\macros”\ConvoluteRLAQ_C.def && lib -nologo -MACHINE:IX86 -out:“D:\root
\macros”\ConvoluteRLAQ_C.lib “D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.obj” -de
f:“D:\root\macros”\ConvoluteRLAQ_C.def && link -nologo “D:\root\macros\Convolute
RLAQ_C_ACLiC_dict.obj” -DLL -out:“D:\root\macros”\ConvoluteRLAQ_C.dll “D:\root\m
acros”\ConvoluteRLAQ_C.exp -LIBPATH:D:\root\lib libRint.lib libCint.lib libCore
.lib -LIBPATH:D:\root libCint.lib libCore.lib libRint.lib libMathCore.lib libRIO
.lib libThread.lib D:\root\macros\Qfuncs_cxx.lib libCore.lib libCint.lib kernel3
2.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib && if EXIST “D
:\root\macros”\ConvoluteRLAQ_C.dll.manifest" ( mt -nologo -manifest “D:\root\mac
ros”\ConvoluteRLAQ_C.dll.manifest" “-outputresource:“D:\root\macros”\ConvoluteRL
AQ_C.dll;2” && del “D:\root\macros”\ConvoluteRLAQ_C.dll.manifest" ) “
” cl -nologo -TP -Iinclude -I…/include -c -Z7 -nologo -IC:/Users/bellenot/root_
build/source/root_v5.34.25/root/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EH
sc- -W3 -wd4244 -D_WIN32 /MP -ID:\root/include -I"C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\bin…\include" -I"D:\root/include" -I"D:\root
macros" -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -D__ACL
IC__ “D:\root\macros\ConvoluteRLAQ_C_ACLiC_dict.cxx” && link -opt:ref “D:\root
macros\ConvoluteRLAQ_C_ACLiC_dict.obj” libRint.lib libCint.lib libCore.lib -LIBP
ATH:D:\root libCint.lib libCore.lib libRint.lib libMathCore.lib libRIO.lib libTh
read.lib D:\root\macros\Qfuncs_cxx.lib advapi32.lib -out:D:\root\macros\Convolut
eRLAQ_C_ACLiC_exec && if EXIST “D:\root\macros\ConvoluteRLAQ_C_ACLiC_exec.exe.m
anifest” ( mt -nologo -manifest “D:\root\macros\ConvoluteRLAQ_C_ACLiC_exec.exe.m
anifest” “-outputresource:D:\root\macros\ConvoluteRLAQ_C_ACLiC_exec.exe;1” && de
l “D:\root\macros\ConvoluteRLAQ_C_ACLiC_exec.exe.manifest” ) "
Error: Function ConvoluteRLAQ(500) is not defined in current scope (tmpfile)(1)

*** Interpreter error recovered ***
root [5] .!dir
Volume in drive C has no label.
Volume Serial Number is 4E9B-502B

Directory of c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin

02/16/2015 11:56 AM .
02/16/2015 11:56 AM …
02/16/2015 11:55 AM 1033
03/19/2010 02:02 PM 164,176 atlprov.dll
03/19/2010 02:02 PM 77,648 bscmake.exe
03/19/2010 02:02 PM 722,240 c1.dll
03/19/2010 02:02 PM 2,436,424 c1xx.dll
03/19/2010 02:02 PM 2,633,536 c2.dll
03/19/2010 02:02 PM 145,728 cl.exe
03/17/2010 11:39 PM 379 cl.exe.config
03/18/2010 01:16 PM 31,048 cvtres.exe
03/19/2010 02:02 PM 14,160 dumpbin.exe
03/19/2010 02:02 PM 14,160 editbin.exe
03/19/2010 02:02 PM 14,152 lib.exe
03/19/2010 02:02 PM 852,296 link.exe
03/17/2010 11:39 PM 377 link.exe.config
03/19/2010 02:02 PM 397,120 ml.exe
03/19/2010 02:02 PM 91,976 nmake.exe
03/19/2010 02:02 PM 16,720 undname.exe
11/15/2009 07:52 PM 4,062 vcvars32.bat
03/19/2010 02:02 PM 36,688 xdcmake.exe
03/17/2010 11:39 PM 373 xdcmake.exe.config
19 File(s) 7,653,263 bytes
3 Dir(s) 38,455,787,520 bytes free
root [6][/code]

Best,Nam

Hi Nam,

[quote=“NamHoNguyen”]Hi Bertrand, I’m sorry but do you mean that I should start ROOT with cmd? If I don’t start ROOT within MS VC++, there will be an error about the file “cl.exe”.[/quote]Well, let me repeat: don’t start root from “c:\program files (x86)\microsoft visual studio 10.0\vc\bin”, where you don’t have write permission. It will never work. You have several options to solve your problem. Here are two of them:
[ul][li]once you started the Visual Studio command prompt, you can go (cd) somewhere else, where you have write permission[/li]
[li]start a regular command prompt, and then set-up the environment variables to be able to use Visual C++, by calling:C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat[/li][/ul]
Cheers, Bertrand.

Hi Bertrand,
I tried the second way and here’s what I got:

C:\Users\DELL>C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat 'C:\Program' is not recognized as an internal or external command, operable program or batch file.

I think the first way works, but there must be something wrong with the codes. It is quite strange because the codes run perfectly fine on my professor’s laptop (on Linux through VMware). Or probably, it is because he installed ROOT manually while all I did to install ROOT was just unzipping the tar file.

[code]Setting environment for using Microsoft Visual Studio 2010 x86 tools.

c:\program files (x86)\microsoft visual studio 10.0\vc\bin>cd C:\Users\Dell

C:\Users\DELL>D:\root\bin\thisroot.bat

C:\Users\DELL>root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/25 12 January 2015 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/25 (v5-34-25@v5-34-25, Jan 12 2015, 15:29:06 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x macroRunRLAQ.C
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\RLAfuncs_c
xx.dll
29208190_cint.cxx
RLAfuncs_cxx_ACLiC_dict.cxx
D:\root\macros\RLAfuncs.cxx(87) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(88) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(89) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(90) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(91) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(91) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(92) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
D:\root\macros\RLAfuncs.cxx(92) : error C2668: ‘sqrt’ : ambiguous call to overlo
aded function
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(58
9): could be 'long double sqrt(long double)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(54
1): or 'float sqrt(float)'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(12
7): or 'double sqrt(double)'
while trying to match the argument list '(int)'
Error in : Compilation failed!
Info in TWinNTSystem::ACLiC: creating shared library D:\root\macros\ConvoluteR
LAQ_C.dll
28416180_cint.cxx
ConvoluteRLAQ_C_ACLiC_dict.cxx
Creating library D:\root\macros\ConvoluteRLAQ_C.lib and object D:\root\macros
\ConvoluteRLAQ_C.exp
ConvoluteRLAQ_C_ACLiC_dict.obj : error LNK2019: unresolved external symbol “doub
le __cdecl RLAfuncs::RLAconv(double,double,double,double,double)” (?RLAconv@RLAf
uncs@@YANNNNNN@Z) referenced in function “double __cdecl Func_1(double *,double
*)” (?Func_1@@YANPAN0@Z)
D:\root\macros\ConvoluteRLAQ_C.dll : fatal error LNK1120: 1 unresolved externals

Error in : Compilation failed!
Error: Function ConvoluteRLAQ(500) is not defined in current scope (tmpfile)(1)

*** Interpreter error recovered ***
root [1][/code]

Can you have a look at that to see if you can help me? Thank you very much!

Best,
Nam

Hi,

[quote=“NamHoNguyen”]I tried the second way and here’s what I got:

C:\Users\DELL>C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat 'C:\Program' is not recognized as an internal or external command, operable program or batch file.[/quote]Well, this way is for the case you started a command prompt which is not the Visual Studio Command Prompt… But ok, just forget about it, since it seems you’re not a Windows user. Let’s use the way which is working for you.

[quote=“NamHoNguyen”]I think the first way works, but there must be something wrong with the codes. It is quite strange because the codes run perfectly fine on my professor’s laptop (on Linux through VMware). Or probably, it is because he installed ROOT manually while all I did to install ROOT was just unzipping the tar file.[/quote]The first question is: Are you sure you downloaded the correct version of ROOT (i.e. root_v5.34.25.win32.vc10.tar.gz or root_v5.34.25.win32.vc10.debug.tar.gz)?
Then, if it is the case, you can simply try to fix your code (at line 87, 88, 89, 90, 91, and 92), as the error message is telling you:

[quote=“NamHoNguyen”]D:\root\macros\RLAfuncs.cxx(87) : error C2668: 'sqrt' : ambiguous call to overloaded function [ ... ][/quote]And if you don’t know how to solve this kind of error, just ask one of your colleagues (and maybe read a book on C++)

Cheers, Bertrand.

Hi Bertrand,

I tried both Release and Debug versions and received identical result. I will look into and try to fix the codes now. Thank you very much for your help!

Best, Nam

Hi Nam,

[quote=“NamHoNguyen”]I tried both Release and Debug versions and received identical result. I will look into and try to fix the codes now. Thank you very much for your help![/quote]The most important here is the version number ( vc10 ) to make sure it matches the version of Visual Studio you are using
And you’re very welcome! :slight_smile:

Cheers, Bertrand.