/Debug/ch376.out' not build
本帖最后由 醉美天下 于 2014-1-8 11:05 编辑28335程序中用到printf函数,但是stdio.h这个文件加不到工程中,http://c.hiphotos.baidu.com/zhidao/pic/item/0824ab18972bd4070f09439b79899e510eb3098d.jpg
错误如下:
undefined first referenced
symbol in file
--------- ----------------
_printf E:\\my project\\ch376\\Debug\\DEBUG.obj
_c_int00 E:\\my project\\ch376\\Debug\\DSP2833x_CodeStartBranch.obj
_sprintf E:\\my project\\ch376\\Debug\\main.obj
_strcpy E:\\my project\\ch376\\Debug\\main.obj
_strlen E:\\my project\\ch376\\Debug\\main.obj
_InitPeripherals E:\\my project\\ch376\\Debug\\main.obj
>> error: symbol referencing errors - './Debug/ch376.out' not built
stdio。h这个文件一直加不到工程里。不知道怎么回事。
是可以使用stdio.h的
如果打印没有效果 加上换行\n试试 你#include<stdio.h>
编译会出错?如果没有就说明添加了
你在#include<stdio.h>上右击open 就可以打开了 zhangjin_comeon 发表于 2014-1-7 19:18 static/image/common/back.gif
你#include
编译会出错?如果没有就说明添加了
你在#include上右击open 就可以打开了 ...
我程序里有include "stdio.h" ,但是编译后工程里没有stdio.h这个文件,所以出现上面截图中的错误 醉美天下 发表于 2014-1-7 20:22 static/image/common/back.gif
我程序里有include "stdio.h" ,但是编译后工程里没有stdio.h这个文件,所以出现上面截图中的错误 ...
截图看不到 你要#include<stdio.h>试试
将""换为<> zhangmangui 发表于 2014-1-7 21:29 static/image/common/back.gif
截图看不到 你要#include试试
将""换为
"C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
<Linking>
>> warning: entry point other than _c_int00 specified
undefined first referenced
symbol in file
--------- ----------------
_printf E:\\my project\\ch376\\Debug\\DEBUG.obj
_c_int00 E:\\my project\\ch376\\Debug\\DSP2833x_CodeStartBranch.obj
_sprintf E:\\my project\\ch376\\Debug\\main.obj
_strcpy E:\\my project\\ch376\\Debug\\main.obj
_strlen E:\\my project\\ch376\\Debug\\main.obj
_InitPeripherals E:\\my project\\ch376\\Debug\\main.obj
>> error: symbol referencing errors - './Debug/ch376.out' not built
>> Compilation failure
Build Complete,
2 Errors, 3 Warnings, 5 Remarks.
就是上面的错误
醉美天下 发表于 2014-1-7 22:01 static/image/common/back.gif
"C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
>> warning: entry point ot ...
我一直都在用 也没有遇到这个问题啊 "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
<Linking>
>> warning: entry point other than _c_int00 specified
这只是个warning,倒还没事!
关键是这个
undefined first referenced
symbol in file
--------- ----------------
_printf E:\\my project\\ch376\\Debug\\DEBUG.obj
_c_int00 E:\\my project\\ch376\\Debug\\DSP2833x_CodeStartBranch.obj
_sprintf E:\\my project\\ch376\\Debug\\main.obj
_strcpy E:\\my project\\ch376\\Debug\\main.obj
_strlen E:\\my project\\ch376\\Debug\\main.obj
_InitPeripherals E:\\my project\\ch376\\Debug\\main.obj
>> error: symbol referencing errors - './Debug/ch376.out' not built
这才是错误! 醉美天下 发表于 2014-1-8 09:10 static/image/common/back.gif
"C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
>> warning: entry point othe ...
你用的汇编吗 警告的意思是找不到程序入口代码运行不了
汇编中这些调用没使过
醉美天下 发表于 2014-1-8 09:10 static/image/common/back.gif
"C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
>> warning: entry point othe ...
如果你自己定义了代码入口就把Autoinit model给位图中所示
code entry处填写你自己的程序入口 警告就没了 嗯,谢谢,现在warning没了就只剩下这个错误了
undefined first referenced
symbol in file
--------- ----------------
_printf E:\\my project\\ch376\\Debug\\DEBUG.obj
_c_int00 E:\\my project\\ch376\\Debug\\DSP2833x_CodeStartBranch.obj
_sprintf E:\\my project\\ch376\\Debug\\main.obj
_strcpy E:\\my project\\ch376\\Debug\\main.obj
_strlen E:\\my project\\ch376\\Debug\\main.obj
_InitPeripherals E:\\my project\\ch376\\Debug\\main.obj
>> error: symbol referencing errors - './Debug/ch376.out' not built
请您指点一下 醉美天下 发表于 2014-1-8 11:52 static/image/common/back.gif
嗯,谢谢,现在warning没了就只剩下这个错误了
undefined first referenced
你是汇编语言吗 ?
要不贴一下你的代码看看 不是汇编啊!
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
#include <stdio.h>
#include "string.h"
#include "CH376INC.H"
#include "DEBUG.H"
#define TRUE 1
//#define NULL 0x0000
#define CMD11_CHECK_EXIST 0x0006
#define ERR_USB_UNKNOWN 0x00FA
#define CMD11_SET_USB_MODE0x0015 //设置USB的工作模式
#define CMD_RET_SUCCESS 0x0051 //命令操作成功
#define USB_INT_SUCCESS 0x0014 //USB事务或者传输操作成功
#define CMD01_GET_STATUS 0x0022
#define CMD0H_DISK_CONNECT0x0030
#define CMD0H_DISK_MOUNT 0x0031
#define CMD01_GET_IC_VER 0x0001
#define CMD10_SET_FILE_NAME 0x002F
#define CMD0H_FILE_OPEN 0x0032 //打开文件或者目录,或者枚举文件或目录
#define VAR_DISK_STATUS 0x002B //主机文件模式下的磁盘及文件状态是系统变量的地址
#define DEF_DISK_READ 0x0010 //已经分析磁盘的文件系统并且能够支持显示主机模式下的磁盘及文件状态
#define CMD11_READ_VAR8 0x000A//读取指定的8位文件系统变量
#define CMD50_WRITE_VAR32 0x000D //设置指定的32位文件系统变量
#define CMD4H_BYTE_LOCATE 0x0039//主机文件模式:以字节为单位移动当前文件指针
#define CMD0H_FILE_CREATE 0x0034 //主机文件模式:新建文件,如果文件已经存在 那么删除
#define VAR_FILE_SIZE 0x0068//当前文件的总长度(总长度32位,低字节在前)
#define CMD14_READ_VAR32 0x000C //读取指定的32位文件系统变量
#define ERR_MISS_FILE 0x0042//指定路径的文件没有找到 可能是文件名称错误
#define CMD2H_BYTE_WRITE 0x003C//主机文件模式:以字节为单位向当前位置写入数据块
#define USB_INT_DISK_WRITE0x001E//USB存储器请求数据写入
#define CMD01_WR_REQ_DATA 0x002D//向内部指定缓冲区写入请求的数据块
#define CMD0H_BYTE_WR_GO 0x003D//主机文件模式:继续字节写
#define VAR_CURRENT_OFFSET0x006C//当前位置的指针,当前文件指针,当前读写位置的字节偏移(总长度32位,低字节在前)
#define CMD1H_FILE_CLOSE 0x0036 //主机模式:关闭当前已经打开的文件或者目录
char buf;
void delay_ms(Uint16 i);
void delay_us(Uint16 j);
void xWriteCH376Cmd(Uint16 mCmd);
void xWriteCH376Data(UINT8 mData);
void mStopIfError(Uint16 iError);
void CH376SetFileName(char *str);
void CH376WriteVar32(Uint16, Uint32 dat);
void CH376_PORT_INIT(void);//CH376通讯接口初始化
//void CH376_DATA_DIR_IN(void);//设置并口方向为输入
void CH376_DATA_DIR_OUT(void); //设置并口方向为输出 向CH376S输出数据或者命令
UINT32CH376GetFileSize(void);
Uint16CH376DiskMount(void);
voidWait376Interrupt(void);
Uint16mInitCH376Host(void);
UINT8xReadCH376Data(void);
Uint16CH376DiskConnect(void);
UINT8Query376Interrupt(void);
voidCH376GetIntStatus(void);
Uint16CH376SendCmdWaitInt(Uint16 mCmd);
Uint16CH376FileOpen(char *name);
voidCH376ReadVar8(Uint16 var);
Uint16CH376ByteLocate(Uint32 offset);//以字节为单位移动当前文件指针
Uint16CH376FileCreate(char *str);//在根目录或者当前目录下新建文件,如果文件已经存在 那么删除
UINT32CH376ReadVar32(UINT8 var);//读CH376芯片内部的32位变量
voidCH376Read32bitDat(void);//从CH376芯片读取32位的数据并结束命令
Uint16CH376ByteWrite(char *buf,Uint16 ReqCount,char *RealCount);//以字节为单位向当前位置写入数据块
voidCH376WriteReqBlock(char *buf);//向内部指定缓冲区写入请求的数据块,返回长度
Uint16CH376FileClose(Uint16 UpdateSz); //关闭当前已经打开的文件或者目录
voidCH376SendCmdDatWaitInt(Uint16 mCmd,Uint16 mDat); //发出命令码和一字节数据后,等待中断
Uint16 add(void);
void main()
{
Uint16 s;
Uint16 hour;
Uint16 adc;
/*初始化系统*/
InitSysCtrl();
/* 关中断 */
DINT;
IER = 0x0000;
IFR = 0x0000;
/*初始化PIE*/
InitPieCtrl();
/* 初始化PIE中断矢量表*/
InitPieVectTable();
/* 初始化外设 */
InitPeripherals();
InitGpio();
EINT;
ERTM;
delay_ms(100);
s=mInitCH376Host();
mStopIfError(s);
while(1)
{
while(CH376DiskConnect() != USB_INT_SUCCESS )//检查U盘是否插入
{
delay_ms(100);
}
delay_ms(200);
/*如果检测到USB设备*/
for(s=0;s<10;s++)
{
delay_ms(50);
if(CH376DiskMount() == USB_INT_SUCCESS)
{
break;//初始化磁盘并测试磁盘是否就绪
}
}
s = CH376FileOpen("/MY_ADC.TXT");
if(s==USB_INT_SUCCESS )//文件存在并且已经被打开,移动文件指针到尾部以便添加数据
{
s = CH376ByteLocate(0xffffffff);//移到文件的尾部
mStopIfError(s);
}
else if (s==ERR_MISS_FILE)//没有找到文件 必须新建文件
{
s=CH376FileCreate( NULL ); //新建文件并打开,如果文件已经存在则先删除后在新建,不必再提供文件名,刚才已经提供给CH376FileOpen
mStopIfError(s);
}
else
{
mStopIfError(s);
}
s=sprintf(buf,"此前文件长度=%ld 字节 \xd\xa",CH376GetFileSize());
s=CH376ByteWrite(buf,s,NULL); //以字节为单位向文件写数据
mStopIfError(s);
for(hour = 8;hour<20;hour++)
{
adc=0;
s=sprintf(buf,"%02d,%02d,%02d ADC=%u\xd\xa",adc);
s=CH376ByteWrite(buf,s,NULL); //以字节为单位向文件写数据
//有些U盘可能会要求在写数据后等待一会儿才能继续操作,所以,如果在某些U盘中发现数据丢失现象,建议在每次写入数据后稍作延时再继续
mStopIfError(s);
printf("Current offset (file point) is %ld\n",CH376ReadVar32(VAR_CURRENT_OFFSET) ); //读取当前文件的指针
}
printf("Write end\n");
strcpy(buf,"今天的ADC数据到此结束\xd\xa");
s=CH376ByteWrite(buf,strlen(buf),NULL); //以字节为单位向文件写数据
mStopIfError(s);
printf("Close\n");
s= CH376FileClose(TRUE); //关闭文件,自动计算文件长度,以字节为单位写文件,建议让程序库关闭文件以便自动更新文件长度
mStopIfError(s);
printf("Take out\n");
while(CH376DiskConnect() == USB_INT_SUCCESS )//检查U盘是否连接,等待U盘拔出
{
delay_ms(100);
}
delay_ms(200);
}
}
void delay_ms(Uint16 i) //延时ms
{
Uint16 n;
Uint16 j;
Uint16 k;
for(n=0;n<i;n++)
for(j=0;j<1000;j++)
for(k=0;k<256;k++);
}
void delay_us(Uint16 j) //延时us
{
Uint16 n;
Uint16 k;
for(n=0;n<j;n++)
for(k=0;k<256;k++);
}
//====================================================================
//no more
//========================================================================
页:
[1]