Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » OpenCV and openCV_Demo copiling error
OpenCV and openCV_Demo copiling error [message #49620] Thu, 15 March 2018 17:54 Go to next message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi there,
I am trying to put in one application a functionality that takes a picture from an usb-cam: for this reason am studying the applications OpenCV and OpenCV_demo, but when I try to compile them (on Windows) I got "error C2059: syntax error : 'constant'" at line 170 of the file core/cvdef.h that is part of the OpenCV library; someone has been able to successfully compile those applications?
Regards,
gio

[Updated on: Thu, 15 March 2018 17:56]

Report message to a moderator

Re: OpenCV and openCV_Demo copiling error [message #49621 is a reply to message #49620] Fri, 16 March 2018 12:10 Go to previous messageGo to next message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
This is weird...
I created an empty project in U++ and put some test code to check if the OpenCv library was properly installed: the application compiles and runs as expected.
I put the very same code in a U++ project: I have the same compilation problem as above.
I think I am missing something.
Re: OpenCV and openCV_Demo copiling error [message #49622 is a reply to message #49620] Fri, 16 March 2018 13:56 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
I can confirm this (On Linux):

Core/config.h, ln: 69:

#define CPU_SSE2 1 << -- clashes with the CpuFeatures enumerators on cvdef.h, ln 166


Best regards,
Oblivion



[Updated on: Fri, 16 March 2018 13:56]

Report message to a moderator

Re: OpenCV and openCV_Demo copiling error [message #49660 is a reply to message #49622] Fri, 23 March 2018 10:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Works for me: Win32, MSC compiler; I have downloaded OpenCV library from the link in the package.

I need more info if you want me to look into this. (e.g. compiler, host, OpenCV whereabouts...)
Re: OpenCV and openCV_Demo copiling error [message #49661 is a reply to message #49660] Fri, 23 March 2018 11:51 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Mirek,

I did not download it separately. Latest version is available on Arch Linux by default. Maybe that could be a problem...

Arch Linux:

Linux:
Linux localhost 4.15.10-1-ARCH #1 SMP PREEMPT Thu Mar 15 12:24:34 UTC 2018 x86_64 GNU/Linux


Gcc:
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1/lto-wrapper
Hedef: x86_64-pc-linux-gnu
/build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp
seçenekleriyle yapılandırıldı.
posix
gcc version 7.3.1 20180312 (GCC) 



OpenCV, ver: 3.4.1, under /usr/include/opencv2/core


Aa I wrote in the above message, there is a name clash between a defined constant and enumerator (CPU_SSE2). E.g, the example is compiled successfully if I comment out Core/Config.h, ln 69.

Best regards,
Oblivion


[Updated on: Fri, 23 March 2018 12:00]

Report message to a moderator

Re: OpenCV and openCV_Demo copiling error [message #49662 is a reply to message #49660] Fri, 23 March 2018 18:50 Go to previous messageGo to next message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi Mirek,
I did not notice that there was a specific package of OpenCV, I was trying to compile on Windows 10, using MSVS15x64.

After your post, I downloaded and copied in uppsrc\plugin the "custom" opencv package, but there is still something that I miss.

The linker complained about the missing library opencv_core240d and other *240d libraries. In the opencv directory there were the same libs with 220d instead of 240d, so in the package organizer I changed *240d with *220d. There were also other libraries missing (I guess all from opencv), but in the lib directories of opencv there were nothing similar, so I simply deleted them. Namely, those libraries are:
-opencv_videostab240d
-libjasperd
-libjpegd
-libpngd
-libtiffd

With these modifications the package OpenCV_demo compiles and links, but when I launch it the system complains about missing MSVC100D.dll and MSVCP100D.dll. I googled them and I found that they are the debug dll of Visual C++ 2010. I reinstalled the Visual C++ 2010 Redistributable Package (it was already installed in my system), but with no luck.

Anyway, I am just testing on Windows, the final version of the software will run on Linux, so I will do further tests with linux.
Regards,
gio
Re: OpenCV and openCV_Demo copiling error [message #49664 is a reply to message #49662] Sun, 25 March 2018 13:16 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Giorgio

I have found the same problems. Now files and doc. are updated to OpenCV 3.4.1 for MSVC15x64 with instructions for Windows.
A trick to solve the name clash is included.
If you run it in Linux we could update the package and doc.


Best regards
Iñaki

[Updated on: Sun, 25 March 2018 13:17]

Report message to a moderator

Re: OpenCV and openCV_Demo copiling error [message #49668 is a reply to message #49664] Tue, 27 March 2018 18:27 Go to previous messageGo to next message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi Koldo,
I downloaded the updated OpenCV_Demo project and it compiles and runs as expected in Windows with MSVS15x64. Also, with the #undef trick I was able to successfully compile and run an application based on OpenCV libraries written by me. As far as regards linux, I downloaded and compiled the OpenCV libraries, I adjusted the build method of upp with the correct path for include and lib directories: OpenCV demo and my application compile and run. The only modification I had to do was to change the name of the libraries in the package organizer: instead of opencv_core I wrote libopencv_core.so and the same for the other libraries. Thank you very much for your effort.
I have a related issue maybe you can help me out with: is possible using opencv libraries to get a video stream from an usb-cam and show it in a upp control? My application does that, but it opens a window and I would like to have everything in only one window.
Regards,
gio
Re: OpenCV and openCV_Demo copiling error [message #49670 is a reply to message #49668] Tue, 27 March 2018 23:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hi Giorgio

Good news.

About real time video, I have not handled a video stream for many years.
However I would do two things:
- First, simple solution to have something simple up and running fast: Just setting U++ images
- Second, excellent quality: I would open a SDL control flushing all video there. If managed with a thread with synchronized frame output, better.


Best regards
Iñaki
Re: OpenCV and openCV_Demo copiling error [message #49685 is a reply to message #49670] Tue, 03 April 2018 09:25 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Thank you for the suggestions!
Previous Topic: FTP class and reference example for U++
Next Topic: ANSI Escape and control sequence parser for U++
Goto Forum:
  


Current Time: Fri Mar 29 09:52:02 CET 2024

Total time taken to generate the page: 0.01915 seconds