Hey everyone

I have this huge program which comes with different directories like lib, include, test, modules, services etc.
Every directory has a
-Makefile
-Makefile.am
-Makefile.in

The root directory has the following files
-missing
-Makefile
-Makefile.in
-Makefile.am
-configure
-configure.ac

I added two classes with 2 header files and one of the existing classes in that project includes these header files, since he instanciates objects of the new 2 classes I added.
My problem is now that I don't know where in all these files I have to modify something that my 2 classes are compiled and liked correctly. If I run the ./configure + make without any changes in one of those files, it does not create the o files of the new classes, even if I include the header files in one of the existing classes.

I don't know if I am clear, but what I want is to know which files from the above I have to modify in order that the program recompiles again, when I added the header files in the lib directory and the cc files in the lib directory?

Thank you for helping me out in all those make and configure files or for giving me a hint.

Recommended Answers

All 3 Replies

This building tool is "autoconf", which is really bad compared to cmake.. but if you don't have a choice. I have worked a little with this, but not so much. The file you are looking to modify has the name "Makefile.in" in the folder where your additional source code is (along with other source code that is already properly compiled). Open that file, find a place where there is a list of other .cpp files and add your new one there. That's what I did in a similar situation and it worked, but I don't know much more about how to use autoconf.

My suggestion (same as Mike's) is to convert everything to a CMakeLists.txt file. It will take some initial time, but it will make everything MUCH easier.

Thank you guys. I finally found the problem. It was because I forgot to add the shared library information for the linker. But since the project is so big, I totally forgot about that. And the output from the make command was hundreds of lines long, so I did not get it in the first place.

I used the macro PKG_CHECK_MODULES() in the configure.ac file in order to check for the library and get the necessary information for the linker (path etc).
Then I ran autoreconf to rebuild the makefiles.

And thats it ;)

Thank you, it helped me out!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.