Installing FTDI device drivers on linux [closed] - c

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was trying to install the Virtual COM drivers from FTDI (http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz) on ubuntu 10.04.
I downloaded the file and tried to compile it. But it shows errors like these:
Can anybody tell me the reason?
I installed the linux kernel development packages
Below is the output of make.
I removed some parts because of the size limitation
sudo make
gcc -Wall -D__KERNEL__ -DMODULE -I/lib/modules/2.6.32-41-generic/build/include -D__SMP__ -DSMP -DMODVERSIONS -include /lib/modules/2.6.32-41-generic/build/include/linux/modversions.h -I/usr/src/linux-2.6.32-41-generic/drivers/usb/serial/ -O -c -o ftdi_sio.o ftdi_sio.c
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:11,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/linkage.h:5:25: error: asm/linkage.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:15,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:17:24: error: asm/bitops.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:15,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘get_bitmask_order’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:29: warning: implicit declaration of function ‘fls’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘hweight_long’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:45: warning: implicit declaration of function ‘hweight32’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:45: warning: implicit declaration of function ‘hweight64’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘fls_long’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:132: warning: implicit declaration of function ‘fls64’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘__ffs64’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:147: warning: implicit declaration of function ‘__ffs’
In file included from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:21:21: error: asm/bug.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:56:29: error: asm/thread_info.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:65: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:65: warning: its scope is only this definition or declaration, which is probably not what you want
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘set_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:67: warning: implicit declaration of function ‘set_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:67: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:70: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘clear_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:72: warning: implicit declaration of function ‘clear_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:72: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:75: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_and_set_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:77: warning: implicit declaration of function ‘test_and_set_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:77: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:80: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_and_clear_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:82: warning: implicit declaration of function ‘test_and_clear_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:82: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:85: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:87: warning: implicit declaration of function ‘test_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:87: error: dereferencing pointer to incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/list.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/prefetch.h:14:27: error: asm/processor.h: No such file or directory
/lib/modules/2.6.32-41-generic/build/include/linux/prefetch.h:15:23: error: asm/cache.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/list.h:7:24: error: asm/system.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h: In function ‘smp_mb__after_lock’:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:137: warning: implicit declaration of function ‘smp_mb’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:321:24: error: asm/atomic.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/wait.h:26:25: error: asm/current.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:15,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h: In function ‘write_seqlock’:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:64: warning: implicit declaration of function ‘smp_wmb’
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h: In function ‘read_seqbegin’:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:93: warning: implicit declaration of function ‘cpu_relax’
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:96: warning: implicit declaration of function ‘smp_rmb’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/bitmap.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:95,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:16,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/string.h:21:24: error: asm/string.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:16,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__first_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:239: warning: implicit declaration of function ‘find_first_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__next_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:245: warning: implicit declaration of function ‘find_next_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__first_unset_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:263: warning: implicit declaration of function ‘find_first_zero_bit’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:20:22: error: asm/page.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:353: error: expected specifier-qualifier-list before ‘atomic_long_t’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mutex.h: In function ‘mutex_is_locked’:
/lib/modules/2.6.32-41-generic/build/include/linux/mutex.h:118: warning: implicit declaration of function ‘atomic_read’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:14,
from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/rwsem.h:22:65: error: asm/rwsem.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/notifier.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:62: error: field ‘rwsem’ has incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: In function ‘populated_zone’:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:699: error: ‘struct zone’ has no member named ‘present_pages’
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: In function ‘is_normal’:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:748: error: ‘struct zone’ has no member named ‘zone_pgdat’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/topology.h:34:26: error: asm/topology.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmdebug.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/autoconf.h:991:1: warning: "CONFIG_NR_CPUS" redefined
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/threads.h:16:1: warning: this is the location of the previous definition
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘allocflags_to_migratetype’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:121: warning: implicit declaration of function ‘WARN_ON’
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘gfp_zone’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: ‘ZONE_DMA’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: (Each undeclared identifier is reported only once
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: for each function it appears in.)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: ‘ZONE_HIGHMEM’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘alloc_pages_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:284: warning: implicit declaration of function ‘cpu_to_node’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/time.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:24,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h:5:23: error: asm/div64.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/time.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:24,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h: In function ‘div_u64_rem’:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h:43: warning: implicit declaration of function ‘do_div’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:25,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/timex.h:170:23: error: asm/timex.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:25,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:26: error: expected specifier-qualifier-list before ‘atomic_long_t’
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: In function ‘cancel_delayed_work’:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:240: error: ‘struct work_struct’ has no member named ‘data’
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: In function ‘__cancel_delayed_work’:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:255: error: ‘struct work_struct’ has no member named ‘data’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kmemtrace.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/trace/events/kmem.h: In function ‘trace_kmalloc’:
/lib/modules/2.6.32-41-generic/build/include/trace/events/kmem.h:47: warning: implicit declaration of function ‘smp_read_barrier_depends’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:53: error: expected specifier-qualifier-list before ‘atomic_long_t’
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:142: error: ‘PAGE_SHIFT’ undeclared here (not in a function)
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: In function ‘kmalloc_large’:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:232: warning: implicit declaration of function ‘get_order’
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:236: error: ‘PAGE_SIZE’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: In function ‘kmalloc’:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:246: error: ‘PAGE_SIZE’ undeclared (first use in this function)
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/fs.h:369,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h: In function ‘dget’:
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h:336: warning: implicit declaration of function ‘BUG_ON’
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h:337: warning: implicit declaration of function ‘atomic_inc’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/fs.h:470,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/quota.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/quota.h:384: error: field ‘dqptr_sem’ has incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:748: error: field ‘i_alloc_sem’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:926: error: expected specifier-qualifier-list before ‘atomic_long_t’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:1337: error: field ‘s_umount’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h: In function ‘file_accessed’:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:1738: error: ‘struct file’ has no member named ‘f_flags’
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h: In function ‘put_write_access’:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:2130: warning: implicit declaration of function ‘atomic_dec’
In file included from /usr/include/asm/termios.h:1,
from /lib/modules/2.6.32-41-generic/build/include/linux/termios.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:11,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/asm-generic/termios.h:51:25: error: asm/uaccess.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/module.h:14,
from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/elf.h:7:21: error: asm/elf.h: No such file or directory
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:20:23: error: asm/local.h: No such file or directory
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:21:24: error: asm/module.h: No such file or directory
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:302: error: field ‘arch’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:319: error: expected specifier-qualifier-list before ‘Elf_Sym’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:455: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: In function ‘__module_get’:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:470: warning: implicit declaration of function ‘local_inc’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:470: warning: implicit declaration of function ‘__module_ref_addr’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:472: warning: implicit declaration of function ‘local_read’
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:712: warning: type defaults to ‘int’ in declaration of ‘Elf_Ehdr’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:712: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:14,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h:14:23: error: asm/delay.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:14,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h: In function ‘ndelay’:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h:39: warning: implicit declaration of function ‘udelay’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/interrupt.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:15,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/hardirq.h:10:25: error: asm/hardirq.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/interrupt.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:15,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/irqflags.h:57:26: error: asm/irqflags.h: No such file or directory

I'm thinking your missing the asm symlink. I didn't go through everything, but a lot of these errors are missing "asm/XXXX.h".
Let's take a look at the first error. Check your include directory in your kernel:
#/usr/src/linux/include> ls
In this directory you should have a "linux" directory, which should contain linkage.h. Opening this we see:
#include <asm/linkage.h>
So it's looking for an "asm" directory in /usr/src/linux/include. Do you have on there? Is it pointing at the correct architecture for your system? Here's the top of my linux/include
mike#linux-4puc:/usr/src/linux/include> ls -l
total 120
drwxr-xr-x 3 root root 4096 Aug 1 10:51 acpi
lrwxrwxrwx 1 root root 47 Aug 1 12:08 asm -> /usr/src/linux-3.1.10-1.16/arch/x86/include/asm
My system didn't originally have this symlink so I had to add it in when I started via:
mike#linux-4puc:/usr/src/linux/include> ln -s /usr/src/linux-3.1.10-1.16/arch/x86/include/asm asm

Related

SQLite3: extract column blob. Impossible to load_extension fileio.c

I'm very rookie on SQL and database but my final target is extract all the blob images from a database filed but this is impossible to me. I'm using SQLite and DB Browser for SQLite but I don¡t know how to load the extension.
I have tried to load the fileio.c as extension by the "Load Extension", but Browser only detects .dll and .so.
Ok, I'm trying then to build the fileio.c file by MinGW like this:
C:\Users\juan_>gcc -g -shared ext\misc\fileio.c -o fileio.dll
But then, the compilation doesn't find sqlite3ext.h neither sqlite3.c.
I have downloaded these files from sqlite amalgamation, but now, there is other problem while building:
C:\Users\juan_>gcc -g -shared sqlite-amalgamation-3400100\fileio.c -o fileio.dll
sqlite-amalgamation-3400100\fileio.c:99:30: fatal error: test_windirent.h: No such file or directory
# include "test_windirent.h"
Then, I have found this file in one folder inside sqlite-master (from github, where i could find fileio.c extension).
I add all the amalgamation files in src folder, and retry the building:
sqlite-master\src\fileio.c: In function 'writefileFunc':
sqlite-master\src\fileio.c:513:9: warning: implicit declaration of function 'S_ISLNK' [-Wimplicit-function-declaration]
if( S_ISLNK(mode) ){
^~~~~~~
sqlite-master\src\fileio.c: At top level:
sqlite-master\src\fileio.c:567:3: error: unknown type name 'DIR'
DIR *pDir; /* From opendir() */
^~~
sqlite-master\src\fileio.c: In function 'fsdirResetCursor':
sqlite-master\src\fileio.c:648:22: warning: implicit declaration of function 'closedir' [-Wimplicit-function-declaration]
if( pLvl->pDir ) closedir(pLvl->pDir);
^~~~~~~~
sqlite-master\src\fileio.c: In function 'fsdirNext':
sqlite-master\src\fileio.c:711:18: warning: implicit declaration of function 'opendir' [-Wimplicit-function-declaration]
pLvl->pDir = opendir(pLvl->zDir);
^~~~~~~
sqlite-master\src\fileio.c:711:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
pLvl->pDir = opendir(pLvl->zDir);
^
sqlite-master\src\fileio.c:720:29: warning: implicit declaration of function 'readdir' [-Wimplicit-function-declaration]
struct dirent *pEntry = readdir(pLvl->pDir);
^~~~~~~
sqlite-master\src\fileio.c:720:29: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
sqlite-master\src\fileio.c:722:17: error: dereferencing pointer to incomplete type 'struct DIRENT'
if( pEntry->d_name[0]=='.' ){
^~
Is this not the way to get the fileio.dll extension? I hear other kind of advise like using other program or something like that.

Can't make: implicit declaration of function ‘http_write_chunked’

I'm trying to compile demo main file (https post with the chunked-encoding data) from github repo using, I have installed libghc-iproute-dev and libnl3.
gcc -o main -Imbedtls/include -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" main.c -O2 mbedtls/library/libmbedx509.a mbedtls/library/libmbedtls.a mbedtls/library/libmbedcrypto.a
I can't compile porgram, here is what I got:
main.c: In function ‘main’:
main.c:133:8: warning: implicit declaration of function ‘http_open_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_open_chunked(&hi2, url) == 0)
^~~~~~~~~~~~~~~~~
http_read_chunked
main.c:137:12: warning: implicit declaration of function ‘http_write_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_write_chunked(&hi2, data, size) != size)
^~~~~~~~~~~~~~~~~~
http_read_chunked
/tmp/cc7m6wMn.o: In function main': main.c:(.text.startup+0x3b): undefined reference to http_init'
main.c:(.text.startup+0x48): undefined reference to http_init' main.c:(.text.startup+0x59): undefined reference to http_open_chunked'
main.c:(.text.startup+0x9e): undefined reference to http_write_chunked' main.c:(.text.startup+0xd3): undefined reference to http_write_chunked'
main.c:(.text.startup+0x120): undefined reference to http_write_chunked' main.c:(.text.startup+0x139): undefined reference to http_strerror'
main.c:(.text.startup+0x157): undefined reference to http_close' main.c:(.text.startup+0x15f): undefined reference to http_close'
main.c:(.text.startup+0x19c): undefine
d reference to `http_read_chunked'
collect2: error: ld returned 1 exit status
I also tried to include netlink libraries, using:
#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
And try to compile using the line:
gcc -o main -fPIC -DHAVE_CONFIG_H -D_U_="attribute((unused))" -O2 -I/usr/include/libnl3/netlink/ -Imbedtls/include main.c ApiService.c mbedtls/library/libmbedx509.a mbedtls/library/libmbedtls.a mbedtls/library/libmbedcrypto.a
Then I got:
ApiService.c:17:8: warning: implicit declaration of function ‘http_open_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_open_chunked(&hi2, url) == 0)
^~~~~~~~~~~~~~~~~
http_read_chunked
ApiService.c:21:12: warning: implicit declaration of function ‘http_write_chunked’; did you mean ‘http_read_chunked’? [-Wimplicit-function-declaration]
if(http_write_chunked(&hi2, data, size) != size)
^~~~~~~~~~~~~~~~~~
http_read_chunked
ApiService.c: In function ‘getTask’:
ApiService.c:106:5: warning: format not a string literal and no format arguments [-Wformat-security]
sprintf(data, cJSON_Print(task));
^~~~~~~
https.c: In function ‘mbedtls_net_connect_timeout’:
https.c:496:18: error: ‘errno’ undeclared (first use in this function); did you mean ‘h_errno’?
else if( errno == EINPROGRESS )
^~~~~
h_errno
https.c:496:18: note: each undeclared identifier is reported only once for each function it appears in
https.c:496:27: error: ‘EINPROGRESS’ undeclared (first use in this function)
else if( errno == EINPROGRESS )
^~~~~~~~~~~
https.c:515:33: error: ‘EINTR’ undeclared (first use in this function); did you mean ‘NLE_INTR’?
if(errno == EINTR) continue;
^~~~~
NLE_INTR
Makefile:16: recipe for target 'compile' failed
Link to repo https://github.com/HISONA/https_client.
Please help I trying to compile that whole day, nothing works for me.
The implicit declaration of function error means that the compiler cannot locate the function in your workspace. you should indicate to the caller where the http_open_chunked function reside in your code by including the header (.h) file where it is impleented.

Makefile and program structure Raspberry Pi GCC

I' m trying to setup a simple tool to measure different aspects of a system. I build a project which can log an accelerometer, gyroscope and a magnetometer. I want full control of the the program so I decided not to use any usr/local kind of libraries and keep all files in the project folder. All files all working. I want to make the structure of my program as follows: https://www.dropbox.com/s/59s3si8spvkdq98/filestructure.png (not enough REP). I don't have much experience in making Makefiles, except changing a few variables. I work in the Embedded environment and mostly with IDE's.
I tried building my project with the following Makefile:
# Project name
NAME = TEST
# Tools
CC = gcc
CFLAGS = -o
# Paths
DRV_PATH = drivers
SRC_PATH = src
LIB_PATH = libs
# includes
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
# what files do we need to compile?
# libraries
MY_LIB = $(LIB_PATH)/bcm2835.c
# main files
MAIN = main.c
# src files
#MY_SRC = $(SRC_PATH)/vector.c
MY_SRC += $(SRC_PATH)/dcm.c
# select drivers to compile
DRV_SRC = $(DRV_PATH)/adxl345.c
DRV_SRC += $(DRV_PATH)/itg3200.c
DRV_SRC += $(DRV_PATH)/hmc5883l.c
DRV_SRC += $(DRV_PATH)/gy-85.c
DRV_SRC += $(DRV_PATH)/nrf24l01.c
# bundle files
ALL_SRC = $(MY_LIB) $(DRV_SRC) $(MY_SRC) $(MAIN)
OBJ = $(ALL:.c=.o)
BIN = $(ALL:.c=)
# make commands
all:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC)
debug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DDEBUG=1
imudebug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DIMUDEBUG=1
nrfdebug:
$(CC) $(CFLAGS) $(NAME) $(ALL_SRC) -DNRFDEBUG=1
I use the different make commands to generate some debug output.
The config file currently includes all files and is as follows:
#ifndef CONFIG_H
#define CONFIG_H
/* includes */
#include <stdio.h>
#include <math.h>
/* libs */
#include <bcm2835.h>
/* drivers */
#include "gy-85.h"
#include "adxl345.h"
#include "itg3200.h"
#include "hmcl5883l.h"
#include "nrf24l01.h"
/* src */
#include "dcm.h"
#endif // __CONFIG_H__
And the dcm.h file looks as follows. I tried t keep all .h files like this:
#ifndef DCM_H
#define DCM_H
#include <bcm2835.h>
#include <stdio.h>
#include <math.h>
#include "gy-85.h"
double pitch, roll, yaw;
double DCM_Matrix[3][3];
uint64_t stamp;
void resetFusion(void);
#endif
This is my make result:
gcc -o TEST libs/bcm2835.c drivers/adxl345.c drivers/itg3200.c drivers/hmc5883l.c drivers/gy-85.c drivers/nrf24l01.c src/dcm.c main.c
In file included from drivers/adxl345.c:1:0:
drivers/adxl345.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from drivers/itg3200.c:1:0:
drivers/itg3200.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
drivers/hmc5883l.c: In function ‘magInit’:
drivers/hmc5883l.c:7:30: error: ‘MAG_ADDR’ undeclared (first use in this function)
drivers/hmc5883l.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
drivers/hmc5883l.c:14:17: error: ‘MODE’ undeclared (first use in this function)
drivers/hmc5883l.c:14:23: error: ‘CONTINUOUS’ undeclared (first use in this function)
drivers/hmc5883l.c:22:17: error: ‘CONA’ undeclared (first use in this function)
drivers/hmc5883l.c:22:23: error: ‘RATE_50HZ’ undeclared (first use in this function)
drivers/hmc5883l.c: In function ‘magRead’:
drivers/hmc5883l.c:37:30: error: ‘MAG_ADDR’ undeclared (first use in this function)
drivers/hmc5883l.c:38:18: error: ‘DATA’ undeclared (first use in this function)
drivers/hmc5883l.c: In function ‘magGetRegister’:
drivers/hmc5883l.c:60:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:61:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/hmc5883l.c: At top level:
drivers/hmc5883l.c:71:6: warning: conflicting types for ‘magGetRegisters’ [enabled by default]
drivers/hmc5883l.c:38:2: note: previous implicit declaration of ‘magGetRegisters’ was here
drivers/hmc5883l.c: In function ‘magGetRegisters’:
drivers/hmc5883l.c:79:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:80:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/hmc5883l.c: At top level:
drivers/hmc5883l.c:97:6: warning: conflicting types for ‘magSetRegister’ [enabled by default]
drivers/hmc5883l.c:14:2: note: previous implicit declaration of ‘magSetRegister’ was here
drivers/hmc5883l.c: In function ‘magSetRegister’:
drivers/hmc5883l.c:107:13: error: ‘BCM2835_I2C_REASON_OK’ undeclared (first use in this function)
drivers/hmc5883l.c:108:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
drivers/gy-85.c: In function ‘gyInit’:
drivers/gy-85.c:15:30: error: ‘BCM2835_I2C_CLOCK_DIVIDER_2500’ undeclared (first use in this function)
drivers/gy-85.c:15:30: note: each undeclared identifier is reported only once for each function it appears in
drivers/gy-85.c: In function ‘gyUpdate’:
drivers/gy-85.c:29:2: error: unknown type name ‘int16_t’
drivers/gy-85.c:30:2: error: unknown type name ‘uint8_t’
drivers/gy-85.c:32:9: error: ‘int16_t’ undeclared (first use in this function)
drivers/gy-85.c:32:18: error: expected expression before ‘)’ token
drivers/gy-85.c:40:18: error: expected expression before ‘)’ token
drivers/gy-85.c:47:18: error: expected expression before ‘)’ token
drivers/gy-85.c:61:2: warning: return from incompatible pointer type [enabled by default]
In file included from drivers/nrf24l01.c:1:0:
drivers/nrf24l01.h:5:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from src/dcm.c:1:0:
src/dcm.h:4:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
In file included from main.c:1:0:
config.h:9:21: fatal error: bcm2835.h: No such file or directory
compilation terminated.
make: *** [all] Error 1
If you can point out the main problem with my file structure I would be so glad!
Current error list:
gcc -o TEST -I libs -I drivers -I src libs/bcm2835.c drivers/adxl345.c drivers/itg3200.c drivers/hmc5883l.c drivers/gy-85.c drivers/nrf24l01.c src/dcm.c main.c
drivers/gy-85.c: In function ‘gyUpdate’:
drivers/gy-85.c:63:2: warning: return from incompatible pointer type [enabled by default]
main.c: In function ‘main’:
main.c:51:4: warning: passing argument 1 of ‘nrf24Transmit’ from incompatible pointer type [enabled by default]
drivers/nrf24l01.h:145:9: note: expected ‘uint8_t *’ but argument is of type ‘uint64_t *’
/tmp/ccOWR401.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccOWR401.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccyZlhJe.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccyZlhJe.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccUbOIyA.o:(.bss+0x0): multiple definition of `accelRaw'
/tmp/cc1gy1Bh.o:(.bss+0x0): first defined here
/tmp/ccUbOIyA.o:(.bss+0x8): multiple definition of `accelBias'
/tmp/cc1gy1Bh.o:(.bss+0x8): first defined here
/tmp/ccyZlhJe.o: In function `resetFusion':
dcm.c:(.text+0x38): undefined reference to `atan2'
collect2: ld returned 1 exit status
make: *** [all] Error 1
You don't have your includes in your rule
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
This just seems to dangle. Simplest solution to my eyes is to move down your CFLAGS definition and add in the includes:
INCLUDES = -I $(DRV_PATH) -I $(LIB_PATH) -I $(SRC_PATH)
CFLAGS = -o $(INCLUDES)
This way you don't have to change anything else. Of course, there are alternatives, this one just looks easiest.

How to compile C version of vtd-xml under linux (32 bit)

I've downloaded ximpleware_2.11_c.zip (C version of vtd-xml), when I
have tried to compile it under linux I've the following error messages:
In file included from vtdNav.c:19:
vtdNav.h:82: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:506: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h: In function ‘writeIndex_VTDNav’:
vtdNav.c: At top level:
vtdNav.c:3410: error: conflicting types for ‘writeIndex_VTDNav’
vtdNav.h:347: error: previous declaration of ‘writeIndex_VTDNav’ was here
vtdNav.c: In function ‘dumpXML’:
vtdNav.c:3554: error: too many arguments to function ‘dumpXML2’
vtdNav.c: At top level:
vtdNav.c:3562: error: conflicting types for ‘dumpXML2’
vtdNav.h:362: error: previous declaration of ‘dumpXML2’ was here
In file included from vtdNav.c:19:
vtdNav.h:82: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:506: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h: In function ‘writeIndex_VTDNav’:
vtdNav.h:507: error: ‘f’ undeclared (first use in this function)
vtdNav.h:507: error: (Each undeclared identifier is reported only once
vtdNav.h:507: error: for each function it appears in.)
vtdNav.h:507: error: too many arguments to function
‘vn->__writeIndex_VTDNav’
vtdNav.h: At top level:
vtdNav.h:675: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.h:695: error: expected declaration specifiers or ‘...’ before ‘FILE’
vtdNav.c: In function ‘_writeIndex2_VTDNav’:
vtdNav.c:3751: error: too many arguments to function ‘writeIndex_VTDNav’
vtdNav.c: In function ‘dumpXML’:
vtdNav.c:3874: error: too many arguments to function ‘dumpXML2’
vtdNav.c: At top level:
vtdNav.c:3882: error: conflicting types for ‘dumpXML2’
vtdNav.h:695: error: previous declaration of ‘dumpXML2’ was here
make: *** [vtdNav.o] Error 1
How can I build it under linux ?
Thanks for your response.
I've put
#include <stdio.h>
in :
vtdNav.h and in transcoder.h
and now it compile.
I'm sorry to have put a post to ask how to compile the examples. I have compiled them by modifying the makefile already present in ximpleware_2.11_c and in this way works:
CC=gcc
CFLAGS= -c -O3 -Wall -Winline -fgnu89-inline -fomit-frame-pointer-fforce-addr -frerun-cse-after-loop -fexpensive-optimizations -fregmove -frerun-loop-opt -fmerge-all-constants -fno-branch-count-reg -funroll-loops -fpeephole -march=core2-falign-functions -falign-loops -falign-jumps -freorder-blocks -freorder-functions-fprefetch-loop-arrays -funswitch-loops -fbranch-target-load-optimize2 -fvpt --paraminline-unit-growth=300 --param max-inline-recursive-depth=2 --param large-function-growth=600
CFLAGS2 = -c -ggdb
LDFLAGS = -O3 -fomit-frame-pointer -fforce-addr -frerun-cse-after-loop-fexpensive-optimizations -fregmove -frerun-loop-opt -march=core2 -lm
LDFLAGS2 = -ggdb
all : hello_world
hello_world: hello_world.o ../../arrayList.o ../../fastIntBuffer.o ../../fastLongBuffer.o ../../contextBuffer.o ../../vtdNav.o ../../vtdGen.o ../../autoPilot.o ../../XMLChar.o ../../helper.o ../../lex.yy.o ../../l8.tab.o ../../literalExpr.o ../../numberExpr.o ../../pathExpr.o ../../filterExpr.o ../../binaryExpr.o ../../unaryExpr.o ../../funcExpr.o ../../locationPathExpr.o ../../intHash.o ../../unionExpr.o ../../decoder.o ../../XMLModifier.o ../../nodeRecorder.o ../../indexHandler.o ../../bookMark.o ../../elementFragmentNs.o ../../transcoder.o ../../textIter.o ../../variableExpr.o ../../cachedExpr.o
clean:
-rm *.o
hello_world.o : hello_world.c
${CC} ${CFLAGS} hello_world.c

Compiling a program with a legacy version of gcc

This is probably a very difficult problem to troubleshoot with the information I can practically provide, but I'm hoping someone might be able to at least point me in a possible direction.
I'm trying to install HTK (http://htk.eng.cam.ac.uk/), which, according to this page needs to be installed using gcc 3.4. Their method of implementing backwards compatibility:
#yum install compat-gcc-34-c++ compat-gcc-34
won't work for me as I'm running Ubuntu (On that note, I take it I can't simply install YUM and the subsequent package, since it's an entirely different distro, but if I'm wrong I'd love to hear it).
I instead installed two versions of gcc 3.4 - 3.4.0 and 3.4.6 using instructions from this site. I then added the lines suggested by that page to the top of the makefile (on this note, what's the difference between makefile and makefile.in? I tried adding the lines to the top of both files regardless), both for version 3.4.0 and 3.4.6, but both failed. I also tried, on the off-chance, compiling it with my current version (4.4.1), but that also failed. I got the errors:
(cd HTKLib && make HTKLib.a) \
|| case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/charles/bin/htk-3.4/HTKLib'
gcc -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="i686"' -Wall -Wno-switch -g -O2 -I. -c -o HGraf.o HGraf.c
HGraf.c:73:77: error: X11/Xlib.h: No such file or directory
HGraf.c:74:23: error: X11/Xutil.h: No such file or directory
HGraf.c:75:21: error: X11/Xos.h: No such file or directory
HGraf.c:77:27: error: X11/keysymdef.h: No such file or directory
HGraf.c:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
HGraf.c:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rootW’
HGraf.c:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘theCmap’
HGraf.c:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘theGC’
HGraf.c:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gcs’
HGraf.c:95: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
HGraf.c:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘report’
HGraf.c:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hints’
HGraf.c:111: error: ‘GXcopy’ undeclared here (not in a function)
HGraf.c:111: error: ‘GXor’ undeclared here (not in a function)
HGraf.c:111: error: ‘GXxor’ undeclared here (not in a function)
HGraf.c:111: error: ‘GXinvert’ undeclared here (not in a function)
HGraf.c:151: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
HGraf.c: In function ‘InstallFonts’:
HGraf.c:164: error: ‘FontInfo’ undeclared (first use in this function)
HGraf.c:164: error: (Each undeclared identifier is reported only once
HGraf.c:164: error: for each function it appears in.)
HGraf.c:164: warning: implicit declaration of function ‘XLoadQueryFont’
HGraf.c:164: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:167: error: ‘DefaultFont’ undeclared (first use in this function)
HGraf.c: At top level:
HGraf.c:176: error: expected ‘)’ before ‘*’ token
HGraf.c: In function ‘HGetEvent’:
HGraf.c:219: error: ‘XEvent’ undeclared (first use in this function)
HGraf.c:219: error: expected ‘;’ before ‘xev’
HGraf.c:223: warning: implicit declaration of function ‘XFlush’
HGraf.c:223: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:225: warning: implicit declaration of function ‘XEventsQueued’
HGraf.c:225: error: ‘QueuedAfterFlush’ undeclared (first use in this function)
HGraf.c:226: warning: implicit declaration of function ‘XNextEvent’
HGraf.c:226: error: ‘xev’ undeclared (first use in this function)
HGraf.c:228: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:230: error: ‘ButtonPress’ undeclared (first use in this function)
HGraf.c:235: error: ‘ButtonRelease’ undeclared (first use in this function)
HGraf.c:240: error: ‘MotionNotify’ undeclared (first use in this function)
HGraf.c:245: error: ‘KeyPress’ undeclared (first use in this function)
HGraf.c:249: warning: implicit declaration of function ‘DecodeKeyPress’
HGraf.c:251: error: ‘KeyRelease’ undeclared (first use in this function)
HGraf.c:257: error: ‘Expose’ undeclared (first use in this function)
HGraf.c: In function ‘HEventsPending’:
HGraf.c:281: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:281: error: ‘QueuedAfterFlush’ undeclared (first use in this function)
HGraf.c: In function ‘HMousePos’:
HGraf.c:288: error: ‘Window’ undeclared (first use in this function)
HGraf.c:288: error: expected ‘;’ before ‘root’
HGraf.c:293: warning: implicit declaration of function ‘XQueryPointer’
HGraf.c:293: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:293: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:293: error: ‘root’ undeclared (first use in this function)
HGraf.c:293: error: ‘child’ undeclared (first use in this function)
HGraf.c: In function ‘InstallColours’:
HGraf.c:311: error: ‘XColor’ undeclared (first use in this function)
HGraf.c:311: error: expected ‘;’ before ‘greyDef’
HGraf.c:317: warning: implicit declaration of function ‘XParseColor’
HGraf.c:317: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:317: error: ‘theCmap’ undeclared (first use in this function)
HGraf.c:317: error: ‘colourDef’ undeclared (first use in this function)
HGraf.c:320: warning: implicit declaration of function ‘XAllocColor’
HGraf.c:334: error: ‘whiteDef’ undeclared (first use in this function)
HGraf.c:334: warning: implicit declaration of function ‘XQueryColor’
HGraf.c:335: error: ‘blackDef’ undeclared (first use in this function)
HGraf.c:341: error: ‘greyDef’ undeclared (first use in this function)
HGraf.c: In function ‘HSetColour’:
HGraf.c:361: warning: implicit declaration of function ‘XSetForeground’
HGraf.c:361: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:361: error: ‘gcs’ undeclared (first use in this function)
HGraf.c: In function ‘HSetGrey’:
HGraf.c:370: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:370: error: ‘gcs’ undeclared (first use in this function)
HGraf.c: In function ‘HDrawLines’:
HGraf.c:388: warning: implicit declaration of function ‘XDrawLines’
HGraf.c:388: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:388: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:388: error: ‘theGC’ undeclared (first use in this function)
HGraf.c:388: error: ‘XPoint’ undeclared (first use in this function)
HGraf.c:388: error: expected expression before ‘)’ token
HGraf.c: In function ‘HDrawRectangle’:
HGraf.c:395: warning: implicit declaration of function ‘XDrawRectangle’
HGraf.c:395: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:395: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:395: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HFillRectangle’:
HGraf.c:402: warning: implicit declaration of function ‘XFillRectangle’
HGraf.c:402: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:402: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:402: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HDrawLine’:
HGraf.c:408: warning: implicit declaration of function ‘XDrawLine’
HGraf.c:408: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:408: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:408: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HFillPolygon’:
HGraf.c:414: warning: implicit declaration of function ‘XFillPolygon’
HGraf.c:414: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:414: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:414: error: ‘theGC’ undeclared (first use in this function)
HGraf.c:414: error: ‘XPoint’ undeclared (first use in this function)
HGraf.c:414: error: expected expression before ‘)’ token
HGraf.c: In function ‘HDrawArc’:
HGraf.c:427: warning: implicit declaration of function ‘XDrawArc’
HGraf.c:427: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:427: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:427: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HFillArc’:
HGraf.c:440: warning: implicit declaration of function ‘XFillArc’
HGraf.c:440: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:440: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:440: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HPrintf’:
HGraf.c:451: warning: implicit declaration of function ‘XDrawString’
HGraf.c:451: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:451: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:451: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HCopyArea’:
HGraf.c:457: warning: implicit declaration of function ‘XCopyArea’
HGraf.c:457: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:457: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:457: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HPlotVector’:
HGraf.c:476: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:476: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:476: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HSetFontSize’:
HGraf.c:490: error: ‘CurrentFont’ undeclared (first use in this function)
HGraf.c:490: error: ‘DefaultFont’ undeclared (first use in this function)
HGraf.c:499: error: ‘FontInfo’ undeclared (first use in this function)
HGraf.c:502: warning: implicit declaration of function ‘XSetFont’
HGraf.c:502: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:502: error: ‘gcs’ undeclared (first use in this function)
HGraf.c: In function ‘HSetLineWidth’:
HGraf.c:511: warning: implicit declaration of function ‘XSetLineAttributes’
HGraf.c:511: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:511: error: ‘gcs’ undeclared (first use in this function)
HGraf.c:511: error: ‘LineSolid’ undeclared (first use in this function)
HGraf.c:511: error: ‘JoinRound’ undeclared (first use in this function)
HGraf.c:511: error: ‘FillSolid’ undeclared (first use in this function)
HGraf.c: In function ‘HSetXMode’:
HGraf.c:517: error: ‘theGC’ undeclared (first use in this function)
HGraf.c:517: error: ‘gcs’ undeclared (first use in this function)
HGraf.c: In function ‘CentreX’:
HGraf.c:523: warning: implicit declaration of function ‘XTextWidth’
HGraf.c:523: error: ‘CurrentFont’ undeclared (first use in this function)
HGraf.c: In function ‘CentreY’:
HGraf.c:529: error: ‘CurrentFont’ undeclared (first use in this function)
HGraf.c: In function ‘HTextWidth’:
HGraf.c:535: error: ‘CurrentFont’ undeclared (first use in this function)
HGraf.c: In function ‘HTextHeight’:
HGraf.c:541: error: ‘CurrentFont’ undeclared (first use in this function)
HGraf.c: In function ‘HDrawImage’:
HGraf.c:550: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
HGraf.c:550: error: ‘xi’ undeclared (first use in this function)
HGraf.c:557: warning: implicit declaration of function ‘XDestroyImage’
HGraf.c:558: warning: implicit declaration of function ‘XGetImage’
HGraf.c:558: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:558: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:558: error: ‘AllPlanes’ undeclared (first use in this function)
HGraf.c:558: error: ‘XYPixmap’ undeclared (first use in this function)
HGraf.c:562: warning: implicit declaration of function ‘XPutPixel’
HGraf.c:564: warning: implicit declaration of function ‘XPutImage’
HGraf.c:564: error: ‘theGC’ undeclared (first use in this function)
HGraf.c: In function ‘HFlush’:
HGraf.c:570: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c: In function ‘InitGCs’:
HGraf.c:780: error: ‘XGCValues’ undeclared (first use in this function)
HGraf.c:780: error: expected ‘;’ before ‘values’
HGraf.c:783: error: ‘GCLineWidth’ undeclared (first use in this function)
HGraf.c:783: error: ‘GCFunction’ undeclared (first use in this function)
HGraf.c:783: error: ‘GCForeground’ undeclared (first use in this function)
HGraf.c:785: error: ‘values’ undeclared (first use in this function)
HGraf.c:788: error: ‘gcs’ undeclared (first use in this function)
HGraf.c:788: warning: implicit declaration of function ‘XCreateGC’
HGraf.c:788: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:788: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:790: error: ‘GCPlaneMask’ undeclared (first use in this function)
HGraf.c: In function ‘InitGlobals’:
HGraf.c:800: warning: implicit declaration of function ‘DefaultScreen’
HGraf.c:800: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:801: error: ‘theCmap’ undeclared (first use in this function)
HGraf.c:801: warning: implicit declaration of function ‘DefaultColormap’
HGraf.c:802: error: ‘rootW’ undeclared (first use in this function)
HGraf.c:802: warning: implicit declaration of function ‘RootWindow’
HGraf.c:803: error: ‘theGC’ undeclared (first use in this function)
HGraf.c:803: warning: implicit declaration of function ‘DefaultGC’
HGraf.c:804: error: ‘theVisual’ undeclared (first use in this function)
HGraf.c:804: warning: implicit declaration of function ‘DefaultVisual’
HGraf.c:805: warning: implicit declaration of function ‘DisplayCells’
HGraf.c:806: warning: implicit declaration of function ‘DisplayWidth’
HGraf.c:807: warning: implicit declaration of function ‘DisplayHeight’
HGraf.c:808: warning: implicit declaration of function ‘DisplayPlanes’
HGraf.c:809: warning: implicit declaration of function ‘WhitePixel’
HGraf.c:810: warning: implicit declaration of function ‘BlackPixel’
HGraf.c: In function ‘MakeXGraf’:
HGraf.c:817: error: ‘Window’ undeclared (first use in this function)
HGraf.c:817: error: expected ‘;’ before ‘window’
HGraf.c:818: error: ‘XSetWindowAttributes’ undeclared (first use in this function)
HGraf.c:818: error: expected ‘;’ before ‘setwinattr’
HGraf.c:823: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:823: warning: implicit declaration of function ‘XOpenDisplay’
HGraf.c:824: warning: implicit declaration of function ‘XDisplayName’
HGraf.c:828: error: ‘parent’ undeclared (first use in this function)
HGraf.c:829: error: ‘window’ undeclared (first use in this function)
HGraf.c:829: warning: implicit declaration of function ‘XCreateSimpleWindow’
HGraf.c:831: error: ‘CWBackingStore’ undeclared (first use in this function)
HGraf.c:831: error: ‘setwinattr’ undeclared (first use in this function)
HGraf.c:831: error: ‘WhenMapped’ undeclared (first use in this function)
HGraf.c:832: warning: implicit declaration of function ‘XChangeWindowAttributes’
HGraf.c:834: error: ‘hints’ undeclared (first use in this function)
HGraf.c:834: error: ‘PPosition’ undeclared (first use in this function)
HGraf.c:834: error: ‘PSize’ undeclared (first use in this function)
HGraf.c:834: error: ‘PMaxSize’ undeclared (first use in this function)
HGraf.c:834: error: ‘PMinSize’ undeclared (first use in this function)
HGraf.c:841: warning: implicit declaration of function ‘XSetStandardProperties’
HGraf.c:841: error: ‘None’ undeclared (first use in this function)
HGraf.c:843: warning: implicit declaration of function ‘XSelectInput’
HGraf.c:843: error: ‘ExposureMask’ undeclared (first use in this function)
HGraf.c:843: error: ‘KeyPressMask’ undeclared (first use in this function)
HGraf.c:843: error: ‘ButtonPressMask’ undeclared (first use in this function)
HGraf.c:844: error: ‘ButtonReleaseMask’ undeclared (first use in this function)
HGraf.c:844: error: ‘PointerMotionHintMask’ undeclared (first use in this function)
HGraf.c:844: error: ‘PointerMotionMask’ undeclared (first use in this function)
HGraf.c:845: warning: implicit declaration of function ‘XMapWindow’
HGraf.c:845: error: ‘theWindow’ undeclared (first use in this function)
HGraf.c:850: error: ‘report’ undeclared (first use in this function)
HGraf.c:851: error: ‘Expose’ undeclared (first use in this function)
HGraf.c:852: warning: implicit declaration of function ‘XSendEvent’
HGraf.c:852: error: ‘False’ undeclared (first use in this function)
HGraf.c: In function ‘TermHGraf’:
HGraf.c:861: error: ‘theDisp’ undeclared (first use in this function)
HGraf.c:862: warning: implicit declaration of function ‘XCloseDisplay’
make[1]: *** [HGraf.o] Error 1
make[1]: Leaving directory `/home/charles/bin/htk-3.4/HTKLib'
make: *** [HTKLib/HTKLib.a] Error 1
Thank you for any help you can provide.
The very first error may indicate the cause:
error: X11/Xlib.h: No such file or directory
At one time one needed to set $INCLUDE_PATH for gcc.
It looks to me that you are missing the X11 development packages.
So, the presence of a makefile.in indicates that the program is using autoconf. That being the case, I suggest you put both the makefile and makefile.in back the way they were, and instead redo the configure step:
GCC_VERSION=3.4.0 PREFIX=/usr/local/gcc/${GCC_VERSION}/bin/ CC=${PREFIX}gcc CPP=${PREFIX}g++ ./configure
Obviously, you should edit that to match the actual version of the compiler and path where you installed it, along with adding any extra configure arguments you need.
Are you sure you have the X11-devel package installed? Looks like an abject lack of X11 header files.
The first set of errors is
HGraf.c:73:77: error: X11/Xlib.h: No such file or directory
HGraf.c:74:23: error: X11/Xutil.h: No such file or directory
HGraf.c:75:21: error: X11/Xos.h: No such file or directory
HGraf.c:77:27: error: X11/keysymdef.h: No such file or directory
i.e. your compiler can't find the X11 headers. These will probably be somewhere like /usr/X11R6/include. Try adding that include path to your make command, like
make CFLAGS="$CFLAGS -I/usr/X11R6/include"
If the makefile is nonstandard you might have to edit it to insert this path. If you've run a configure script reconfigure with
./configure CFLAGS="$CFLAGS -I/usr/X11R6/include" # Include any other options
Install the gcc-3.4 from Ubuntu repos (sudo apt-get install gcc-4.3).
Then configure the project using ./configure CC="gcc-4.3" and make as usual.
This might not work, but point you in the right direction.
EDIT: The X11 development libraries on Ubuntu are named libx11-dev but they might not be the only development libraries you are missing: read the errors and try to guess what other libraries you are missing (if you note that a header is missing try searching http://packages.ubuntu.com for the file name and add the relative package using sudo apt-get install).

Resources