From: Jorge S. S. <jsa...@gm...> - 2010-04-26 20:31:05
Attachments:
win32_compilation_issues.patch
|
Hello all, I have prepared a patch with all the modifications I have done to player code to successfully compile on windows with Visual Studio 2008. All modifications should be innocuous for Linux compilation, as they are all included on precompiler directives of kind: #if defined WIN32 ...include some files... ...defines missing on windows... #else ...include some others... #endif In fact, I have successfully compiled my code on Linux. I hope the path will work with no problems.... is the first time I use patch generation tools (by the way, I have used tortoise SVN). I have tried it on Linux and it works fine for me. Best regards, Jorge |
From: Paul O. <new...@ki...> - 2010-04-27 06:51:26
|
Hi Jorge, Your patch is great even if it has some surprising places (for example, removes inclusion of stdlib.h in imageseq.cc - fortunately, I can't see any reason for this inclusion in whole imageseq code, so it is acceptable). Other thing is your SIGQUIT definition in playerv.c: if win api does not define that, it means it does not support that, so it shouldn't be done like that. More portable and system independent solution is: #ifdef SIGINT signal(SIGINT, sig_quit); #endif #ifdef SIGQUIT signal(SIGQUIT, sig_quit); #endif If you're able to compile imageseq.cc driver it means you've managed with opencv integration with player. How did you do that? Did you install pkgconfig for windows? (there's a pkg-config.exe binary available for download, however opencv for Windows does not provide opencv.pc file, did you prepare one for your own? how?! I couldn't manage with that). Did you managed with compilation of my cvcam driver too? Did you integrate libjpeg for windows with Player? (for cameracompress driver). Is it though problem? Paul On Mon, 26 Apr 2010, Jorge Santos Simón wrote: > Hello all, > > I have prepared a patch with all the modifications I have done to > player code to successfully compile on windows with Visual Studio > 2008. > All modifications should be innocuous for Linux compilation, as they > are all included on precompiler directives of kind: > > #if defined WIN32 > ...include some files... > ...defines missing on windows... > #else > ...include some others... > #endif > > In fact, I have successfully compiled my code on Linux. > > I hope the path will work with no problems.... is the first time I > use patch generation tools (by the way, I have used tortoise SVN). > I have tried it on Linux and it works fine for me. > > Best regards, > Jorge > |
From: Jorge S. S. <jsa...@gm...> - 2010-04-27 18:50:49
|
Hi, thanks. Yes, you are right #define SIGQUIT 3 is a dirty workaround. I'll change the code as you propose. Yes, I have removed #include stdlib.h in imageseq.cc even for UNIX because it is not necessary. There is also a #define M_PI that should be replaced by the precompiler option _USE_MATH_DEFINES, added to the project, as I have done for pmap and lodo I have managed to include OpenCV; it's not so tricky. The steps are: * Configure + generate OpenCV with CMake to obtain the opencv.pc file * Add the path containing this file to PKG_CONFIG_PATH env. variable * Add OpenCV2.1 path to CMAKE_MODULE_PATH env. variable (not sure if this is realy necessary...) As pkgconfig I use the one packaged with the gtk+ windows distribution, because is the only that reliably finds gtk+ packages. By the way, pkgconfig is necessary for a lot of drivers and most utilities Yes, I can compile cvcam To include libjpeg, I use the lib and includes provided by cygwin. The steps are: * Include option HAVE_JPEG as true in CMake to include the playerjpeg project in the solution * Provide cygwin\lib and cygwin\include paths to VS (cygwin\usr\include in my cygwin installation) * Rename cygwin\lib\libjpeg.dll.a as jpeg.lib (or change the project settings to use libjpeg.dll.a) * Playerjpeg must be compiled as an static .lib library, instead of as a .dll * Include jpeg.lib in playerv, playerc... (maybe I forget one or two projects) I have recently managed to compile all this stuff, son I haven't still tried it. It compiles, but I'm not sure if all will work correctly.... By the way, I wonder if all this modifications (and some others I made before) can be included in the CMakeList.txt files to make windows compilation (at least with VS 2008) as easy as it is on linux. Unfortunately, I know almost nothing of CMake, so I don't know how to do it. Regards, Jorge > Hi Jorge, > > Your patch is great even if it has some surprising places (for > example, removes inclusion of stdlib.h in imageseq.cc - fortunately, I > can't see any reason for this inclusion in whole imageseq code, so it is > acceptable). Other thing is your SIGQUIT definition in playerv.c: if win > api does not define that, it means it does not support that, so it > shouldn't be done like that. More portable and system independent > solution is: > #ifdef SIGINT > signal(SIGINT, sig_quit); > #endif > #ifdef SIGQUIT > signal(SIGQUIT, sig_quit); > #endif > > If you're able to compile imageseq.cc driver it means you've managed with > opencv integration with player. How did you do that? Did you install > pkgconfig for windows? (there's a pkg-config.exe binary available for > download, however opencv for Windows does not provide opencv.pc file, did > you prepare one for your own? how?! I couldn't manage with that). Did you > managed with compilation of my cvcam driver too? > > Did you integrate libjpeg for windows with Player? (for cameracompress > driver). Is it though problem? > > Paul |
From: Paul O. <new...@ki...> - 2010-04-27 19:40:57
|
> There is also a #define M_PI that should be replaced by the precompiler > option _USE_MATH_DEFINES, > added to the project, as I have done for pmap and lodo > I guess this _USE_MATH_DEFINES is a winapi specific feature, therefore I feel your previous fix was more portable (see playercommon.h). > > I have managed to include OpenCV; it's not so tricky. The steps are: > > * Configure + generate OpenCV with CMake to obtain the opencv.pc file Well, I tried to write my own opencv.pc file for downloaded OpenCV binaries (library with installer), I couldn't figure out how to manage with different path notations in two worlds (Windows vs pkgconfig taken directly from Unix). Also I had some link-time issues, I don't remember now. Can you put your complete patch on a patch tracker for Player project? Paul |
From: Geoff B. <gb...@ki...> - 2010-04-27 21:18:31
|
If you use pykg-config, you shouldn't have any problems with paths if you use /. It also handles things like spaces properly on Windows. http://github.com/gbiggs/pykg-config If you have problems using it, please file a bug. :) Geoff On 28/04/2010 4:40 a.m., Paul Osmialowski wrote: >> I have managed to include OpenCV; it's not so tricky. The steps are: >> >> * Configure + generate OpenCV with CMake to obtain the opencv.pc file > > Well, I tried to write my own opencv.pc file for downloaded OpenCV > binaries (library with installer), I couldn't figure out how to manage > with different path notations in two worlds (Windows vs pkgconfig taken > directly from Unix). Also I had some link-time issues, I don't remember > now. > > Can you put your complete patch on a patch tracker for Player project? > > Paul |
From: Jorge S. S. <jsa...@gm...> - 2010-04-28 19:34:29
Attachments:
win32_compilation_issues.patch
opencv.pc
|
Hi all, I have regenerated the patch with your suggestions: -#define SIGQUIT 3 replaced by +#ifdef SIGINT signal(SIGINT, sig_quit); +#endif +#ifdef SIGQUIT signal(SIGQUIT, sig_quit); +#endif And an extra include on pmap.cc to avoid the precomp. option _USE_MATH_DEFINES I have uploaded it on the project patch tracker (2993776) I attach also the opencv.pc file I use. It is the one contained in the unix-install directory, generated by CMake. It contains windows-like paths, so my pkg-config executable for windows (the one packaged with GTK+) has no problems. I hope this will help. Let me know what linkage problems you have. Maybe I can help. If you want, I can send you the list of tweaks I have made to compile all the stuff. The big idea, I think, is to reduce at minimum the tweaks required to compile on Windows, but I should learn CMake to succeed in the task. Best regards, Jorge > If you use pykg-config, you shouldn't have any problems with paths if > you use /. It also handles things like spaces properly on Windows. > > http://github.com/gbiggs/pykg-config > > If you have problems using it, please file a bug. :) > > Geoff On 28/04/2010 4:40 a.m., Paul Osmialowski wrote: > >> I have managed to include OpenCV; it's not so tricky. The steps are: > >> > >> * Configure + generate OpenCV with CMake to obtain the opencv.pc file > > > > Well, I tried to write my own opencv.pc file for downloaded OpenCV > > binaries (library with installer), I couldn't figure out how to manage > > with different path notations in two worlds (Windows vs pkgconfig taken > > directly from Unix). Also I had some link-time issues, I don't remember > > now. > > > > Can you put your complete patch on a patch tracker for Player project? > > > > Paul |