linux makefile

Hello everyone. I am sorry for posting my problem in the wrong forum. I posted this problem to the UNIX/Linux Programming forum but I think not many people visit that forum.

I am new to creating make files. I have been able to create simple makefiles for those applications which do not involve database but am unable to create for the ones that do involve database. This makefile does not create the executable file liffe_runbreach-64bit and if there is one (generated through the code below) then running the makefile deletes it

[code removed]

That's how my make file looks

[code removed]

There is no error in the code because when I compile the code through the following command, it gives me no error

[code removed]

the error msg is:

[code removed]

Where am I going wrong? Am I not providing the correct mysql path? Could anyone please help me with this.
Last edited on by admin
You need to add the include paths of CFLAGS and the linker paths of LFLAGS.
Thanks kbw

Since I am new to makefiles and linux as well, I have been following some tutorials on the internet and produced this makefile so could you please elaborate your answer?

Many thanks
1
2
CFLAGS = -I/usr/include/mysql++ -I/usr/include/mysql -Wall -c $(DEBUG)
LFLAGS = -L/usr/lib64 -L/usr/lib64/mysql
Thanks kbw

it still is giving me the same mysql errors and is not creating the exe file ;'(
[code removed]
Last edited on by admin
I expect that's because -lmysqlpp was missed off. It should probably go in a seperate macro like LIBS and added that way, rather than adding it to LFLAGS. You'd need to update the liffe_runbreach-64bit target to use it.

There are better ways to write a makefile though.
http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/

Liffe Connect eh? That's interesting.
Last edited on
Topic archived. No new replies allowed.