Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in installing in Ubuntu 12.04 #14

Closed
siddharthgoel88 opened this issue Feb 10, 2015 · 16 comments
Closed

Issue in installing in Ubuntu 12.04 #14

siddharthgoel88 opened this issue Feb 10, 2015 · 16 comments

Comments

@siddharthgoel88
Copy link

Post installation of the ibncurses-dev libopencv-dev libpulse-dev I was compiling the source code and I got the following error -

mkdir -p objs
gcc -Isrc/inc -O2 -Wall pkg-config --cflags opencv src/audio.c -c -o objs/audio.o
src/audio.c: In function ‘stream_write_callback’:
src/audio.c:75:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:77:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:77:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Wformat]
src/audio.c:77:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ [-Wformat]
src/audio.c:85:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:85:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Wformat]
src/audio.c:85:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ [-Wformat]
src/audio.c: In function ‘stream_read_callback’:
src/audio.c:109:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c: In function ‘callback’:
src/audio.c:241:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:241:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Wformat]
src/audio.c:247:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:251:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
src/audio.c:261:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
gcc -Isrc/inc -O2 -Wall pkg-config --cflags opencv src/display.c -c -o objs/display.o
gcc -Isrc/inc -O2 -Wall pkg-config --cflags opencv src/p2plib.c -c -o objs/p2plib.o
gcc -Isrc/inc -O2 -Wall pkg-config --cflags opencv src/p2pvc.c -c -o objs/p2pvc.o
gcc -Isrc/inc -O2 -Wall pkg-config --cflags opencv src/video.c -c -o objs/video.o
src/video.c:1:16: fatal error: cv.h: No such file or directory
compilation terminated.
make: *** [objs/video.o] Error 1

@emgram769
Copy link
Contributor

what do you get when you run pkg-config --cflags opencv?

@cpd85 cpd85 closed this as completed in 10f66ed Feb 10, 2015
@cpd85
Copy link
Collaborator

cpd85 commented Feb 10, 2015

@siddharthgoel88 can you try again?

@siddharthgoel88
Copy link
Author

It still does not worked for me.
On typing pkg-config --cflags opencv I am getting following --
-I/usr/include/opencv

@mofarrell
Copy link
Owner

Can you check your opencv installation. It seems like the header for the library isn't where the compiler is looking for it.
/usr/include/opencv/cv.h

@siddharthgoel88
Copy link
Author

First point is that I do not have opencv installed but opencv2 got installed when I tried to install opencv through command line. Second that also does not have cv.h file. Look at the directory structure below -

opencv2/
├── calib3d
│   └── calib3d.hpp
├── contrib
│   ├── contrib.hpp
│   └── retina.hpp
├── core
│   ├── core_c.h
│   ├── core.hpp
│   ├── eigen.hpp
│   ├── internal.hpp
│   ├── mat.hpp
│   ├── operations.hpp
│   ├── types_c.h
│   ├── version.hpp
│   └── wimage.hpp
├── features2d
│   └── features2d.hpp
├── flann
│   ├── all_indices.h
│   ├── allocator.h
│   ├── any.h
│   ├── autotuned_index.h
│   ├── composite_index.h
│   ├── config.h
│   ├── defines.h
│   ├── dist.h
│   ├── dummy.h
│   ├── dynamic_bitset.h
│   ├── flann_base.hpp
│   ├── flann.hpp
│   ├── general.h
│   ├── ground_truth.h
│   ├── hdf5.h
│   ├── heap.h
│   ├── hierarchical_clustering_index.h
│   ├── index_testing.h
│   ├── kdtree_index.h
│   ├── kdtree_single_index.h
│   ├── kmeans_index.h
│   ├── linear_index.h
│   ├── logger.h
│   ├── lsh_index.h
│   ├── lsh_table.h
│   ├── matrix.h
│   ├── miniflann.hpp
│   ├── nn_index.h
│   ├── object_factory.h
│   ├── params.h
│   ├── random.h
│   ├── result_set.h
│   ├── sampling.h
│   ├── saving.h
│   ├── simplex_downhill.h
│   └── timer.h
├── gpu
│   ├── devmem2d.hpp
│   ├── gpu.hpp
│   ├── gpumat.hpp
│   ├── matrix_operations.hpp
│   ├── NCV.hpp
│   ├── NPP_staging.hpp
│   └── stream_accessor.hpp
├── highgui
│   ├── highgui_c.h
│   └── highgui.hpp
├── imgproc
│   ├── imgproc_c.h
│   ├── imgproc.hpp
│   └── types_c.h
├── legacy
│   ├── blobtrack.hpp
│   ├── compat.hpp
│   ├── legacy.hpp
│   └── streams.hpp
├── ml
│   └── ml.hpp
├── objdetect
│   └── objdetect.hpp
├── opencv.hpp
└── video
├── background_segm.hpp
├── tracking.hpp
└── video.hpp

12 directories, 71 files

@emgram769
Copy link
Contributor

on my machine there is a file /usr/include/opencv/cv.h

@robincsamuel
Copy link

Same error here on ubuntu 14.04. I guess its something with opencv

gcc -Isrc/inc -O2 -Wall -DPA_USE_ALSA pkg-config --cflags opencv src/audio.c -c -o objs/audio.o
\In file included from src/audio.c:36:0:
src/inc/pa_util.h:78:9: error: unknown type name ‘PaHostApiTypeId’
PaHostApiTypeId type );
^
src/inc/pa_util.h:91:9: error: unknown type name ‘PaDeviceIndex’
PaDeviceIndex hostApiDevice, PaDeviceIndex device,
^
src/inc/pa_util.h:91:39: error: unknown type name ‘PaDeviceIndex’
PaDeviceIndex *hostApiDevice, PaDeviceIndex device,
^
src/inc/pa_util.h:111:35: error: unknown type name ‘PaHostApiTypeId’
void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode,
^
src/audio.c:90:5: error: unknown type name ‘PaStreamCallbackTimeInfo’
const PaStreamCallbackTimeInfo
timeInfo,
^
src/audio.c:91:5: error: unknown type name ‘PaStreamCallbackFlags’
PaStreamCallbackFlags statusFlags,
^
src/audio.c:114:5: error: unknown type name ‘PaStreamCallbackTimeInfo’
const PaStreamCallbackTimeInfo* timeInfo,
^
src/audio.c:115:5: error: unknown type name ‘PaStreamCallbackFlags’
PaStreamCallbackFlags statusFlags,
^
src/audio.c: In function ‘start_audio’:
src/audio.c:169:3: error: unknown type name ‘PaStreamParameters’
PaStreamParameters inputParameters,
^
src/audio.c:212:19: error: request for member ‘device’ in something not a structure or union
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device /
^
src/audio.c:212:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’ [-Wimplicit-function-declaration]
outputParameters.device = Pa_GetDefaultOutputDevice(); /
default output device /
^
src/audio.c:213:23: error: request for member ‘device’ in something not a structure or union
if (outputParameters.device == paNoDevice) {
^
src/audio.c:217:19: error: request for member ‘channelCount’ in something not a structure or union
outputParameters.channelCount = NUM_CHANNELS;
^
src/audio.c:218:19: error: request for member ‘sampleFormat’ in something not a structure or union
outputParameters.sampleFormat = PA_SAMPLE_TYPE;
^
src/audio.c:219:19: error: request for member ‘suggestedLatency’ in something not a structure or union
outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;
^
src/audio.c:219:72: error: request for member ‘device’ in something not a structure or union
outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;
^
src/audio.c:220:19: error: request for member ‘hostApiSpecificStreamInfo’ in something not a structure or union
outputParameters.hostApiSpecificStreamInfo = NULL;
^
src/audio.c:229:7: error: ‘writeCallback’ undeclared (first use in this function)
writeCallback,
^
src/audio.c:229:7: note: each undeclared identifier is reported only once for each function it appears in
src/audio.c:230:7: warning: passing argument 2 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘PaDeviceID’ but argument is of type ‘void *’
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:230:7: warning: passing argument 3 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘int
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:230:7: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘void ’ but argument is of type ‘int’
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:230:7: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘struct paTestData
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:230:7: error: too few arguments to function ‘Pa_OpenStream’
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: declared here
PaError Pa_OpenStream( PortAudioStream** stream,
^
src/audio.c:235:18: error: request for member ‘device’ in something not a structure or union
inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device /
^
src/audio.c:235:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’ [-Wimplicit-function-declaration]
inputParameters.device = Pa_GetDefaultInputDevice(); /
default input device /
^
src/audio.c:236:22: error: request for member ‘device’ in something not a structure or union
if (inputParameters.device == paNoDevice) {
^
src/audio.c:240:18: error: request for member ‘channelCount’ in something not a structure or union
inputParameters.channelCount = NUM_CHANNELS;
^
src/audio.c:241:18: error: request for member ‘sampleFormat’ in something not a structure or union
inputParameters.sampleFormat = PA_SAMPLE_TYPE;
^
src/audio.c:242:18: error: request for member ‘suggestedLatency’ in something not a structure or union
inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency;
^
src/audio.c:242:70: error: request for member ‘device’ in something not a structure or union
inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency;
^
src/audio.c:243:18: error: request for member ‘hostApiSpecificStreamInfo’ in something not a structure or union
inputParameters.hostApiSpecificStreamInfo = NULL;
^
src/audio.c:252:7: error: ‘readCallback’ undeclared (first use in this function)
readCallback,
^
src/audio.c:253:7: warning: passing argument 2 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘PaDeviceID’ but argument is of type ‘int *’
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:253:7: warning: passing argument 3 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:253:7: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘void ’ but argument is of type ‘int’
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:253:7: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast [enabled by default]
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘struct paTestData
PaError Pa_OpenStream( PortAudioStream
* stream,
^
src/audio.c:253:7: error: too few arguments to function ‘Pa_OpenStream’
&data);
^
In file included from src/audio.c:34:0:
/usr/include/portaudio.h:325:9: note: declared here
PaError Pa_OpenStream( PortAudioStream** stream,
^
make: *** [objs/audio.o] Error 1

@zphj1987
Copy link

i have the same problem :
root@zphj1987-virtual-machine:~/p2p/p2pvc-master# make
gcc -Isrc/inc -O2 -Wall -DPA_USE_ALSA pkg-config --cflags opencv src/audio.c -c -o objs/audio.o
In file included from src/audio.c:36:0:
src/inc/pa_util.h:78:9: error: unknown type name ‘PaHostApiTypeId’
PaHostApiTypeId type );
^
src/inc/pa_util.h:91:9: error: unknown type name ‘PaDeviceIndex’
PaDeviceIndex *hostApiDevice, PaDeviceIndex device,

what's wrong? My system is ubuntu14.04

@emgram769
Copy link
Contributor

what version of portaudio are you running?

@emgram769 emgram769 reopened this Feb 11, 2015
@zphj1987
Copy link

root@zphj1987-virtual-machine:~/p2p/p2pvc-master# dpkg --list|grep portaudio
ii libportaudio-dev 18.1-7.1 amd64 Portable audio I/O - development files
ii libportaudio0 18.1-7.1 amd64 Portable audio I/O - shared library
ii libportaudio2:amd64 19+svn20140130-1 amd64 Portable audio I/O - shared library

@emgram769
Copy link
Contributor

could you try installing 19?

@robincsamuel
Copy link

I just tried apt-get install, and from the installation message, I guess its 18.1-7.1
Setting up libportaudio0 (18.1-7.1) ...
Setting up libportaudio-dev (18.1-7.1)

@zphj1987
Copy link

i install portaudio19-dev it to be well
root@zphj1987-virtual-machine:/p2p/p2pvc-master# dpkg --list|grep portaudio
rc libportaudio0 18.1-7.1 amd64 Portable audio I/O - shared library
ii libportaudio2:amd64 19+svn20140130-1 amd64 Portable audio I/O - shared library
ii libportaudiocpp0:amd64 19+svn20140130-1 amd64 Portable audio I/O C++ bindings - shared library
ii portaudio19-dev 19+svn20140130-1 amd64 Portable audio I/O - development files
root@zphj1987-virtual-machine:
/p2p/p2pvc-master#

but have new problem

root@zphj1987-virtual-machine:~/p2p/p2pvc-master# make
gcc -Isrc/inc -O2 -Wall -DPA_USE_ALSA pkg-config --cflags opencv objs/audio.o objs/display.o objs/p2plib.o objs/p2pvc.o objs/pa_allocation.o objs/pa_converters.o objs/pa_cpuload.o objs/pa_debugprint.o objs/pa_dither.o objs/pa_front.o objs/pa_process.o objs/pa_ringbuffer.o objs/pa_stream.o objs/pa_trace.o objs/pa_unix_hostapis.o objs/pa_unix_util.o objs/video.o -o p2pvc -lpthread -lncurses -lportaudio pkg-config --libs opencv
/usr/bin/ld: objs/pa_unix_util.o: undefined reference to symbol 'floor@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [p2pvc] Error 1

@emgram769
Copy link
Contributor

what is the output of pkg-config --libs opencv? specifically, does it include -lm?

@zphj1987
Copy link

root@zphj1987-virtual-machine:~/p2p/p2pvc-master# pkg-config --libs opencv
/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so /usr/lib/x86_64-linux-gnu/libopencv_contrib.so /usr/lib/x86_64-linux-gnu/libopencv_core.so /usr/lib/x86_64-linux-gnu/libopencv_features2d.so /usr/lib/x86_64-linux-gnu/libopencv_flann.so /usr/lib/x86_64-linux-gnu/libopencv_gpu.so /usr/lib/x86_64-linux-gnu/libopencv_highgui.so /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so /usr/lib/x86_64-linux-gnu/libopencv_legacy.so /usr/lib/x86_64-linux-gnu/libopencv_ml.so /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so /usr/lib/x86_64-linux-gnu/libopencv_ocl.so /usr/lib/x86_64-linux-gnu/libopencv_photo.so /usr/lib/x86_64-linux-gnu/libopencv_stitching.so /usr/lib/x86_64-linux-gnu/libopencv_superres.so /usr/lib/x86_64-linux-gnu/libopencv_ts.so /usr/lib/x86_64-linux-gnu/libopencv_video.so /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab

i do the
export LDFLAGS="$LDFLAGS -lm" in the shell
no error happen

@emgram769
Copy link
Contributor

cool, thanks. I'll add it to the makefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants