Multiple target patterns?

I am trying to compile a c file where I included a driver for the Mongo database. I can compile it successfully with Cygwin, but when I go to Netbeans, I get this. It should be noted that this only happened after adding "-std = c99" in the additional options for the C compiler.

UPDATE:
Successfully compiled it from Netbeans. But "-std = c99" drives me crazy. If I have this, it says (after each compilation, if I don't delete the obj files):

build/Debug/Cygwin_4.x-Windows/main.od:1: *** multiple target patterns. Stop. 

UPDATE:
The contents of main.od:

 build/Debug/Cygwin_4.x-Windows/main.o: main.c \ c:/mongodb-driver/src/mongo.hc:/mongodb-driver/src/bson.h \ c:/mongodb-driver/src/platform.h c:/mongodb-driver/src/mongo.h: c:/mongodb-driver/src/bson.h: c:/mongodb-driver/src/platform.h: 
+1
source share
2 answers

Quote from an existing answer as you may have the same problem

"I saw this problem before using Cygwin - basically, make sees: on the way and believes that this is another definition of purpose, therefore an error.

If you are working with the Cygwin installation, you can try replacing c: / with / cygdrive / c /. If not, you can try using relative paths or using a network mount and see if that fixes this. "

application crash with multiple targets from eclipse

+3
source

From your comment:

@Lumi, how can I install it so as not to edit it every time?

Fix the script that generates main.od (and probably a lot of other .d files) to write relative paths or absolute paths that Cygwin make understands.

Alternatively, consider using MinGW instead of Cygwin. (But I have the feeling that after this road you will encounter additional problems.)

Ultimately, to deal with the Makefile, you need to read how Make works. GNU Make has a complete guide. I found these tips very helpful. The best thing for you at this point is probably Scotch Duckworth Make a tutorial .

+2
source

All Articles