Author Topic: exe extension on Ubuntu  (Read 5808 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
exe extension on Ubuntu
« on: August 10, 2017, 11:44:21 am »
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: exe extension on Ubuntu
« Reply #1 on: August 10, 2017, 12:10:34 pm »
Use windows !

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: exe extension on Ubuntu
« Reply #2 on: August 10, 2017, 04:36:00 pm »
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?

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: exe extension on Ubuntu
« Reply #3 on: August 10, 2017, 05:24:03 pm »
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:


Code
-o<file>, --output <arg>, --output=<arg>

Write output to <file>

Code::Blocks SVN
OS : Ubuntu LTS

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: exe extension on Ubuntu
« Reply #4 on: August 10, 2017, 05:59:55 pm »
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...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: exe extension on Ubuntu
« Reply #5 on: August 10, 2017, 10:04:06 pm »
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!]

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: exe extension on Ubuntu
« Reply #6 on: August 11, 2017, 05:56:31 am »
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: exe extension on Ubuntu
« Reply #7 on: August 11, 2017, 07:31:14 am »
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.
Code
-------------- 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 ?

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: exe extension on Ubuntu
« Reply #8 on: August 11, 2017, 10:05:03 am »
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.
Code
-------------- 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.

Code
-------------- 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

Offline Commaster

  • Almost regular
  • **
  • Posts: 171
Re: exe extension on Ubuntu
« Reply #9 on: August 11, 2017, 10:14:50 am »
Quote
-o bin/Release/THW4
You haven't changed the right one, looks like...

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: exe extension on Ubuntu
« Reply #10 on: August 11, 2017, 10:50:35 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

Offline Commaster

  • Almost regular
  • **
  • Posts: 171
Re: exe extension on Ubuntu
« Reply #11 on: August 11, 2017, 11:09:29 am »
There's no "default" target, you always select the target in a DropDownList on the toolbar above.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: exe extension on Ubuntu
« Reply #12 on: August 11, 2017, 11:45:14 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.