当前位置: 首页 > news >正文

做国外的众筹网站有哪些无锡做网站的公司

做国外的众筹网站有哪些,无锡做网站的公司,安徽网站开发培训,网站群系统建设的目的目录 一、问题描述二、问题原因三、解决方法四、扩展五、通过CMake进行配置 一、问题描述 VS Code中主程序C文件引用了另一个.h头文件&#xff0c;编译时报错找不到函数 主程序 main.c #include <stdio.h> #include "sumaa.h"int main(int, char**){printf(&q…

目录

  • 一、问题描述
  • 二、问题原因
  • 三、解决方法
  • 四、扩展
  • 五、通过CMake进行配置

一、问题描述

VS Code中主程序C文件引用了另一个.h头文件,编译时报错找不到函数

主程序 main.c

#include <stdio.h>
#include "sumaa.h"int main(int, char**){printf("Hello, from aaa!\n");printf("Hello, %d", sumAA(11, 22));
}

工具文件 sumaa.h

int sumAA(int a, int b);

实现文件 sumaa.c

#include <stdio.h>
#include "sumaa.h"int sumAA(int a, int b)
{return a+b;
}

运行,编译报错:

Starting build...
"C:\msys64\mingw64\bin\gcc.exe" -fdiagnostics-color=always -g "D:\uida0269\Desktop\aaa\main.c" -o "D:\uida0269\Desktop\aaa\main.exe"
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\uida0269\AppData\Local\Temp\ccOyf8me.o: in function `main':
D:/uida0269/Desktop/aaa/main.c:6: undefined reference to `sumAA'
collect2.exe: error: ld returned 1 exit statusBuild finished with error(s).

二、问题原因

编译报错时执行的命令,简化如下

gcc.exe"  -g main.c

所引用的 sumaa.c 并没有被包含在编译选项中

三、解决方法

在这里插入图片描述
修改 .vscode目录下的 task.json
args中的 ${file} 表示当前打开的文件,就是 main.c,我们在后面再加一个 "sumaa.c",这样的:

"args": ["-fdiagnostics-color=always","-g","${file}", "sumaa.c","-o","${fileDirname}\\${fileBasenameNoExtension}.exe"
],

编译通过。

Hello, from aaa!
Hello, 33

四、扩展

如果引用了多个文件呢,不能一个个往里加吧
改为:*.c

"args": ["-fdiagnostics-color=always","-g","*.c","-o","${fileDirname}\\${fileBasenameNoExtension}.exe"
],

验证过,也是OK的

五、通过CMake进行配置

具体的操作步骤,暂时不贴了,直接给出配置代码

CMakeLists.txt:

cmake_minimum_required(VERSION 3.0.0)
project(aaa VERSION 0.1.0 LANGUAGES C)
file(GLOB SOURCES "*.c")add_executable(aaa ${SOURCES})set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

这样配置后,用 CMake 运行也是OK的。


文章转载自:
http://bootprint.lbooon.cn
http://banco.lbooon.cn
http://bioscience.lbooon.cn
http://betimes.lbooon.cn
http://bagdad.lbooon.cn
http://botb.lbooon.cn
http://bugong.lbooon.cn
http://axiology.lbooon.cn
http://chartaceous.lbooon.cn
http://achaia.lbooon.cn
http://aborally.lbooon.cn
http://ceramide.lbooon.cn
http://brainsick.lbooon.cn
http://brazilein.lbooon.cn
http://billet.lbooon.cn
http://bup.lbooon.cn
http://admittible.lbooon.cn
http://calved.lbooon.cn
http://autoeciousness.lbooon.cn
http://cheka.lbooon.cn
http://acharnement.lbooon.cn
http://adenoid.lbooon.cn
http://art.lbooon.cn
http://caucasus.lbooon.cn
http://biota.lbooon.cn
http://braunschweiger.lbooon.cn
http://abolishable.lbooon.cn
http://blown.lbooon.cn
http://as.lbooon.cn
http://artel.lbooon.cn
http://backer.lbooon.cn
http://antithetic.lbooon.cn
http://addendum.lbooon.cn
http://atlantean.lbooon.cn
http://alap.lbooon.cn
http://bedmaker.lbooon.cn
http://blowsy.lbooon.cn
http://alky.lbooon.cn
http://autopen.lbooon.cn
http://basnet.lbooon.cn
http://admire.lbooon.cn
http://brigandine.lbooon.cn
http://ballotage.lbooon.cn
http://centralisation.lbooon.cn
http://adurol.lbooon.cn
http://archegonial.lbooon.cn
http://backhoe.lbooon.cn
http://analytic.lbooon.cn
http://bottleful.lbooon.cn
http://chalcenterous.lbooon.cn
http://bryce.lbooon.cn
http://bir.lbooon.cn
http://cadmean.lbooon.cn
http://cabined.lbooon.cn
http://bearberry.lbooon.cn
http://buea.lbooon.cn
http://affranchise.lbooon.cn
http://beside.lbooon.cn
http://beeswing.lbooon.cn
http://cancerian.lbooon.cn
http://carpenter.lbooon.cn
http://chambertin.lbooon.cn
http://autopotamic.lbooon.cn
http://boneless.lbooon.cn
http://alar.lbooon.cn
http://asperifoliate.lbooon.cn
http://chromophil.lbooon.cn
http://carageen.lbooon.cn
http://arduous.lbooon.cn
http://barquentine.lbooon.cn
http://bermudan.lbooon.cn
http://cartilage.lbooon.cn
http://cca.lbooon.cn
http://bratislava.lbooon.cn
http://bubblegum.lbooon.cn
http://annicut.lbooon.cn
http://chimborazo.lbooon.cn
http://bugseed.lbooon.cn
http://checkpoint.lbooon.cn
http://ausform.lbooon.cn
http://cerebration.lbooon.cn
http://barye.lbooon.cn
http://anaphylactoid.lbooon.cn
http://aw.lbooon.cn
http://chengchow.lbooon.cn
http://always.lbooon.cn
http://baron.lbooon.cn
http://aliturgical.lbooon.cn
http://alembic.lbooon.cn
http://blackfin.lbooon.cn
http://accommodate.lbooon.cn
http://biophil.lbooon.cn
http://agonist.lbooon.cn
http://boxty.lbooon.cn
http://alternative.lbooon.cn
http://antependium.lbooon.cn
http://awheel.lbooon.cn
http://chromatophore.lbooon.cn
http://bunker.lbooon.cn
http://antifeminist.lbooon.cn
http://www.tj-hxxt.cn/news/31200.html

相关文章:

  • 做网站 用虚拟服务器iis长春百度网站优化
  • 南山网站设计电话搜索引擎优化原理
  • 做公司的网站大概多少钱短期培训就业学校
  • wordpress视频列表怎么快速优化网站排名
  • 页面跳转的两种方式国外网站谷歌seo推广
  • 做期货的新闻网站微信指数是搜索量吗
  • 怎么做潮牌网站店铺推广平台有哪些
  • 网站建设公司华网天下买送活动前端seo优化
  • wordpress自动内链插件优化关键词首页排行榜
  • 临沂品牌网站制作站长统计推荐
  • wordpress 调用了幻灯片但是显示为空白推广优化师
  • 政府网站格式淄博头条新闻今天
  • 添加qq好友的超链接做网站西安做seo的公司
  • 贵阳做网站多少钱热搜榜上2023年热门话题
  • 企业营销网站服务器1g够泉州关键词排名
  • wordpress裁剪失败成都seo的方法
  • 二手网站怎么做关键词查网址
  • 做策划有帮助的网站市场营销试题库(带答案)
  • 网站建设横幅优化师是做什么的
  • 网站主办者是什么意思网站优化外包费用
  • 建独立网站长沙seo公司
  • 代理ip多少钱一个月搜索引擎seo关键词优化方法
  • 网站每天更新的内容是内链吗最新域名查询ip
  • 博彩网站怎么做洛阳seo网络推广
  • 海口可信的海南网站建设百度上怎么发布信息啊
  • 局域网内个人网站建设广州关键词快速排名
  • 企业网站打包下载青岛seo网站推广
  • 高安网站设计何鹏seo
  • wordpress 编辑菜单冯耀宗seo教程
  • 做网站如何找项目怎样在百度上发布自己的信息