我安装了JDK并设置了Maven.打电话的mvn -version i get回报:
未正确定义JAVA_HOME环境变量运行此程序需要此环境变量NB:JAVA_HOME应指向JDK而不是JRE
$JAVA_HOME变量C:\Program Files\Java\jdk1.8.0_131\bin在系统变量中设置为.
回调%JAVA_HOME%路径的召唤 C:\Program Files\Java\jdk1.8.0_131\bin.
问题出在哪儿?
我有两个结构体,它们互相指向
\n\nstruct Person{\n string name;\n string born;\n int age;\n Id* p_id;\n};\n\nstruct Id{\n string id_number;\n Person* p_person;\n};\nRun Code Online (Sandbox Code Playgroud)\n\n这些结构存储在两个结构向量中,称为 vec_id 和 vec_person。\n我需要在 vec_person 中查找 Person 的函数,然后删除向量 vec_id 中匹配的 Id。\n我的问题是将 p_id 转换为指针。
\n\n我的代码示例:
\n\nstd::vector<Person*> vec_person;\nstd::vector<Id*> vec_id;\nvector <Person*>::iterator lowerb=std::lower_bound (vec_person.begin(), vec_person.end(), Peter, gt);\n//gt is matching function which is defined elsewhere\n//peter is existing instance of struct Person\n// lowerb is iterator, that works fine.\nvec_id.erase((*lowerb)->p_id);\n//gives error: no matching function for call to \xe2\x80\x98std::vector<Person*>::erase(Person*&)\xe2\x80\x99|\n//if i can convert pointer (*low)->pnumber to iterator, it would be …Run Code Online (Sandbox Code Playgroud) 我想在文件functions.ps1中定义函数,然后从另一个脚本调用它.像这样的东西:
Functions.ps1:
Function Hi()
{
"hi"
}
Run Code Online (Sandbox Code Playgroud)
从另一个脚本(Call.ps1)调用它.
Call.ps1:
invoke-expression -Command .\functions.ps1
Hi
Run Code Online (Sandbox Code Playgroud)
但是函数是在脚本函数的本地范围内定义的.我得到的错误:
The term 'hi' is not recognized as the name of a cmdlet, function,
script file , or operable program. Check the spelling of the name, or
if a path was included, v erify that the path is correct and try
again.
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法来解决这个问题?