User forums > Using Code::Blocks
Multiple definition during linking console executable
wzyjy:
I was trying to build a project, there's no error during the compilation, but during the process of linking console executable, it kept telling me "multiple definition of ...", e.g.:
--- Quote ---obj/Debug/applications/binarize.o: In function `usage()':
/home/brianw/IRTKsrc/geometry++/include/irtkPoint.h:238: multiple definition of `input_name'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:14: first defined here
obj/Debug/applications/blur.o: In function `usage()':
/home/brianw/IRTKsrc/geometry++/include/irtkPoint.h:238: multiple definition of `input_name'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:14: first defined here
obj/Debug/applications/closing.o: In function `usage()':
/home/brianw/IRTKsrc/geometry++/include/irtkPoint.h:238: multiple definition of `input_name'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:14: first defined here
--- End quote ---
Can anyone help me with this? Thanks a lot!
wzyjy:
PS: it even includes the main function:
--- Quote ---obj/Debug/applications/binarize.o: In function `main':
/home/brianw/IRTKsrc/applications/binarize.cc:25: multiple definition of `main'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:29: first defined here
obj/Debug/applications/blur.o: In function `main':
/home/brianw/IRTKsrc/applications/blur.cc:31: multiple definition of `main'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:29: first defined here
obj/Debug/applications/closing.o: In function `main':
/home/brianw/IRTKsrc/applications/closing.cc:29: multiple definition of `main'
obj/Debug/applications/AnisoDiff.o:/home/brianw/IRTKsrc/applications/AnisoDiff.cc:29: first defined here
--- End quote ---
oBFusCATed:
You're including some .cc aren't you?
wzyjy:
--- Quote from: oBFusCATed on December 14, 2010, 03:29:33 pm ---You're including some .cc aren't you?
--- End quote ---
you mean in the source code? I don't think so...
wzyjy:
I forgot to mention: if I just use the Makefile in the source code and do make in the terminal, it successfully generates executables, so I was wondering if this has anything to do with the setting of the IDE?
Navigation
[0] Message Index
[#] Next page
Go to full version