LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 12-28-2017, 02:08 PM   #1
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Rep: Reputation: Disabled
Netbeans will not recognize build as executable


I spent the last few days setting up my first Arch Linux build using xfce4. Except for a few things, everything is working well.

I use Netbeans as my IDE to develop C++ apps. Compiling my cmake projects works as expected. I can run the executable from command line but not from Netbeans. Looking at the file via the xfce4 file manager, it displays as a "shared library" and doesn't use the executable icon.

As a test, I generated a simple "hello world" project and compiled it. This doesn't use cmake. The executable still displays as a "shared library" but netbeans will run it and I can place break points.

At first, it wasn't generating the executable until I added my user to a few more groups. Compiling the code in root produces the same result.

I'm not sure what to make of this.
 
Old 12-29-2017, 04:28 PM   #2
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Original Poster
Rep: Reputation: Disabled
With Arch Linux, you pretty much get the latest software. The GCC version is 7.2.1 and the new thing is compiling "executable shared libraries". The GNU/Linux people decided that this should be the default option. This is why Netbeans doesn't know it's an executable and wont display as the executable to use after a CMake build.

At this point I don't know what to do. I'm looking into forcing the build to be an ELF Executable and not a ELF Shared Library.
 
Old 12-29-2017, 06:37 PM   #3
GameCodingNinja
Member
 
Registered: Jul 2014
Posts: 100

Original Poster
Rep: Reputation: Disabled
Just needed to add "-no-pie" to the CMAKE_CXX_FLAGS.
 
Old 07-12-2022, 09:25 PM   #4
Lateralus138
LQ Newbie
 
Registered: Sep 2012
Location: Decatur, Il. US
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 0
Sorry to necro this post, but I believe it is SOMEWHAT pertaining to this issue and I can't find much else about it.

I just started using the Netbeans and I believe I've had a similar issue where NetBeans won't allow me to add my executable to the 'Run' config because it is not detected as an executable. I have found a workaround (consisting partially of the -no-pie resolve posted above) that allows you to keep building as PIE, but still allows you to add the executable to the Run command (not sure if this will help in this situation, but I'm trying anyway) and I'm really not sure where I should post and this was one the only comprehensible posts I found about this issue.

The steps are as follows (part of my Twitter post):
  1. Add -no-pie to your g++/make/cmake build command/config for the 1st build.
  2. Build once.
  3. Add the newly built exe to the NB Run config.
  4. Remove -no-pie from your command/config.
  5. Clean and rebuild.

The Run command/button should now work even as PIE and I hope it helps in other similar situations.

Hope this helps someone.

Last edited by Lateralus138; 07-12-2022 at 09:26 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to build executable from python script with different gdk, gtk and glibc version? ouyexie Programming 1 08-18-2012 07:48 PM
slackware doesn't recognize an executable Cultist Slackware 14 07-28-2010 06:32 PM
LXer: Sun Announces the Latest in Open Source Tools with the Availability of NetBeans Visual Web Pack and NetBeans C/C++ Development Pack LXer Syndicated Linux News 1 12-31-2006 07:37 AM
Build scripts say my C compiler cannot make executable output noware Linux - Software 2 06-07-2006 02:15 PM
gdb won't recognize 64 bit executable on my RedHat 64 bits box cerniagigante Programming 1 02-23-2006 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration