用dev连接c ++和mysql的问题

时间:2019-06-20 17:59:41

标签: c++

我尝试将DEV c ++与mysql连接,但它不断显示错误“在C:/ Program Files / MySQL / MySQL Server 8.0 / include / mysql.h中包含的文件中

C:\ Program Files \ MySQL \ MySQL Server 8.0 \ include \ mysql_com.h [错误] mysql / udf_registration_types.h:没有这样的文件或目录“

#include <iostream>
#include <windows.h>
#include <C:/Program Files/MySQL/MySQL Server 8.0/include/mysql.h>

using namespace std;

int main(){

    system("PAUSE");

    return 0; 

}

1 个答案:

答案 0 :(得分:-2)

我对Dev-C ++不熟悉。

在项目属性中,找到选项“包含目录”(在“编译”部分的某个位置,然后添加以下条目:

return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1,mainAxisSpacing: 0.0,crossAxisSpacing: 0),
shrinkWrap: false,
itemCount: map.values.toList().length,
padding: EdgeInsets.all(2.0),
itemBuilder: (BuildContext context, int index) {
  return new Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
      Flexible( child: Card(
    child: new InkWell(
      onTap: () {
        Navigator.push(
          context,
          MaterialPageRoute(builder: (context) => ContactUsPage(map.values.toList()[index]["articleUrl"])),
        );
      },
      child: new Padding(
        padding: const EdgeInsets.all(4.0),
        child:new Column(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
        Flexible(
        child:
            Container(
              alignment: Alignment.topCenter,
              width: double.infinity,
              height: 500,
            child:Image.network(map.values.toList()[index]["imageUrl"],width: double.infinity,height: 300,fit: BoxFit.cover,
              ),
            ),
          fit: FlexFit.loose,
          flex: 7,
            ),

            SizedBox(

            ),
            new Flexible(
                child:Text(map.values.toList()[index]["articleTitle"],textAlign:TextAlign.left,style: TextStyle(fontSize: 18,color: Colors.blue,fontWeight: FontWeight.bold),
                  maxLines: 2,
                ),
              flex: 2,
              fit: FlexFit.loose,
            ),

            SizedBox(
              height: 10,
            ),
            new Flexible(
                child:Text(map.values.toList()[index]["content"],style: TextStyle(fontSize: 15,color: Colors.black54),overflow: TextOverflow.ellipsis,maxLines: 2,),
              flex: 2,
              fit: FlexFit.loose,

            ),
            Flexible(
                child:
                new Row(
                  crossAxisAlignment: CrossAxisAlignment.end,
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: <Widget>[
                    IconButton(icon: Icon(Icons.thumb_up,), onPressed: (){
                      Share.share('check out '+ map.values.toList()[index]["articleUrl"]);}),
                    IconButton(icon: Icon(Icons.comment,), onPressed: (){
                      Share.share('check out '+ map.values.toList()[index]["articleUrl"]);}),
                    IconButton(icon: Icon(Icons.star_border,), onPressed: (){
                      Share.share('check out '+ map.values.toList()[index]["articleUrl"]);}),
                    IconButton(icon: Icon(Icons.share,), onPressed: (){
                      Share.share('check out '+ map.values.toList()[index]["articleUrl"]);}),

                  ],
                ),
              fit: FlexFit.loose,
              flex: 2,
            ),
          ],
        ),

      ),
    ),
  ),
    fit: FlexFit.loose,
      ),
  ]
  );
},
);
} else {
return Center(
child: CircularProgressIndicator()
);
}

}));

在互联网上找到的图片(可能需要使用C:\Program Files\MySQL\MySQL Server 8.0\include 标签):

enter image description here

将您的include语句更改为:

C++ Includes

别忘了添加链接程序的路径和库以链接sql库。