Home >Database >Mysql Tutorial >mysql-makefile编译不能检测到头文件类中的函数修改

mysql-makefile编译不能检测到头文件类中的函数修改

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:35:021149browse

mysqlc语言makefile

很奇怪的问题,我写了一个测试程序,用makefile进行编译,但如果我在头文件里声明了新的函数,在.cpp文件中定义这个函数,make时会提示我----错误:成员函数‘int mysql_soci_test::sum()’未在类‘mysql_soci_test’中声明--这个错误,但如果我不用makefile编译,用g++直接编译,就不会有问题。
下面是我的g++语句:g++ mysql_soci_test.h mysql_soci_test.cpp mysql_main.cpp -I include/soci -I /usr/include/mysql -L./lib -L /usr/lib64/mysql -lmysqlclient

下面是我的makefile中的语句:
INCLUDES = -I include/soci -I /usr/include/mysql
LIBS = -lmysqlclient -L./lib -L /usr/lib64/mysql
calc: mysql_main.cpp mysql_soci_test.cpp mysql_soci_test.h
g++ -o calc mysql_soci_test.h mysql_main.cpp mysql_soci_test.cpp -I. $(INCLUDES) $(LIBS)
感觉应该是没有问题的,但就是会出错,有哪位高手要是知道还望能告知一下,谢谢,在线等......

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn