Skip to content
Advertisement

Tag: makefile

makefile linking does not work (although no error message)

I am having issue with Makefile that I produced. It consists of one .cpp file with main() inside and I want to create executable from it. While putting in terminal make command I get following: While putting first make STutorial.o (.o created) and then make get this: Firstly, why make does not go from the beginning? Secondly, why this reference

Using makefile, LD_PRELOAD to executable file

I have two files, “abc.c” and “run” and I want to make a executable binary file which perform below two intstructions I tried to use makefile in linux, but failed. Can I use makefile to make executable binary file ? Answer Ideally, makefile should be used for compilation. For automating the shell commands, you can use a shell script. Maybe,

Using a pipe (or) in sed

From a variable $(JS_SOURCES) containing something like make writes a file containing mod1,othermodule. It works with this code: And my question is Why can’t I replace the 3 expressions with one using pipes ? The shorter sed command doesn’t trim the string (the purpose of two of the expressions). Why doesn’t it work ? How to fix that (without resorting

Multiple instances of main method in C

I’ve got an issue with an assignment, but I’m not asking for help to do the assignment, just single problem. My code is like this: Here’s the problem: When I do the make command from the directory, I get the error What does this error mean? I only defined the main method one time in my own file Answer The

Make is unable to find the functions

I am trying to compile a C program, while linking the APR library. I am getting the following error message: cc -g -Wall -pthread -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-util-1 -L/usr/local/apr/lib -L .aprutil-1 -L .apr-1 devpkg.c bstrlib.o db.o shell.o commands.o -o devpkg /tmp/cczC53x5.o: In function `main’: /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:14: undefined reference to `apr_pool_initialize’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:15: undefined reference to `apr_pool_create_ex’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:29: undefined reference to `apr_getopt_init’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:31: undefined reference

How does kbuild actually work?

When i’m developing a linux driver, i’ve read about how to write linux kbuild makefile through this document I know kbuild system use makefile variables such as obj-y obj-m to determine what to build and how to build. But what i’m confused about is where does kbuild system really execute build process.In a word, if i have obj-m = a.o,

What does `OBJECTS = $(SOURCES:.cpp=.o)` mean in a makefile

I am going over this tutorial and it has something like this I am not sure if I understand the document and would appreciate it if someone could explain the last two statements. Here are my three questions regarding Makefile Question 1 : Whats the difference between and It says that the second case only works if .cpp files exist

Make’s output, the number in the brackets

What’s the significance of the number in the square brackets in Make’s output? Is make multi threaded and this is the thread’s number, or is it the level of makefile traversal, or what exactly? It’s larger numbers on my big projects, but on my personal ones (with just a few source files) it’s typically make[1] so I assume it has

Advertisement