<!DOCTYPE html>
<html>
<head>
<title>Foo</title>
</head>
<body>
<script>
console.log(typeof document.body !== 'undefined')
</script>
</body>
</html>
和我用来构建该文件的CmakeLists.txt文件是
#include<iostream>
#include<Windows.h>
#include<sqlext.h>
#include<sqltypes.h>
#include<sql.h>
using namespace std;
void showSQLError(unsigned int handleType, const SQLHANDLE& handle)
{
SQLCHAR SQLState[1024];
SQLCHAR message[1024];
if (SQL_SUCCESS == SQLGetDiagRec(handleType, handle, 1, SQLState, NULL, message, 1024, NULL))
{
cout << "SQL driver messge :" << message << "\n SQL State " << SQLState << "." << endl;
}
}
int main()
{
cout << "hdsajhfkadsjhflksad";
return 0;
}
但是我在链接时遇到这个错误。
ADD_EXECUTABLE( cmaketutorial main.cpp )
C:\ Users \ uib02930 \ Documents \ Visual Studio 2015 \ Projects \ cmaketest \ src \ cmaketutorial.exe 1
当我直接使用Visual Studio构建该相同的伪代码时,它运行正常,但使用CmakeLists.txt则无法正常工作。我应该对CmakeLists.txt进行哪些更改才能运行它而不会出现任何错误。