New Mint linux, new Netbeans v.20, old v.1.0 NetBeans 8.2 C/C++ latest plugin, liboauth-dev latest 1.0.3-5 installed with Synaptic, into /usr/lib/x86_64-linux-gnu. 64-bit system.
Netbeans cannot locate neither the .a nor the .so files when the NetBeans C++ Application project is asked interactively to browse for libraries to link in and include. Under various settings.
So I use -Wl,--verbose (ell, and no space) to get the linker to dump its thoughts.
And when the -loauth library is specified manually, with the proper -L path, Netbeans' g++ linker looks directly at the file, in its path, but fails to open.
attempt to open /usr/lib/x86_64-linux-gnu/liboauth.so failed
attempt to open /usr/lib/x86_64-linux-gnu/liboauth.a failed
But the same copied g++ line works successfully at a terminal. So it's the Netbeans environment, it's not g++.
It's not a permission problem, as I've temporarily opened up the library files to 777 just for grins. You only need 444 or 644 for libraries anyway.
And it's not a 64-bit vs. 32-bit problem--the libs are 64-bit--confirmed using
file *oauth* which, in the /usr/lib/x86_64-linux-gnu directory, shows the .so files "symbolic link" or "ELF 64-bit", and
objdump -f liboauth.a | grep ^architecture
which shows i386:x86-64 for the .a library.
I even ran sudo ldconfig /usr/lib/x86_64-linux-gnu for good luck. Nope.
So currently any library use of Apache Netbeans for C++ is dead in the water, until someone gives me the magic to fix this.
I do wish that Apache would support the C++ language fully, instead of requiring an old 8.2 plugin portal version.
Does anyone know where to download/install netbeans v.8? netbeans.org redirects to netbeans.apache.org (2024) which claims source less than v.9 is no longer available. Default Synaptic doesn't even list Apache's. And iirc the v.8 installer reached out over the internet to netbeans.org to download important files...
Why aren't library files that are in fact there [not] showing up in Apache Netbeans, and how do I get it to link them successfully?
It turns out that NetBeans got installed using the FlatPak package system.
FlatPak, for "safety", does not actually run in your actual file system. Instead, it creates a sandbox parallel ghost environment system, that looks a lot like yours and has the same general names. Except it's not. It doesn't have many libraries that you've added, and it has present a few libraries that are extra and not there on your system's file directory. This is a clue.
As this essentially duplicates your system, the wasted file space must be enormous.
Apparently enough people complained about the system that they decided to jailbreak it, at least for NetBeans. This is installed quietly under
/run/host/for the IDE. So instead of finding your file under/usr/lib/x86_64-linux-gnu/libfoo.so, inside the Netbeans you will actually find it underOne might think that going into project_name->Properties : Project Properties->Linker->Libraries->Add Library... that this would set up the appropriate magic to find your library. But it apparently only creates the
-lfoolinker tag.You still need to go back to the Project Properties panel->Additional Library Directories and add
/run/host/usr/lib/x86_64-linux-gnuto the Libraries search path. This will create the -L flag argument for you. Win.Still TBD: if the libraries need to be jailbroken, howcum it can see the source files in the project without needing to jailbreak them? Perhaps it's restricted to files you own, or only in your home directory? And what about saving executable results? Gotta love these "improvements"...