#C Giving Error

16 messages · Page 1 of 1 (latest)

echo crescent
#
# include<stdio.h>
int main() {
int x = 10;
int y = 20;
printf( " The summation of this questions is: %d", x+y);
return 0;
}
Building classs.exe.
POLINK: error: Symbol '_main' is multiply defined: 'firstcode.obj' and 'task1.obj'.
*** Error code: 1 ***
Done.

I am getting this error why??

frozen violetBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

sly forge
#

main is defined in both task.c and firstcode.c (assuming those are the source code file names)

echo crescent
#

oooh yes just noticed that I have another file

#

so I can't have two dofferent mains in two different files under one folder>

#

?*

untold vector
still tapir
sly forge
#

Compile only one file at a time, and name the executables differently, and youre good to go

#

@echo crescent if any of that is confusing, let us know, and tell us what compiler/os youre using

echo crescent
sly forge
#

Dunno, im not a mod here

echo crescent
#

!solved

frozen violetBOT
#

Thank you and let us know if you have any more questions!

#

[SOLVED] C Giving Error