Two main methods?
-
I work with DevC++ and i want to make a project with several c++ files. For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message. ( I have seen a project with two main but it is created in visual c++ not in devc++ and he build very well and every .cpp file generate it's .exe file (program for client server) When i try to create the same project in Dev C++ i can't build!!! What can i do? ) Thank you!
-
I work with DevC++ and i want to make a project with several c++ files. For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message. ( I have seen a project with two main but it is created in visual c++ not in devc++ and he build very well and every .cpp file generate it's .exe file (program for client server) When i try to create the same project in Dev C++ i can't build!!! What can i do? ) Thank you!
A executable with two main methods ? It doesn't make a lot of sense to me: when it is executed, which function should be called ? :doh:
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
I work with DevC++ and i want to make a project with several c++ files. For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message. ( I have seen a project with two main but it is created in visual c++ not in devc++ and he build very well and every .cpp file generate it's .exe file (program for client server) When i try to create the same project in Dev C++ i can't build!!! What can i do? ) Thank you!
agetina wrote:
For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message.
You application must have just one entry point. What is the purpose of two
main()
functions? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I work with DevC++ and i want to make a project with several c++ files. For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message. ( I have seen a project with two main but it is created in visual c++ not in devc++ and he build very well and every .cpp file generate it's .exe file (program for client server) When i try to create the same project in Dev C++ i can't build!!! What can i do? ) Thank you!
-
I work with DevC++ and i want to make a project with several c++ files. For example i have two c++ files with two main(). Is it possible? How can i build (run) this? - it takes me an error message. ( I have seen a project with two main but it is created in visual c++ not in devc++ and he build very well and every .cpp file generate it's .exe file (program for client server) When i try to create the same project in Dev C++ i can't build!!! What can i do? ) Thank you!
You cannot have two main functions (main function is the entry point). You can, however, run an additional thread.
It is a crappy thing, but it's life -^ Carlo Pallini