I'm writing a program that looks roughly like this:
- Some main code in src/
- Some code in Demo1/
I compile Demo1's stuff into .o , then .so, and use that .so in the creation of the main executable. (Demo1's code is used in src/).
Demo1 uses an already complied library lib1 that sits in a separate folder with both its binaries and the source.
That's how I've been building Demo1:
gcc -c -fpic Demo1/src/*.c -Ilib1/include -o Demo1/build/demo1.o
gcc -shared Demo1/build/demo1.o -Llib1/lib -llib1 -o Demo1/dist/libDemo1.so
Now I've added one new .c file and one new .h to Demo1 and then this happened when I ran the build script (that contains the two command from above, among others):
gcc: fatal error: cannot specify -o with -c, -S or -E with multiple files
What does it mean ? I don't think that an addition of a source file could have caused this..
I've been using -c
with -o
on the same line in the past of course, and besides that - the last part of the sentence is not the most clear to me grammatically... (does it mean I can't specify -o with {-E when -E has multiple files})?
I'm running gcc 4.8.4 on an Ubuntu 14.04 machine.
Thanks in advance.