Author Message

<  Everything Coding  ~  1.1.2's usb_modeswitch.c not compiling on ubuntu 8.04

PostPosted: Tue May 11, 2010 9:03 am Reply with quote
Posts: 1 Joined: Tue May 11, 2010 8:50 am Location: Bangalore, India
Hi,

I downloaded usb-modeswitch-1.1.2.tar.bz2 and extracted it. Then I used the command
>> sudo make install
inside the extracted folder.

I am getting the following really long list of errors and warnings. I am a linux newbie and I am not able to make any sense out of the errors and warnings. Can somebody please help me? I have pasted the log below.


arjun@arjun-laptop:~/Desktop/usb-modeswitch-1.1.2$ sudo make install
gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb
usb_modeswitch.c:57:19: error: stdio.h: No such file or directory
usb_modeswitch.c:58:20: error: stdlib.h: No such file or directory
usb_modeswitch.c:59:20: error: string.h: No such file or directory
usb_modeswitch.c:60:20: error: assert.h: No such file or directory
usb_modeswitch.c:61:20: error: signal.h: No such file or directory
usb_modeswitch.c:62:19: error: ctype.h: No such file or directory
usb_modeswitch.c:63:20: error: getopt.h: No such file or directory
usb_modeswitch.c:64:20: error: syslog.h: No such file or directory
usb_modeswitch.c:66:17: error: usb.h: No such file or directory
usb_modeswitch.c:84: error: ‘NULL’ undeclared here (not in a function)
usb_modeswitch.c:112: error: array type has incomplete element type
usb_modeswitch.c:113: error: ‘no_argument’ undeclared here (not in a function)
usb_modeswitch.c:115: error: ‘required_argument’ undeclared here (not in a function)
usb_modeswitch.c: In function ‘readConfigFile’:
usb_modeswitch.c:147: warning: implicit declaration of function ‘printf’
usb_modeswitch.c:147: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:148: warning: implicit declaration of function ‘strtol’
usb_modeswitch.c:150: warning: implicit declaration of function ‘strcpy’
usb_modeswitch.c:150: warning: incompatible implicit declaration of built-in function ‘strcpy’
usb_modeswitch.c:154: warning: implicit declaration of function ‘toupper’
usb_modeswitch.c:168: warning: implicit declaration of function ‘atoi’
usb_modeswitch.c:174: warning: implicit declaration of function ‘strlen’
usb_modeswitch.c:174: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c: In function ‘printConfig’:
usb_modeswitch.c:183: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:193: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c: In function ‘readArguments’:
usb_modeswitch.c:249: warning: implicit declaration of function ‘getopt_long’
usb_modeswitch.c:259: error: ‘optarg’ undeclared (first use in this function)
usb_modeswitch.c:259: error: (Each undeclared identifier is reported only once
usb_modeswitch.c:259: error: for each function it appears in.)
usb_modeswitch.c:265: warning: incompatible implicit declaration of built-in function ‘strcpy’
usb_modeswitch.c:288: warning: implicit declaration of function ‘exit’
usb_modeswitch.c:288: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:292: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c: In function ‘main’:
usb_modeswitch.c:337: warning: implicit declaration of function ‘signal’
usb_modeswitch.c:337: error: ‘SIGTERM’ undeclared (first use in this function)
usb_modeswitch.c:349: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:359: warning: implicit declaration of function ‘usb_init’
usb_modeswitch.c:362: warning: implicit declaration of function ‘usb_set_debug’
usb_modeswitch.c:364: warning: implicit declaration of function ‘usb_find_busses’
usb_modeswitch.c:365: warning: implicit declaration of function ‘usb_find_devices’
usb_modeswitch.c:369: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:370: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:372: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:374: warning: implicit declaration of function ‘fprintf’
usb_modeswitch.c:374: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:374: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:375: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:378: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:379: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:382: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:405: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:408: error: dereferencing pointer to incomplete type
usb_modeswitch.c:409: error: dereferencing pointer to incomplete type
usb_modeswitch.c:411: warning: implicit declaration of function ‘usb_open’
usb_modeswitch.c:411: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:414: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:418: error: dereferencing pointer to incomplete type
usb_modeswitch.c:420: error: dereferencing pointer to incomplete type
usb_modeswitch.c:422: error: dereferencing pointer to incomplete type
usb_modeswitch.c:432: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:433: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:439: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:440: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:475: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:486: warning: implicit declaration of function ‘openlog’
usb_modeswitch.c:486: error: ‘LOG_SYSLOG’ undeclared (first use in this function)
usb_modeswitch.c:487: warning: implicit declaration of function ‘syslog’
usb_modeswitch.c:487: error: ‘LOG_NOTICE’ undeclared (first use in this function)
usb_modeswitch.c:568: warning: implicit declaration of function ‘closelog’
usb_modeswitch.c:570: warning: implicit declaration of function ‘usb_close’
usb_modeswitch.c:571: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c: In function ‘deviceDescription’:
usb_modeswitch.c:580: warning: implicit declaration of function ‘memset’
usb_modeswitch.c:580: warning: incompatible implicit declaration of built-in function ‘memset’
usb_modeswitch.c:584: error: dereferencing pointer to incomplete type
usb_modeswitch.c:585: warning: implicit declaration of function ‘usb_get_string_simple’
usb_modeswitch.c:585: error: dereferencing pointer to incomplete type
usb_modeswitch.c:587: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:587: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:589: warning: incompatible implicit declaration of built-in function ‘strcpy’
usb_modeswitch.c:590: warning: implicit declaration of function ‘strstr’
usb_modeswitch.c:590: warning: incompatible implicit declaration of built-in function ‘strstr’
usb_modeswitch.c:594: error: dereferencing pointer to incomplete type
usb_modeswitch.c:595: error: dereferencing pointer to incomplete type
usb_modeswitch.c:597: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:604: error: dereferencing pointer to incomplete type
usb_modeswitch.c:605: error: dereferencing pointer to incomplete type
usb_modeswitch.c:607: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c: In function ‘deviceInquire’:
usb_modeswitch.c:629: warning: implicit declaration of function ‘malloc’
usb_modeswitch.c:629: warning: incompatible implicit declaration of built-in function ‘malloc’
usb_modeswitch.c:635: warning: implicit declaration of function ‘memcpy’
usb_modeswitch.c:635: warning: incompatible implicit declaration of built-in function ‘memcpy’
usb_modeswitch.c:637: warning: implicit declaration of function ‘usb_claim_interface’
usb_modeswitch.c:639: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:642: warning: implicit declaration of function ‘usb_clear_halt’
usb_modeswitch.c:644: warning: implicit declaration of function ‘usb_bulk_write’
usb_modeswitch.c:646: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:650: warning: implicit declaration of function ‘usb_bulk_read’
usb_modeswitch.c:652: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:658: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:675: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:677: warning: implicit declaration of function ‘usb_release_interface’
usb_modeswitch.c:678: warning: implicit declaration of function ‘free’
usb_modeswitch.c: In function ‘resetUSB’:
usb_modeswitch.c:689: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:690: warning: implicit declaration of function ‘fflush’
usb_modeswitch.c:690: error: ‘stdout’ undeclared (first use in this function)
usb_modeswitch.c:693: warning: implicit declaration of function ‘sleep’
usb_modeswitch.c:695: warning: implicit declaration of function ‘usb_reset’
usb_modeswitch.c:697: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:706: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:708: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c: In function ‘switchSendMessage’:
usb_modeswitch.c:716: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:727: error: ‘stdout’ undeclared (first use in this function)
usb_modeswitch.c:732: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c: In function ‘switchConfiguration’:
usb_modeswitch.c:760: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:761: warning: implicit declaration of function ‘usb_set_configuration’
usb_modeswitch.c: In function ‘switchAltSetting’:
usb_modeswitch.c:775: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:777: warning: implicit declaration of function ‘usb_set_altinterface’
usb_modeswitch.c: In function ‘switchHuaweiMode’:
usb_modeswitch.c:793: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:794: warning: implicit declaration of function ‘usb_control_msg’
usb_modeswitch.c:794: error: ‘USB_TYPE_STANDARD’ undeclared (first use in this function)
usb_modeswitch.c:794: error: ‘USB_RECIP_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:794: error: ‘USB_REQ_SET_FEATURE’ undeclared (first use in this function)
usb_modeswitch.c:796: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:796: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:797: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c: In function ‘switchSierraMode’:
usb_modeswitch.c:807: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:810: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:810: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:811: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c: In function ‘switchGCTMode’:
usb_modeswitch.c:823: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:827: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c: In function ‘switchSonyMode’:
usb_modeswitch.c:842: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:846: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:849: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:849: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:850: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:873: error: ‘stdout’ undeclared (first use in this function)
usb_modeswitch.c:880: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:882: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:895: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c: In function ‘detachDriver’:
usb_modeswitch.c:909: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:914: warning: implicit declaration of function ‘usb_get_driver_np’
usb_modeswitch.c:920: warning: implicit declaration of function ‘strcmp’
usb_modeswitch.c:930: warning: implicit declaration of function ‘usb_detach_kernel_driver_np’
usb_modeswitch.c: In function ‘sendMessage’:
usb_modeswitch.c:943: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:944: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:944: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:949: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:952: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:953: error: ‘stdout’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘checkSuccess’:
usb_modeswitch.c:973: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1010: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:1020: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1025: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1025: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1054: error: ‘LOG_NOTICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘write_bulk’:
usb_modeswitch.c:1076: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1079: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1081: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c: In function ‘read_bulk’:
usb_modeswitch.c:1092: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1095: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1097: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c: In function ‘release_usb_device’:
usb_modeswitch.c:1103: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1110: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c: In function ‘search_devices’:
usb_modeswitch.c:1132: warning: incompatible implicit declaration of built-in function ‘malloc’
usb_modeswitch.c:1132: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:1134: warning: implicit declaration of function ‘usb_get_busses’
usb_modeswitch.c:1134: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1134: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1136: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1136: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1138: warning: incompatible implicit declaration of built-in function ‘printf’
usb_modeswitch.c:1138: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1138: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1139: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1145: warning: incompatible implicit declaration of built-in function ‘strcpy’
usb_modeswitch.c:1146: warning: implicit declaration of function ‘strtok’
usb_modeswitch.c:1146: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1160: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1167: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1167: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1169: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1175: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1179: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1188: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1190: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1193: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1194: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1220: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1220: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_output_endpoint’:
usb_modeswitch.c:1242: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1245: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1246: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1247: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1247: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1247: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1248: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1248: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1249: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_input_endpoint’:
usb_modeswitch.c:1260: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1263: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1264: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1265: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1265: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1265: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1266: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1266: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1267: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘ReadParseParam’:
usb_modeswitch.c:1284: error: ‘FILE’ undeclared (first use in this function)
usb_modeswitch.c:1284: error: ‘file’ undeclared (first use in this function)
usb_modeswitch.c:1284: warning: implicit declaration of function ‘fopen’
usb_modeswitch.c:1287: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:1287: error: ‘stderr’ undeclared (first use in this function)
usb_modeswitch.c:1288: warning: incompatible implicit declaration of built-in function ‘exit’
usb_modeswitch.c:1291: warning: implicit declaration of function ‘fgets’
usb_modeswitch.c:1293: warning: incompatible implicit declaration of built-in function ‘strlen’
usb_modeswitch.c:1296: warning: implicit declaration of function ‘strchr’
usb_modeswitch.c:1296: warning: incompatible implicit declaration of built-in function ‘strchr’
usb_modeswitch.c:1297: warning: implicit declaration of function ‘strcspn’
usb_modeswitch.c:1297: warning: incompatible implicit declaration of built-in function ‘strcspn’
usb_modeswitch.c:1305: warning: implicit declaration of function ‘strrchr’
usb_modeswitch.c:1305: warning: incompatible implicit declaration of built-in function ‘strrchr’
usb_modeswitch.c:1308: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:1316: warning: implicit declaration of function ‘strspn’
usb_modeswitch.c:1316: warning: incompatible implicit declaration of built-in function ‘strspn’
usb_modeswitch.c:1318: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:1329: warning: incompatible implicit declaration of built-in function ‘fprintf’
usb_modeswitch.c:1335: warning: implicit declaration of function ‘fclose’
usb_modeswitch.c:1346: warning: control reaches end of non-void function
usb_modeswitch.c: In function ‘printVersion’:
usb_modeswitch.c:1395: warning: incompatible implicit declaration of built-in function ‘printf’
make: *** [usb_modeswitch] Error 1


Offline
PostPosted: Tue May 11, 2010 7:40 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
Your system is missing some important development components.

If you want the easy way, just install the latest Debian packages. There is no reason why they should be incompatible with your Ubuntu.

If you want to get the compiler running, use your package manager to install "glibc-dev" and "libusb-dev" (names might vary). Afterwards the errors should be gone because the header files (ending with .h) are found in the right places (mostly "include" and subfolders).



Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
2 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum