I want all my C projects to automatically have .exe extension rather than without any extension. I am using Ubuntu OS with Clang as compiler. What can I do?
Can i ask why? And can i ask what do you expect to get from this?
A history of Microsoft DOS then Windows user. I want to recognize a file type by it's extension. I wanted to get a project_name.exe file. By the way Clang, according to it's documentation has the following command lines:
-o<file>, --output <arg>, --output=<arg>
Write output to <file>
You have to disable "Auto generate filename extension" option in the Project -> Properties dialog.
I disabled it and changed "output filename" adding exe extension. But the compiled console application is still without extension.
I tested it here on Fedora with latest nightly and it works as expected.
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------
g++ -Wall -fexceptions -g -I/tmp/test -c /tmp/test/main.cpp -o obj/Debug/main.o
g++ -o bin/Debug/test.exe obj/Debug/main.o
Output file is bin/Debug/test.exe with size 27,85 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-------------- Run: Debug in test (compiler: GNU GCC Compiler)---------------
Checking for existence: /tmp/test/bin/Debug/test.exe
Executing: gnome-terminal --hide-menubar -t test -x /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /tmp/test/bin/Debug/test.exe (in /tmp/test/.)
Process terminated with status 0 (0 minute(s), 0 second(s))
Did you change it for all targets and if not, did you test it on the correct target ?
Can you copy the "Build log"when doing a full rebuild and paset it here, at least the relevant part (linking of the executable) ?
You should see the full filename in the linker command in the logs.
And to avoid any misunderstandings: you use a "real" Code::Blocks project, not a Makefile-based project ?
You have to disable "Auto generate filename extension" option in the Project -> Properties dialog.
I disabled it and changed "output filename" adding exe extension. But the compiled console application is still without extension.
I tested it here on Fedora with latest nightly and it works as expected.
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------
g++ -Wall -fexceptions -g -I/tmp/test -c /tmp/test/main.cpp -o obj/Debug/main.o
g++ -o bin/Debug/test.exe obj/Debug/main.o
Output file is bin/Debug/test.exe with size 27,85 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-------------- Run: Debug in test (compiler: GNU GCC Compiler)---------------
Checking for existence: /tmp/test/bin/Debug/test.exe
Executing: gnome-terminal --hide-menubar -t test -x /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /tmp/test/bin/Debug/test.exe (in /tmp/test/.)
Process terminated with status 0 (0 minute(s), 0 second(s))
Did you change it for all targets and if not, did you test it on the correct target ?
I used it on one target.
Can you copy the "Build log"when doing a full rebuild and paset it here, at least the relevant part (linking of the executable) ?
You should see the full filename in the linker command in the logs.
-------------- Build: Release in THW4 (compiler: My_Copy of LLVM Clang Compiler)---------------
clang -pedantic -Weverything -Wall -std=c11 -m64 -c /home/mehdi/Documents/Code_Blocks_Projects/Template_HW4/Main.c -o obj/Release/Main.o
clang++ -o bin/Release/THW4 obj/Release/Main.o -m64 -static -lfftw3l -lcunit
Output file is bin/Release/THW4 with size 891.45 KB
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
-------------- Run: Release in THW4 (compiler: My_Copy of LLVM Clang Compiler)---------------
Checking for existence: /home/mehdi/Documents/Code_Blocks_Projects/Template_HW4/bin/Release/THW4
Executing: gnome-terminal -t THW4 -x /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/mehdi/Documents/Code_Blocks_Projects/Template_HW4/bin/Release/THW4 (in /home/mehdi/Documents/Code_Blocks_Projects/Template_HW4/bin/Release)
Process terminated with status 0 (0 minute(s), 0 second(s))
And to avoid any misunderstandings: you use a "real" Code::Blocks project, not a Makefile-based project ?
I used a User template.