This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Dear sir : I failed to build properly my applications suing NetBeans (6.5 beta and 61) under Mac OS-X Leopard (v. 10.5 updated 5.5). In fact, my main concern was to build a dynamic library of a radiative transfer numerical model written in Fortran. Even though the library was sucessful build with NetBeans, and linked with a main.f programme compiled also with NetBeans, it failed when runned. The message was that the dynamic library was not loaded. Reason : image not found. Because the programme was too complex, I decided to develop a very easy Hello programme calling for an external dynamic library. The routines coded were the following ones : i) hello.h void hello (void) ; ii) hello.c #include <stdio.h> void hello (void) { printf ("Hello ! Si ça s'affiche, c'est que ça marche.\n"); } iii) main.c #include <stdio.h> #include "hello.h" main () { hello () ; } I build the library with hello.c (giving libhello.dylib). Correct : debug and release versions were successful. Then, I build main.c without omitting the -L option and -l option using NetBeans by Browsing, nor "Add option" for dynamic bindings. Debug and release versions were sucessful. However, when Run, always the same error when looking the X11 window opened : dyld : dynamic library not found. [...] Reason : image not found A great pity, because I cannot develop my programmes with NetBeans at this stage, having decided to build many scientific dynamic libraries with NetBeans for codes written in C, Fortran, or sometimes in C++. Hoping you a good receipt. I look forward to hearing from you soon. Yours sincerely, Laurent Delphin
Thank you for reporting this, Laurent, And sorry for the issue you came across. Thomas, Please evaluate. If it is Fortran specific, please lower to P2. Even if it is lowered, but confirmed, then it is a good candidate for patch_1. Leonid.
It's generally not a bug at least not a P1, probably it's just inconvenience. You need to say somehow where your library is or put it in a default place e.g you can set 'Run Directory' in your application project properties 'Run' section to folder where your library is (in my case it is /Users/idetester/NetBeansProject/DynamicLibrary_1/dist/Debug/GNU-MacOSX) or just copy your library into your application directory. Another option is to set 'Output' in Linker section for your library project to your application project directory and rebuild the library project.
I can reproduce your problem using the a modified version of the Subproject Application sample project. If I set the link step to link with -L../hello3lib/dist/Debug/GNU-MacOSX -lhello3lib and remove the project dependency, the project builds fine but doesn;t run. The problem is DYLD_LIBRARY_PATH is not set correctly. I think the project system should add the -L options to DYLD_LIBRARY_PATH. There are two (not very good) workarounds: 1) set DYLD_LIBRARY_PATH before you start NetBeans 2) create a makefile wrapper project around the external library add that project to your project.
Fixed. I will ask to get the fix included in NB Patch 1.
Fixed similar issue on Windows. Two changesets: changeset 5f0046a84a8c in main details: http://hg.netbeans.org/main?cmd=changeset;node=5f0046a84a8c description: #153166 Dynamic/static library not loaded : image not found changeset 850ad670a035 in main details: http://hg.netbeans.org/main?cmd=changeset;node=850ad670a035 description: #153166 Dynamic/static library not loaded : image not found
Integrated into 'main-golden', will be available in build *200811160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/5f0046a84a8c User: Thomas Preisler <thp@netbeans.org> Log: #153166 Dynamic/static library not loaded : image not found
The fix works on Mac and Windows but fails on Linux. I think LD_LIBRARY_PATH should be used on Linux/Solaris
Applied same fix toLinux/Solarisalthough there is another solution: you can use Runtime Search Directory. changeset 2905572c9856 in main details: http://hg.netbeans.org/main?cmd=changeset;node=2905572c9856 description: #153166 Dynamic/static library not loaded : image not found
Integrated into 'main-golden', will be available in build *200811180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2905572c9856 User: Thomas Preisler <thp@netbeans.org> Log: #153166 Dynamic/static library not loaded : image not found
The fix works on Windows, Linux and Solaris. Sorry, can not verify fix on Mac due to issue #153396 (Can't open display)
you can switch to internal output window. It should work too.
you can switch to internal output window. It should work.
verified in build 200811180201 on Mac using Output Window
fix backported into release65_fixes branch http://hg.netbeans.org/release65_fixes/rev/575ca5cdee92
verified in 6.5 with patch1