我有:
.h
typedef struct {
char *TABLE_NAME;
} FeedEntry_REV_CONTAINER_ENTITY;
FeedEntry_REV_CONTAINER_ENTITY* newFeedEntry_REV_CONTAINER_ENTITY();
定义 .c
FeedEntry_REV_CONTAINER_ENTITY *newFeedEntry_REV_CONTAINER_ENTITY()
{
FeedEntry_REV_CONTAINER_ENTITY *feedEntry_REV_CONTAINER_ENTITY;
feedEntry_REV_CONTAINER_ENTITY = newFeedEntry_REV_CONTAINER_ENTITY();
feedEntry_REV_CONTAINER_ENTITY->TABLE_NAME = "MY_TABLE_NAME";
return feedEntry_REV_CONTAINER_ENTITY;
}
实施
char *szSQL;
/* Create SQL statement */
szSQL = "CREATE TABLE IF NOT EXISTS %s(" \
"id INTEGER PRIMARY KEY AUTOINCREMENT");";
FeedEntry_REV_CONTAINER_ENTITY *feedEntry_REV_CONTAINER_ENTITY;
feedEntry_REV_CONTAINER_ENTITY = newFeedEntry_REV_CONTAINER_ENTITY();
cx = snprintf ( buffer, -1, (szSQL),
feedEntry_REV_CONTAINER_ENTITY->TABLE_NAME );
puts (buffer);
但是,我得到了错误:
***___.c:45: error: undefined reference to `newFeedEntry_REV_CONTAINER_ENTITY'
我错过了什么或做错了什么?
提前谢谢大家。