eclipse won't run my exe file

混江龙づ霸主 提交于 2019-12-02 06:47:19

问题


I'm trying to build and run my C++ program in eclipse but it won't work. My program doesn't have a main function, but it does have WinMain and includes < windows.h >. I compile it into an executable and everything works fine, but when I click "run" nothing happens. When I drag the executable to my desktop and double click it it runs no problem. But I would like to be able to run it directly from eclipse.

I've done some research and already tried the following:

I made sure "PE Windows Parser" is checked in "Binary Parsers."

I made sure the working directory is where the executable is (workspace/projectname/Release).

I made sure MinGW is in the PATH (I couldn't find msys, but everything is compiling fine so I don't think this is the problem).

Any thoughts?


回答1:


1.- Go to Menu Run -> Run Configurations

2.- Double click over C/C++ Application in the left subwindow.

3.- At right subwindow, press button Search_Project and check your binary executable.

4.- Press Run.

If you need to pass arguments to your program, go to Arguments tab.

For next runs, you can use the PLAY toolbar button or use CTRL+F11.




回答2:


Change your compiler to Visual C++ instead of MinGW GCC. Just copy your code to separate files. Then, you simply create a new project using Visual C++ as your tool-chain. Then you simple paste the files into the directory, and then run it.



来源:https://stackoverflow.com/questions/15564977/eclipse-wont-run-my-exe-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!