안녕하세요 오늘 처음 가입하자마자 도움을 요청하게 되었습니다.
제가
http://libusb-win32.sourceforge.net 라는 사이트에서 오픈소스를 구해서 테스트를 위해 컴파일을 해보려고
하는데
http://libusb-win32.sourceforge.net/#documentation 에 보면 DDK와 NSS와 Msys shell 을 갖추고
BCC를 설치한후 make DDK_PATH=/home/040080/NTDDK 명령으로 컴파일을 할 수 있다고 이해를 했는데
아래와 같은 에러가 계속 발생하는데 해결방법을 모르겠습니다. E2209에러부터 막히는데 해더파일을 여기저기에
놓아봐도 못 찾는다는 에러만 발생해서 막막하네요.
에러메시지 다음에 사이트에서 제시하는 컴파일 방법을 적어놨고 첨부파일로 제가 컴파일하고 싶은 소스파일을
올려놓습니다. BCC를 이용해서 컴파일이 성공할 수 있도록 도와주세요!!
금요일저녁이라 일찍 퇴근하려고 했더니 주말도 이거때문에 고생할 생각하니 우울한 금요일 저녁입니다. ㅠ_ㅠ
왜 오픈소스들은 이렇게 컴파일하기가 힘든건지..
040080@L040080 ~
$ make DDK_PATH=/home/040080/NTDDK
bcc32 -c ./src/usb.c -o usb.o -O2 -s -mwindows -mno-cygwin -Wall -DVERSION_MAJOR=0 -DVERSIO N_MINOR=1 -DVERSION_MICRO=8 -DVERSION_NANO=1 -I./src -I./src/driver -I./src/service
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
./src/usb.c:
Error E2209 ./src/usb.c 9: Unable to open include file 'stdlib.h'
Error E2209 ./src/usb.c 10: Unable to open include file 'stdio.h'
Error E2209 ./src/usb.c 11: Unable to open include file 'errno.h'
Error E2209 ./src/usbi.h 4: Unable to open include file 'string.h'
Error E2209 ./src/usb.h 4: Unable to open include file 'stdlib.h'
Error E2209 ./src/usb.h 70: Unable to open include file 'pshpack1.h'
Error E2209 ./src/usb.h 284: Unable to open include file 'poppack.h'
Error E2303 ./src/usb.h 297: Type name expected
Error E2303 ./src/usb.h 299: Type name expected
Error E2220 ./src/error.h 21: Invalid macro argument separator
Error E2451 ./src/usb.c 16: Undefined symbol 'NULL'
Warning W8065 ./src/usb.c 42: Call to function 'strcmp' with no prototype in function usb_find_busses
Warning W8065 ./src/usb.c 111: Call to function 'strcmp' with no prototype in function usb_find_devices
Warning W8065 ./src/usb.c 177: Call to function 'getenv' with no prototype in function usb_init
Warning W8065 ./src/usb.c 178: Call to function 'getenv' with no prototype in function usb_init
Warning W8065 ./src/usb.c 178: Call to function 'atoi' with no prototype in function usb_init
Warning W8065 ./src/usb.c 187: Call to function 'malloc' with no prototype in function usb_open
Warning W8069 ./src/usb.c 187: Nonportable pointer conversion in function usb_open
Warning W8065 ./src/usb.c 197: Call to function 'free' with no prototype in function usb_open
Error E2303 ./src/usb.c 205: Type name expected
*** 12 errors in Compile ***
Error E2194: Could not find file 'usb.o'
make: *** [usb.o] Error 1
http://libusb-win32.sourceforge.net/#development
Requirements
A Win2k or XP system.
The XP-DDK (Win2k-DDK could work, but has not been tested). A gratis CD of the DDK can be ordered at
http://www.microsoft.com
MinGW/Msys, Cygwin is not working yet, but this will change in the future. Microsoft and Borland compilers can't be used to build the library, due to their lack of full C99 support.
Borland C++ Compiler (BCC) to build the import library for this compiler. A free command line version of BCC can be downloaded from
http://www.borland.com.
The NSIS install system.
Make sure, that the binary directories of NSIS and BCC are in the system search path (modify the system's %PATH% environment variable).
Build Process
The package is currently build with a standard Makefile, there are no autoconf/automake scripts available yet.
Download the latest source code.
From a Msys shell run the following command (replace <DDKDIR> with your DDK's root directory):
make DDK_PATH=<DDKDIR>
to the build the library, services, and drivers.
To build the distribution archives and the installer run:
make dist.
Using
To use libusb-win32 in your own programs include the supplied header file usb.h, and link against the import library (libraries for GCC, BCC, and MSVC are available)
To avoid any version conflicts, DO NOT include the DLL libusb0.dll in your application's directory. The DLL is part of the driver and installed automatically to the Windows system directory.
If you are porting a libusb based program from Unix style systems to Windows, remove all references to the library's global variable usb_busses. Use the function usb_get_busses() instead to get this variable. Global variables in shared libraries (DLLs) do not work on Windows systems across different compilers.