www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/21/21:10:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=BAYES_40,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <23166858.post@talk.nabble.com>
Date: Tue, 21 Apr 2009 18:10:26 -0700 (PDT)
From: bigsnail <dummy DOT song AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: permission denied for g++ with shared library
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

I just installed the latest CYGWIN on my WinXP SP3 Professional.

When I compile a hello.cpp like below using 
g++ -shared -o hello hello.cpp
It successfully compiles but when I run ./hello, it complains:
-bash: ./hello: Permission denied
I've already run "chmod 777 /lib" and "chmod 777 /bin", and it doesn't help. 
Also added
export LD_LIBRARY_PATH=/lib
still doesn't work.

If I compile by "g++ -o hello hello.cpp", it runs well.

Could anybody give me some clue how to fix it?  Thanks a lot.

Henry


hello.cpp:
#include <iostream>
using namespace std;

int main () {
        cout << "Hello World!\n";
        return 0;
}

-- 
View this message in context: http://www.nabble.com/permission-denied-for-g%2B%2B-with-shared-library-tp23166858p23166858.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019