2013-05-27 1 views
0

파이썬 인터프리터를 사용하여 c 실행 파일에서 tcl에 몇 가지 문제가 있습니다. 어떤 이유로 인해 <fullpath>Tix843.dll을로드 할 수 없습니다. 그러나 파이썬 코드를 직접 (파이썬에서) 실행하면 제대로 작동합니다. DLL에 대한 경로/이름은 정확합니다 ... 의존성 워커와 함께 나는 Tkinter가 tix dll을로드하려고 시도하지만 그것을 발견하지 못합니다 ...Tcl : howto는 nameofexecutable의 동작을 변경합니다.

tcl 내의 모든 종류의 경로를 추적 한 후에 만 1 차이를 검출하십시오 : nameofexecutable. 파이썬에서 직접 실행하면 python.exe 경로이지만 내 C 실행 파일에서 실행하면 path/name of the executable (분명히)입니다.

tcl/tk에서 나는 nameofexecutable이 많은 경로를 설정하는 데 사용되는 것을 알아 차 렸습니다. 그래서 이것이 내 문제를 일으킬 것이라고 생각합니다. 변화

  • argv[0] 설정되어 있지> - $auto_path에 DLL의 경로를 추가

    1. 시스템 경로
    2. 에 DLL의 경로를 추가

      것들은 내가이 문제를 방지하기 위해 시도 PySys_SetArgv를 호출하기 전에 실행 파일을 실행하십시오 -> 변경하지 마십시오

    바보 같은 일을하고 있습니까? 아니면 어떻게 nameofexecutable을 설정할 수 있습니까? 이 문제를 해결할 다른 방법이 있습니까?

    이 편집 : ... 여기 결과 종속성 워커 다시 확인하고 세드릭 지금은 단서를 중계하지 있습니다

    00:00:07.800: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/reg1.2/tclreg12.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "c:\program files (x86)\python27\dlls\TCL85.DLL" at address 0x02468871. 
    00:00:07.800: Loaded "c:\program files (x86)\python27\tcl\reg1.2\TCLREG12.DLL" at address 0x00440000. Successfully hooked module. 
    00:00:07.816: Unloaded "c:\program files (x86)\python27\tcl\reg1.2\TCLREG12.DLL" at address 0x00440000. 
    00:00:07.816: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/reg1.2/tclreg12.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126). 
    00:00:07.832: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/reg1.2/tclreg12.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "c:\program files (x86)\python27\dlls\TCL85.DLL" at address 0x0246889C. 
    00:00:07.832: Loaded "c:\program files (x86)\python27\tcl\reg1.2\TCLREG12.DLL" at address 0x00440000. Successfully hooked module. 
    00:00:07.832: Unloaded "c:\program files (x86)\python27\tcl\reg1.2\TCLREG12.DLL" at address 0x00440000. 
    00:00:07.832: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/reg1.2/tclreg12.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126). 
    00:00:07.925: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/tix8.4.3/Tix843.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "c:\program files (x86)\python27\dlls\TCL85.DLL" at address 0x02468871. 
    00:00:07.925: Loaded "c:\program files (x86)\python27\tcl\tix8.4.3\TIX843.DLL" at address 0x04480000. Successfully hooked module. 
    00:00:07.925: Unloaded "c:\program files (x86)\python27\tcl\tix8.4.3\TIX843.DLL" at address 0x04480000. 
    00:00:07.925: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/tix8.4.3/Tix843.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126). 
    00:00:07.941: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/tix8.4.3/Tix843.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "c:\program files (x86)\python27\dlls\TCL85.DLL" at address 0x0246889C. 
    00:00:07.956: Loaded "c:\program files (x86)\python27\tcl\tix8.4.3\TIX843.DLL" at address 0x04480000. Successfully hooked module. 
    00:00:07.956: Unloaded "c:\program files (x86)\python27\tcl\tix8.4.3\TIX843.DLL" at address 0x04480000. 
    00:00:07.956: LoadLibraryExW("C:/Program Files (x86)/Python27/tcl/tix8.4.3/Tix843.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The specified module could not be found (126). 
    00:00:07.956: LoadLibraryA("shell32") called from "c:\program files (x86)\python27\dlls\TK85.DLL" at address 0x024BBACD. 
    00:00:07.956: LoadLibraryA("shell32") returned 0x75480000. 
    

    그렇게는 DLL을 몇 시간을 찾을 수 있습니다 항상은 아니지만 및 그런 다음 실패합니다.

  • 답변

    0

    경로에 없기 때문에 C 프로그램은 Tix.dll을 찾을 수 없습니다. 파이썬은 파이썬 실행 파일과 동일한 디렉토리에 있거나 파이썬이 알고있는 서브 디렉토리에 있기 때문에 찾을 수 있습니다. dll 경로를 PATH 환경 변수에 추가하십시오.

    +0

    미안하지만 나는 그걸 시도했지만 성공하지 못했습니다 ... 실제로 DLL에 올바른 경로를 제공하고로드 할 수 없다고 말합니다 (또는 종속 라이브러리 ...) 종속성 워커를 확인했지만 그게 Tkinter 짐을 Tix.dll을로드 할 수 있습니다 ... 그래서 아무 생각이 문제를 해결하기 위해 – Jen

    1

    nameofexecutable 속성은 Tcl의 라이브러리를 초기화하는 동안 설정 (I가 호출되는 방법을 정확하게 모르는 Tcl_FindExecutable()에 인수에서 유래하지만, 확실히 : 그것은 물건의 모든 종류의 작업을 수행하는 데 사용)입니다. 다른 어떤 지점에서도 설정할 수 없습니다. 그러나 Tcl은 실제로 오버라이드 할 수없는 값을 사용하지 않습니다.

    대신에 패키지 정의를 검색하는 디렉토리의 Tcl의 목록에 TCLLIBPATH 환경 변수를 설정으로 보일 것입니다. 아니면 실제을 포함 (lappend auto_path 포함)은 Tcl 내부의 auto_path 전역 변수에 디렉토리를 추가 할 수 있습니다 볼 곳 목록 (실제로 변수에 나열된 장소의 즉각적인 하위 디렉토리를 실제로 찾습니다). 물론 Tix를로드하기 전에이 작업을 수행해야합니다.

    관련 문제