我正在使用autotools来构建我的C++应用程序.在我的configure.ac中,我有以下行:
AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"])
Run Code Online (Sandbox Code Playgroud)
执行./configure(运行autoreconf -i之后)会导致以下错误:
./configure: line 3825: syntax error near unexpected token `-Wall,'
./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")'
Run Code Online (Sandbox Code Playgroud)
我的系统:Linux web 3.2.0-4-amd64#1 SMP Debian 3.2.65-1 + deb7u2 x86_64 GNU/Linux
在我的Ubuntu机器上运行良好,为什么我会收到此错误?
我写了以下方法:
public T CreatePackage<T>() where T : new()
{
var package = new T();
if (typeof(ComponentInformationPackage) == typeof(T))
{
var compInfoPackage = package as ComponentInformationPackage;
// ...
return compInfoPackage;
}
throw new System.NotImplementedException();
}
Run Code Online (Sandbox Code Playgroud)
我检查T是什么类型,根据这个我对待我的变量包.当我想要返回它时,我得到编译器错误.
" ComponentInformationPackage类型不能隐式转换为T"
我怎么解决这个问题?