I am trying to build a dynamic library as the subject ilmpies.
I created the project using Introjucer
Execulting the resulting Makefile (using g++ 4.8), it fails in the linking stage with following error message:
/usr/lib/gcc/i586-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
/build/glibc-6hJbOt/glibc-2.19/csu/../sysdeps/i386/start.S:111: undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:69: recipe for target 'build/libjucedynamic.a' failed
make: *** [build/libjucedynamic.a] Error 1
Now, isn't dynamic library supposed NOT to contain a 'main' function? Does the Makefile possibly pass wrong arguments to the linker?
I am not an expert on building C++ projects so I'm having hard time to figure this out myself. Any help would be much appreciated.
I was able to complete the build by adding -fPIC to CXX_FLAGS and -shared to LD_FLAGS
Issue solved, I suppose.