I recently installed PBSadmb
package in R and ran the following command line.
compAD('vonb')
vonb is my file name
I think the compAD
function requires findstr.exe inside to proceed something but gave me errors instead of working.
So I googled to solve this problem and I found the same question on this same topic (although he/she was using the different program)
reading the suggestions in that page, I added a new path "C:\Windows\System32" to the path in environment variables tab in System properties.
But nothing has changed.
Can anyone shed me some light on this problem?
Thank you!
Here's my code.
###PBSadmb user's guide! ###180910
getwd()
setwd("E:/ADMB/PBSadmb_exercise/vonb")
getwd()
#check the gcc and programs for your code!
Sys.getenv()["PATH"]
#load package
require(PBSadmb)
#set the path of the programs (admb, gcc, editor)
setupAD('NewADPaths.txt') #NewADPaths should be in the right directory!
#checkADopts()
convAD('vonb') #convert *.tpl to *.cpp
compAD('vonb') #compile the *.cpp file just created
And these are error messages
> compAD('vonb')
"adcomp.cmd vonb"
'findstr' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable program or batch file.
*** Compile: vonb.cpp
g++ -c -O3 -fpermissive -I. -I"C:\Program Files (x86)\ADMB\include" -I"C:\Program Files (x86)\ADMB\contrib\include" -o vonb.obj vonb.cpp
In file included from C:\Program Files (x86)\ADMB\include/integrate.hpp:35:0,
from C:\Program Files (x86)\ADMB\include/integrate_wrap.hpp:6,
from C:\Program Files (x86)\ADMB\include/df1b2fun.h:101,
from C:\Program Files (x86)\ADMB\include/Vectorize.hpp:11,
from C:\Program Files (x86)\ADMB\include/admodel.h:2937,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp: In function 'void gauss_kronrod::rdqagie(integr_fn, void*, Float*, int*, Float*, Float*, int*, Float*, Float*, int*, int*, Float*, Float*, Float*, Float*, int*, int*)':
C:\Program Files (x86)\ADMB\include/integrate.cpp:261:17: error: expected unqualified-id before '=' token
Float small = 0.0, erro12;
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:584:2: error: 'erro12' was not declared in this scope
erro12 = error1 + error2;
^~~~~~
C:\Program Files (x86)\ADMB\include/integrate.cpp:654:12: error: expected unqualified-id before '=' token
small = .375;
^
In file included from c:\mingw\include\wtypes.h:2:0,
from c:\mingw\include\unknwn.h:15,
from c:\mingw\include\commdlg.h:470,
from c:\mingw\include\windows.h:68,
from C:\Program Files (x86)\ADMB\include/fvar.hpp:8760,
from C:\Program Files (x86)\ADMB\include/admodel.h:59,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp:662:22: error: expected primary-expression before 'char'
if (fabs(b1 - a1) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:662:22: error: expected ')' before 'char'
C:\Program Files (x86)\ADMB\include/integrate.cpp:670:48: error: expected primary-expression before 'char'
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:670:48: error: expected ')' before 'char'
C:\Program Files (x86)\ADMB\include/integrate.cpp:691:45: error: expected primary-expression before 'char'
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:691:45: error: expected ')' before 'char'
In file included from C:\Program Files (x86)\ADMB\include/integrate.hpp:35:0,
from C:\Program Files (x86)\ADMB\include/integrate_wrap.hpp:6,
from C:\Program Files (x86)\ADMB\include/df1b2fun.h:101,
from C:\Program Files (x86)\ADMB\include/Vectorize.hpp:11,
from C:\Program Files (x86)\ADMB\include/admodel.h:2937,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp:731:8: error: expected unqualified-id before '*=' token
small *= .5;
^~
In file included from c:\mingw\include\wtypes.h:2:0,
from c:\mingw\include\unknwn.h:15,
from c:\mingw\include\commdlg.h:470,
from c:\mingw\include\windows.h:68,
from C:\Program Files (x86)\ADMB\include/fvar.hpp:8760,
from C:\Program Files (x86)\ADMB\include/admodel.h:59,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp: In function 'void gauss_kronrod::rdqagse(integr_fn, void*, Float*, Float*, Float*, Float*, int*, Float*, Float*, int*, int*, Float*, Float*, Float*, Float*, int*, int*)':
C:\Program Files (x86)\ADMB\include/integrate.cpp:998:53: error: expected unqualified-id before 'char'
Float correc = 0.0, erlarg = 0.0, ertest = 0.0, small = 0.0;
^
In file included from C:\Program Files (x86)\ADMB\include/integrate.hpp:35:0,
from C:\Program Files (x86)\ADMB\include/integrate_wrap.hpp:6,
from C:\Program Files (x86)\ADMB\include/df1b2fun.h:101,
from C:\Program Files (x86)\ADMB\include/Vectorize.hpp:11,
from C:\Program Files (x86)\ADMB\include/admodel.h:2937,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp:1359:12: error: expected unqualified-id before '=' token
small = fabs(*b - *a) * .375;
^
In file included from c:\mingw\include\wtypes.h:2:0,
from c:\mingw\include\unknwn.h:15,
from c:\mingw\include\commdlg.h:470,
from c:\mingw\include\windows.h:68,
from C:\Program Files (x86)\ADMB\include/fvar.hpp:8760,
from C:\Program Files (x86)\ADMB\include/admodel.h:59,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp:1367:22: error: expected primary-expression before 'char'
if (fabs(b1 - a1) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:1367:22: error: expected ')' before 'char'
C:\Program Files (x86)\ADMB\include/integrate.cpp:1375:48: error: expected primary-expression before 'char'
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:1375:48: error: expected ')' before 'char'
C:\Program Files (x86)\ADMB\include/integrate.cpp:1396:45: error: expected primary-expression before 'char'
if (fabs(blist[maxerr] - alist[maxerr]) > small) {
^
C:\Program Files (x86)\ADMB\include/integrate.cpp:1396:45: error: expected ')' before 'char'
In file included from C:\Program Files (x86)\ADMB\include/integrate.hpp:35:0,
from C:\Program Files (x86)\ADMB\include/integrate_wrap.hpp:6,
from C:\Program Files (x86)\ADMB\include/df1b2fun.h:101,
from C:\Program Files (x86)\ADMB\include/Vectorize.hpp:11,
from C:\Program Files (x86)\ADMB\include/admodel.h:2937,
from vonb.cpp:7:
C:\Program Files (x86)\ADMB\include/integrate.cpp:1435:8: error: expected unqualified-id before '*=' token
small *= .5;
^~
Error: Unable to build vonb.cpp to vonb.obj
Error: Unable to build.
COMSPEC=C:\Windows\system32\cmd.exe.
PATH=C:\Program Files (x86)\ADMB\bin;C:\Program Files (x86)\ADMB\utilities\mingw\bin;C:\Program Files (x86)\ADMB\bin;C:\MinGW\msys\bin;C:\MinGW\bin.
ADMB_HOME: C:\Program Files (x86)\ADMB