News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

exe extension on Ubuntu

Started by ordak, August 10, 2017, 11:44:21 AM

Previous topic - Next topic

ordak

Hi,

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?
Code::Blocks SVN
OS : Ubuntu LTS

Jenna


BlueHazzard

Quote from: ordak on August 10, 2017, 11:44:21 AM
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?

ordak

Quote from: BlueHazzard on August 10, 2017, 04:36:00 PM
Quote from: ordak on August 10, 2017, 11:44:21 AM
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>


Code::Blocks SVN
OS : Ubuntu LTS

BlueHazzard

Project->Properties->Build target select the right target on the left->Output filename

i am not 100% convinced that this is working... I think codeblocks does the naming something automatically, but i can not tell for sure...

oBFusCATed

You have to disable "Auto generate filename extension" option in the Project -> Properties dialog.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ordak

Quote from: oBFusCATed on August 10, 2017, 10:04:06 PM
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.
Code::Blocks SVN
OS : Ubuntu LTS

Jenna

Quote from: ordak on August 11, 2017, 05:56:31 AM
Quote from: oBFusCATed on August 10, 2017, 10:04:06 PM
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 ?

ordak

Quote from: jens on August 11, 2017, 07:31:14 AM
Quote from: ordak on August 11, 2017, 05:56:31 AM
Quote from: oBFusCATed on August 10, 2017, 10:04:06 PM
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.

Quote
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))



Quote
And to avoid any misunderstandings: you use a "real" Code::Blocks project, not a Makefile-based project ?

I used a User template.
Code::Blocks SVN
OS : Ubuntu LTS

Commaster

Quote-o bin/Release/THW4
You haven't changed the right one, looks like...

ordak

Quote from: Commaster on August 11, 2017, 10:14:50 AM
Quote-o bin/Release/THW4
You haven't changed the right one, looks like...


In Project/properties/Build targets I added "Copy of release" and made the changes.  Later I re-ordered it to the top. It did not became default as I expected. Now making the changes to "Release" build target does the job.
Code::Blocks SVN
OS : Ubuntu LTS

Commaster

There's no "default" target, you always select the target in a DropDownList on the toolbar above.

Jenna

Quote from: ordak on August 11, 2017, 10:50:35 AM
Quote from: Commaster on August 11, 2017, 10:14:50 AM
Quote-o bin/Release/THW4
You haven't changed the right one, looks like...


In Project/properties/Build targets I added "Copy of release" and made the changes.  Later I re-ordered it to the top. It did not became default as I expected. Now making the changes to "Release" build target does the job.
Good to see it's working now.