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.
This bug appears to be Mac OS X El Capitan related, and appears with both 8.0.2 and later. Steps to reproduce the bug: 1) Create an empty C++ Dynamic Library project. Fill it with any skeleton class. 2) Create an empty C++ Application. 3) Add the Dynamic Library to the Application using the Project Properties/Linker/Libraries option. 4) Compile and run the C++ Application. The following error shows: dyld: Library not loaded: libCppDynamicLibrary_1.dylib Referenced from: /Users/xxxxxxx/NetBeansProjects/CppApplication_1/dist/Debug/GNU-MacOSX/cppapplication_1 Reason: image not found RUN FINISHED; Trace/BPT trap: 5; real time: 10ms; user: 0ms; system: 0ms
Confirmed. I think NetBeans uses DYLD_LIBRARY_PATH, but this way doesn't work in El Captain see: http://sourceforge.net/p/staf/feature-requests/771/ https://blogs.nrao.edu/jmalone/2015/10/05/how-to-fix-aips-under-osx-el-capitan/
reckstei, just to be sure: please, create a Subprojects sample. (New Project/Samples/C-C++). It shows the same error, right?
Try to copy *.dylib from your Dynamic Lib (from step 1) project to the folder dist/<...>/ near the executable (from step 2). Run the binary from terminal. Does it work correctly?
Fixed in: https://hg.netbeans.org/cnd-main/rev/30e0c3d896b5 https://hg.netbeans.org/cnd-main/rev/625eed9a40f1 https://hg.netbeans.org/cnd-main/rev/5e2a1bc60387 https://hg.netbeans.org/cnd-main/rev/2bb0c23d8b0e
Integrated into 'main-silver', will be available in build *201603100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/30e0c3d896b5 User: Ilia Gromov <ilia@netbeans.org> Log: Fixing Bug #255959 - Dynamic Libraries Not Found for Sample Projects
Integrated into 'main-silver', will be available in build *201603110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/67e488531a12 User: Ilia Gromov <ilia@netbeans.org> Log: Additional fix - Bug #255959 - Dynamic Libraries Not Found for Sample Projects
Integrated into 'main-silver', will be available in build *201603150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/5994c7ef7944 User: Ilia Gromov <ilia@netbeans.org> Log: Additional fix - Bug 255959 - Dynamic Libraries Not Found for Sample Projects
Regression: In this revision https://hg.netbeans.org/cnd-main/rev/30e0c3d896b5 see ConfigurationMakeileWriter, the code below is incorrect: bw.write("LDLIBSOPTIONS=-Wl,-rpath,'.' " + oicLibOptionsPrefix + conf.getLinkerConfiguration().getLibraryItems() + oicLibOptionsPostfix + explicitDot + "\n"); // NOI18N tuxedo is totally broken after this fix. Please fix correctly
The following lines in the ConfigurationMakefileWriter String output = getOutput(projectDescriptor, conf, compilerSet); String outputDir = CndPathUtilities.getDirName(output); bw.write("\t${RM} -r " + outputDir + "\n"); // NOI18N will delete project folder on Clean if output is placed under project folder
Created attachment 159996 [details] patch1
Created attachment 159997 [details] patch2
Fixed in: https://hg.netbeans.org/cnd-main/rev/fbd99b237d87 https://hg.netbeans.org/cnd-main/rev/31783448b36f
Integrated into 'main-silver', will be available in build *201606180002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/fbd99b237d87 User: Ilia Gromov <ilia@netbeans.org> Log: Additional fix for #255959 - Dynamic Libraries Not Found for Sample Projects
*** Bug 258239 has been marked as a duplicate of this bug. ***
I don't see any changes in NetBeans 8.2. "Subprojects" fails with old error: "Reason: image not found"
The bug priority was raised because first fix result in DELETING project folder. This wild behavior was fixed in change sets fbd99b237d87 and 31783448b36f. Downgrade priority to original.
should be fixed by 0ce009c148b6 on enum
Integrated into 'main-silver', will be available in build *201704110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/54aee6b850b0 User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixing #255959 - Dynamic Libraries Not Found for Sample Projects (transplanted from 0ce009c148b68664528a99c17a7313bd8b9b3fb7)
https://netbeans.org/bugzilla/show_bug.cgi?id=255959 Changesets: http://hg.netbeans.org/releases/rev/0ce009c148b6 # fixing #255959 - Dynamic Libraries Not Found for Sample Projects
Verified in NetBeans IDE 8.2 (Build 201704181436)