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.

Bug 255959 - Dynamic Libraries Not Found for Sample Projects
Summary: Dynamic Libraries Not Found for Sample Projects
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 8.2
Hardware: All Mac OS X
: P2 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
: 258239 (view as bug list)
Depends on:
Blocks: 270147
  Show dependency tree
 
Reported: 2015-10-15 17:47 UTC by reckstei
Modified: 2017-04-20 13:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch1 (2.19 KB, patch)
2016-06-08 15:55 UTC, ilia
Details | Diff
patch2 (2.43 KB, patch)
2016-06-08 15:55 UTC, ilia
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description reckstei 2015-10-15 17:47:23 UTC
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
Comment 1 soldatov 2015-12-30 15:11:09 UTC
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/
Comment 2 ilia 2016-02-15 11:46:43 UTC
reckstei,

just to be sure: please, create a Subprojects sample. (New Project/Samples/C-C++). It shows the same error, right?
Comment 3 ilia 2016-02-18 07:57:38 UTC
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?
Comment 5 Quality Engineering 2016-03-10 02:00:53 UTC
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
Comment 6 Quality Engineering 2016-03-11 02:12:02 UTC
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
Comment 7 Quality Engineering 2016-03-15 04:56:40 UTC
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
Comment 8 Maria Tishkova 2016-06-07 09:07:22 UTC
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
Comment 9 Maria Tishkova 2016-06-07 11:52:22 UTC
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
Comment 10 ilia 2016-06-08 15:55:11 UTC
Created attachment 159996 [details]
patch1
Comment 11 ilia 2016-06-08 15:55:30 UTC
Created attachment 159997 [details]
patch2
Comment 13 Quality Engineering 2016-06-18 03:12:55 UTC
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
Comment 14 Alexander Simon 2016-07-11 14:07:07 UTC
*** Bug 258239 has been marked as a duplicate of this bug. ***
Comment 15 soldatov 2016-09-16 13:41:05 UTC
I don't see any changes in NetBeans 8.2. "Subprojects" fails with old error: "Reason: image not found"
Comment 16 Alexander Simon 2016-09-20 15:37:35 UTC
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.
Comment 17 Vladimir Kvashin 2017-04-06 18:50:41 UTC
should be fixed  by 0ce009c148b6 on enum
Comment 18 Quality Engineering 2017-04-11 01:53:32 UTC
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)
Comment 19 ilia 2017-04-13 11:05:45 UTC
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
Comment 20 soldatov 2017-04-20 13:36:28 UTC
Verified in NetBeans IDE 8.2 (Build 201704181436)