You Are Here:

Community: Developer Discussion Boards

#1 Old ImportError:dlopen:Load failed - 2009-07-06, 12:20

Join Date: Apr 2009
Posts: 317
SymbianTH's Avatar
SymbianTH
Offline
Regular Contributor
Hi

I attached my application code please help me why comes this error.

I tested in 3rd edition FP1(Nokia E71x) on following way:

1. Open manually c:\resource folder copy paste example.py file into c:\data\python\ folder.

2. Open Pyys60 1.9.4 -> RunScript -> click on "example.py" "Gives me Error"

3. Go "Interactive Module" write
dir()
dir(imp)
dir(imp.load_dynamic)
imp.load_dynamic('example','sys\\bin\\example.pyd')
and also tried imp.load_dynamic('example','c:\\resource\\example.pyd')

But always comes Error: "ImportError:dlopen:Load failed"

Please Help me.

Regards
SymbianTH
Attached Files
File Type: zip example.zip (18.6 KB, 10 views)
Reply With Quote

#2 Old Re: ImportError:dlopen:Load failed - 2009-07-06, 13:41

Join Date: Apr 2009
Posts: 317
SymbianTH's Avatar
SymbianTH
Offline
Regular Contributor
Hi

If anybody see code.

Code:
example.cpp
-----------
#include "Python.h"
#include "symbian_python_ext_util.h"


static PyObject* example_foo(PyObject *self, PyObject *args) {
	char buf[50];                          // create a buffer that's long enough
	sprintf(buf, "Hello World");           // fill it with text (stuff like %d would be possible as well)
	return PyString_FromString(buf);       // return the Python object containing our string
}

static PyMethodDef example_methods[] = {
	{"foo", example_foo, METH_VARARGS, "description for foo()"},
	{NULL, NULL}
};

DL_EXPORT(void) initexample(void) {
	Py_InitModule("example", example_methods);
}

#ifndef EKA2
GLDEF_C TInt E32Dll(TDllReason)
{
  return KErrNone;
}
#endif

example.pkg
-------------
#{"example DLL"},(0xEC3E4C03),1,0,0


;Localised Vendor name
%{"Embedded Systems Lab"}

;Unique Vendor name
:"ESL"

"C:\Symbian\Code\PYTHON\example\example.py"-"c:\data\python\example.py"
"C:\Symbian\9.2\S60_3rd_FP1_4\Epoc32\release\gcce\urel\kf_example.pyd" -"c:\sys\bin\kf_example.pyd"



example.mmp
-----------
TARGETTYPE	dll
UID			 0x1000008d 0xEC3E4C03
TARGET		kf_example.pyd
TARGETPATH	\system\libs

#ifdef EKA2
CAPABILITY  NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment
#endif

NOSTRICTDEF
EXPORTUNFROZEN

SYSTEMINCLUDE 	\epoc32\include
SYSTEMINCLUDE 	\epoc32\include\libc
SYSTEMINCLUDE   \epoc32\include\python

LIBRARY 	python222.lib
LIBRARY 	euser.lib
LIBRARY   avkon.lib
LIBRARY   eikcdlg.lib
LIBRARY   eikctl.lib
LIBRARY   estlib.lib /* Necessary only if you use the C standard library */

#ifdef ENABLE_ABIV2_MODE
DEBUGGABLE_UDEBONLY
#endif
//MACRO __DO_LOGGING__

SOURCE example.cpp
Code:
example.py
-----------

import e32

if e32.s60_version_info>=(3,0):
    import imp
    example=imp.load_dynamic('example', 'c:\\sys\\bin\\kf_example.pyd')
    
else:
    import example

del e32, imp #remove unnecessary names from namespace
from example import *
del example
Regards,
SymbianTH
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
HelloWorldBasic's Issue bluescorpio1107 General Symbian C++ 4 2009-09-04 15:41
S60 5th ed emulator startup failed hony Symbian Tools & SDKs 8 2009-08-11 22:12
S60 2nd to 3rd/ PlatformSecurity / Capabilities jarkoos Installation, Certification and Security 4 2007-04-14 15:08
ERROR: RCMake failed: (Bitmaps): bmconv.exe failed with code 5 Dexterp37 Symbian Tools & SDKs 5 2005-09-07 09:53
Nokia Image Converter davidpurdie General Discussion 0 2004-02-18 16:31

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia