Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i build a release exe with DEV C++?

I want to build the exe to work on another computer. I believe I have found the dll's the program needs and included them in the same directory with the application along with all the files the application loads when run. Put the folder in a USB tested it on my PC first and it ran, plugged the USB in the other computer and the application immediately terminates on execution on the other computer. There was no error of missing dll or of any kind, just an on and off. So i thought to try building the exe in release mode as i have done in the past with visual studio, but i cant seem to find any such build option in DEV c++. maybe thats not my problem though, any ideas for me?

like image 804
user1397417 Avatar asked Nov 03 '22 23:11

user1397417


2 Answers

If you just need a 32-bit copy of gpsvc.dll, you could try obtaining it from an actual 32-bit version of Windows and then placing it with all the other dlls your application uses. However, it's a Windows provided dll, so I don't think you're really supposed to do that, and it might not end up working anyways. That is, 64-bit Windows might notice this and not let you load the DLL.

As for building a 'release exe', I don't think Dev C++ has the concept of Release or Debug build configurations the way that Visual Studio and many other IDEs do. What you can do is go to Project Options, then Compiler tab, then the Linker heading in the list below. If 'Generate debug information' is set to 'Yes', change it to 'No'. You can also set 'Strip Executable' to 'Yes' if you want, as well as turning on the various optimization settings under the 'Optimization' heading that is below 'Linker'.

Alternatively, you can take the makefile that is automatically generated by Dev C++ and alter it, saving it under a different file name, like 'my_project_release.win'. What you'd do is alter it to remove command line switches like -g, -g3 or other similar flags that enable the inclusion of debugging information in a compiled binary. To strip symbols from the compiled binary, add -s to the CXXFLAGS and CFLAGS makefile variables in the same way the debug info flags were removed from the makefile. After creating this new makefile, go into your Project Options dialog box again, and go to the Makefile tab. Check 'Use Custom Makefile...' and then specify the location of this new makefile there, and you should be building a Release version of your executable now. To switch back to a Debug conversion, change the makefile line to point back to the original copy of the makefile that had the debug settings specified in it.

like image 188
mathonnapkins Avatar answered Nov 09 '22 09:11

mathonnapkins


Just press Ctrl+h (or click object properties in project bar, icon is like a shield).

Then go to:

Compiler > Linker > Generate debugging information (-g3)

and set it "no".

Just use devc+++ and enjoy!

like image 37
Amir Avatar answered Nov 09 '22 10:11

Amir