question to DLLs
#1
Hi,

during the few days looking into the code I've got some questions and maybe one of the devs can answer them:
1) libcmyth: It's supposed to load it as dll and windows complains if it isn't there but to compile it corectly I have to add the static .lib otherwise it complains about missing dependencies. What do I miss here or why is the lib still needed?

2) I've tried to compile libshout which works with the sources provided but when I link it to xbmc_pc it complains about missing dependencies concerning libmad which is also supposed to be loaded as dll!? Maybe the same topic as 1)

3) todays revision broke the windows build due to missing dependencies to some _Py.. methods. Maybe also explainable with 1) and 2)?

Thanks for your help.
Reply
#2
1) sounds very weird. the only lib needed would be a implib IF you link the program to the dll (which there's no need to do - it's dlopen'd (ehm, cant recall the win32 function name, OpenLibrary or something?)
2) the libshout stuff is done for linux where we explicitly link the main program to libmad (-lmad). so you'd need to link to libmad on win32 as well - either the dll or the .lib doesnt really matter
3) don't think so, that's most likely caused by something in rev 11855
Reply
#3
Thanks for the reply. Maybe a stupid question but how do I link to a dll? Also with the pragma command or with the project settings in the linker tab?

Btw is there a chance to get a precompiler definition for this build something like _WIN32PC or should I still use:
Code:
#if defined(_WIN32) && !defined(HAS_XBOX_HARDWARE)
?
Reply
#4
you can definitely get a preprocessor token - just make sure you only stuff the windows only things within it and not shared windows/xbox. dll's should be somewhere in project settings.
Reply
#5
http://wiki.xbmc.org/?title=HOW-TO_debug..._Libraries
http://forum.xbmc.org/showthread.php?tid=17947

might be relative?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#6
einstein might object Tongue
Reply
#7
is that your theory?, hehe Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#8
my greatest contribution to science is the law of spiff:

'not everything is relevant'

Wink
Reply
#9
Hey maybe back to 3) Big Grin
I got it compiled by reverting
Code:
#define FUNCTION(function) void* (__cdecl* p_##function)();
in XBPythonDll.cpp to
Code:
#define FUNCTION(function) void* (__cdecl* p_##function)(); void* function() { return p_##function();}
for the windows build.
Fine, now it complained about not finding Q:\system\python\python24.zlib. Here I had to change
Code:
if (access(strFile, 0) != 0) // did this ever work under Linux?
in XBPython::FileExist to
Code:
if (access(_P(strFile), 0) != 0)
But now I'm stuck and seeking for help Huh
When trying to load a script I get the following log:
Code:
22:21:51 T:1856 M:412143616    INFO: initializing python engine.
22:21:51 T:1856 M:412143616   DEBUG: LoadLibraryA('Q:\system\python\python24.dll')
22:21:51 T:1856 M:410693632   DEBUG: Unable to resolve msvcr71.dll __security_error_handler
22:21:51 T:1856 M:410693632   DEBUG: LoadLibrary('Q:\system\python\python24.dll') returning: 0x02BCABB8
22:21:57 T:1856 M:405889024   DEBUG: dllGetProcAddress(0x011979F0(kernel32.dll), 'InterlockedCompareExchange') => 0x7C8097A2
22:21:57 T:1856 M:405618688   DEBUG: GetModuleFileNameA(0x00000000, 0x03892490, 256) => 'xbmc.xbe'
22:21:57 T:1856 M:405614592   DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
22:21:57 T:1856 M:405614592   DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
22:21:57 T:1856 M:405606400   DEBUG:   msg: 'import site' failed; use -v for traceback
and xbmc dies with an unhandled exception in dbgheap.c in line 359
Code:
/* forced failure */
if (!(*_pfnAllocHook)(_HOOK_ALLOC, NULL, nSize, nBlockUse, lRequest, szFileName, nLine))

Any ideas?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#10
Hi vulkanr,
the older revision of XBPythonDLL.cpp worked better but still not correctly. But as you said I see no other change to the python library.
No I get the error message in the log that python can't import some libraries:
Code:
INFO:   File "E:/Coding/Windows/xbmc_sdl/XBMC_run/Xbmc/scripts/Tetris/default.py", line 9, in ?
INFO:
INFO: import re, random, math, threading, time
INFO: ImportError
INFO: :
INFO: No module named re
INFO:
ERROR: Scriptresult: Error

Full log here:
http://pastebin.com/m5f0fcd53
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
That could possibly be path related maybe??
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
Do you think so? I looked for the modules and couldn't found them. I assume they are in the library so path shouldn't matter.
To be honest I didn't dig deeper until now. Just wanted to ask if someone already had this problem.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#13
J you're right. The libraries are referenced in emu_msvcrt.cpp and since q: is internally mapped they aren't found.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
I'm stuck for now. I put in a stupid error by working not clean with translate path (mixed slashes and back slashes) which screws something up. After cleaning this up python still can't find the libraries out of python24.zlib.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
question to DLLs0