include

Error due to #include<graphics.h>

筅森魡賤 提交于 2020-05-06 16:51:47
问题 I am trying to compile a program which includes the graphics.h header file for C. I have added the graphics.h and winbgim.h header files in the include folder and also libbgi.a to lib folder. Just for testing, I made a simple hello world program and included the graphics.h header file. But on compiling I got the following error: In file included from firstc.c:2:0: c:\mingw\bin../lib/gcc/mingw32/4.7.1/../../../../include/graphics.h:30:59: fatal error: sstream: No such file or directory

How to correctly load a PHP file in another PHP file?

醉酒当歌 提交于 2020-04-30 07:50:40
问题 I have trouble to find a way to load a php file correctly in another php file when the php file is included in another php file with include () and required_once(). I found that if Afile.php uses url such as ../controller/mycontroller.php to include another php file in it, when Afile.php in been included in Bfile.php which is located in a different dir, the ../ will lead the Afile.php's url to a different dir that is based on Bfile.php. I tried to use these PHP string to specify a file's url

including header files from different directories?

我只是一个虾纸丫 提交于 2020-04-29 10:37:30
问题 I am working on a project and I keep getting stumped on how I am supposed to import files from a different directory. Here is how some of my files are organized: -stdafx.h -core/ -->renderer.cpp -shapes/ -->sphere.h -->sphere.cpp how can i access the stdafx.h and shapes/sphere.h from the core/renderer.cpp ? 回答1: There are many ways. You can #include "../stdafx.h" , for instance. More common is to add the root of your project to the include path and use #include "shapes/sphere.h" . Or have a

在VS中配置并测试opencv

佐手、 提交于 2020-04-08 07:31:22
  什么是opencv?   opencv是一个计算机视觉库。它目前有两个分支2.4.X和3.X,2.4.X版本是经典版本,网上的教程资源大多是关于它的,所以推荐使用2.4.X。   它能帮我做什么?   这意味着你可以在自己的程序中使用计算机视觉相关功能,但不必关注具体实现。就像你使用电脑,但并不用关注电脑内部的原理。你唯一需要知道的就是如何使用它。   我该如何使用它?   这就是本文的工作^-^ 。      1,下载opencv   首先到opencv官网下载win平台的opencv,解压后你可以看到下面两个文件夹——build和sources,build是官方已经为我们编译好的可以直接使用的,而sources中是opencv的源码,仅供高级玩家尝试。   下载下来后可以大致浏览一下build文件夹下的内容:   粗略一看就看到了熟悉的x86与x64(32位用和64位用),还有vc11和vc12,虽然以前没见过但大致也可以猜出vc11和vc12是指自己的VS中vc版本,我们可以根据自己的系统与vs版本来选择。   2.配置环境变量   程序中的可执行文件,必须添加到系统环境变量PATH中才能被系统识别。这就类似一所房子,你必须登记到你的名下,才能使用它。opencv也是一样,它在某些目录中提供了一些可执行文件,所以我们必须将这个目录添加到系统环境变量中。  

【STM32H7的DSP教程】第7章 ARM DSP源码和库移植方法(IAR8)

浪子不回头ぞ 提交于 2020-04-07 16:42:02
完整版教程下载地址: http://www.armbbs.cn/forum.php?mod=viewthread&tid=94547 第7章 ARM DSP源码和库移植方法(IAR8) 本期教程主要讲解ARM官方DSP源码和库的移植以及一些相关知识的介绍。 7.1 初学者重要提示 7.2 DSP库的下载和说明 7.3 DSP库版本的区别 7.4 DSP库的几个重要的预定义宏含义 7.5 DSP库在IAR上的移植(源码移植方式) 7.6 DSP库在IAR上的移植(库移植方式) 7.7 升级到最新版DSP库方法 7.8 简易DSP库函数验证 7.9 总结 7.1 初学者重要提示 IAR请使用8.30及其以上版本,CMSIS请使用5.6.0及其以上版本。 IAR的工程创建,下载和调试方法,在V7用户手册有详细说明: http://www.armbbs.cn/forum.php?mod=viewthread&tid=93255 。 7.2 DSP库的下载和说明 下面详细的给大家讲解一下官方DSP库的移植。 7.2.1 DSP库的下载 DSP库是包含在CMSIS软件包(Cortex Microcontroller Software Interface Standard)里面,所以下载DSP库也就是下载CMSIS软件包。这里提供三个可以下载的地方: 方式一:STM32CubeH7软件包里面。

线程同步之互斥量

你说的曾经没有我的故事 提交于 2020-04-07 11:53:29
操作系统编程--线程同步问题 生产者和消费者问题 互斥量是最简单的线程同步的方法 互斥量(互斥锁),处于两态之一的变量:解锁和加锁 两个状态可以保证资源访问的串行 操作系统直接提供了互斥量的API 开发者可以直接使用API完成资源的加锁、解锁操作 具体操作 ◆ pthread_mutex_t //用于定义线程互斥锁对象 ◆ pthread_mutex_lock(&mutex) //上锁操作 ◆ pthread_mutex_unlock(&mutex) //开锁操作 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> #include <vector> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int num = 0; void *producer(void*){ int times = 10000000; while(times --){ //不加锁操作则会导致出现共享资源不统一问题 即num 最后不为0 pthread_mutex_lock(&mutex); num += 1; pthread_mutex_unlock(&mutex); } } void *comsumer(void*){ int times =

数据结构实验之栈与队列一:进制转换

独自空忆成欢 提交于 2020-04-07 10:39:04
数据结构实验之栈与队列一:进制转换 Description 输入一个十进制非负整数,将其转换成对应的 R (2 <= R <= 9) 进制数,并输出。 Input 第一行输入需要转换的十进制非负整数; 第二行输入 R。 Output 输出转换所得的 R 进制数。 Sample Input 1279 8 Output 2377 这题考了栈的进栈与出栈,其他的就是进制转换的模板了,由于只有2到9,还是比较简单的。 非线性 #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct node//栈的节点 { int data; struct node *next; }Node; typedef struct stack { Node *base,*top; }Stack; Node *newnode()//开辟一个节点 { Node *t; t = (Node *)malloc(sizeof(Node)); t->next = NULL; return t; } Stack *Newstack()//建立一个新栈 { Stack *t; t = (Stack *)malloc(sizeof(Stack)); t->top = newnode(); t->base = t->top; return t;

凌乱的DSP笔记(4)-继电器

蓝咒 提交于 2020-04-07 10:15:08
1. 继电器介绍 继电器是一种电子控制器件,它具有控制系统(又称输入回路)和被控制系统(又称输出回路),通常应用于自动控制电路中,它实际上是用较小的电流去控制较大电流的一种“自动开关”。故在电路中起着自动调节、安全保护、转换电路等作用。 常闭NC,常开NO,公共端COM。 2. 硬件设计 IN4148保护芯片。 3. 软件设计 3.1 Relay /* * relay.c * * Created on: 2020-4-7 * Author: Administrator */ #include "relay.h" void Relay_Init(void) { EALLOW; SysCtrlRegs.PCLKCR3.bit.GPIOINENCLK = 1;// 开启GPIO时钟 //继电器端口配置 GpioCtrlRegs.GPAMUX1.bit.GPIO15=0; GpioCtrlRegs.GPADIR.bit.GPIO15=1; GpioCtrlRegs.GPAPUD.bit.GPIO15=0; EDIS; GpioDataRegs.GPACLEAR.bit.GPIO15=1; } /* * relay.h * * Created on: 2020-4-7 * Author: Administrator */ #ifndef RELAY_H_ #define RELAY_H_

android中c++层binder简单例子

[亡魂溺海] 提交于 2020-04-07 09:44:05
service #include #include #include #include #include using namespace android; #ifdef LOG_TAG #undef LOG_TAG #endif #define LOG_TAG "testService" class MyService : public BBinder { public: MyService() { mydescriptor = String16("media.hello"); n=0; } virtual ~MyService() {} //This function is used when call Parcel::checkInterface(IBinder*) virtual const String16& getInterfaceDescriptor() const { LOGE("this is enter ==========getInterfaceDescriptor"); return mydescriptor; } protected: void show() { LOGE("this is for test show!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); LOGE("this is for test show!!!!!!!

多进程实现并发服务器(TCP)

浪尽此生 提交于 2020-04-07 07:36:35
前提:基于Linux系统的学习 /*多进程实现并发服务器 父进程任务 1.从未决连接队列中取出请求,建立和客户端的连接,cfd 2.创建子进程 3.close(cfd) 4.负责子进程的收尸工作 子进程的任务 1.close(sfd) 2.子进程负责处理客户端消息 close(sfd) exit(0) */ #include <stdio.h> #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> #include <arpa/inet.h> #include <string.h> #include <signal.h> #include <stdlib.h> //信号自定义函数,来处理回收子进程资源 void doit(){ wait(NULL); return; } int main(){ char buf[128]; char IP[128]; char*msg="hector pro_bf_serv\n"; struct sockaddr_in serv; struct sockaddr_in clie; socklen_t clie_len; signal(SIGCHLD,doit); //创建socket通讯端口,sfd int sfd=socket(AF_INET,SOCK_STREAM,0);