visual studio - LNK2005 error because I have two c++ windows running parallel -
i working on uni project multiple tasks, , trying debug simple program, getting error "lnk2005 main defined in task 1".
i realise because have used "int(main)" both tasks (i have code task 1 , code task 2). not want have create new project folder every task. there way around ?
while advisable have project each executable build, can away having single project multiple executables if manage somehow rid of undesired duplicate mains. have quite few options available you:
have 1 main. have test own executable name, , take specific action depending on name finds. in post-build rules, set rules creating each (specifically named) executable base executable. allows build executables @ same time in efficient manner.
have multiple mains, hide them using #ifdefs. add #define project settings or somewhere above main(), , compile needed. ok if don't want build executables time.
just bite bullet , set multiple projects.
whatever do, consider being able build have in single step considered highly desirable trait of build systems, , high on list of features engineered development process should have.
Comments
Post a Comment