Hi Allard,
> I've fixed most of the problems I had building libpano (SVN1093 a.k.a.
> beta3) with CMake on windows, but there's one little thing I still
> can't get right.
Nice :)
> First the solved problems:
>
> I had to replace "ADD_DEFINITIONS(-D__Win__)" in Cmakelists.txt with
> "ADD_DEFINITIONS(-D__Ansi__)" to get rid of some unresolved symbol
> errors (thanks for the tip Jim Watters)
What is your compiler, maybe we could do it compiler-dependent
> In fftn.c, the following line of code produced 'not found' errors
> # include __FILE__
How is it possible, that _FILE_ does not expand to a valid path on your system?
> so I replaced it by
> # include "fftn.c"
>
> Then, there is apparently some confusion about where the pano13.lib is
> supposed to be located. When building the debug version, it is created
> in the folder 'Debug', which is created under the build directory. But
> subsequent tools sometimes expect it to be in the 'tools' folder.
> Copying pano13.lib there eliminates the errors. <edit> upgrading to
> svn1098 also
This Debug-folder was new to me. Somehow I start to think, that even cmake is very platform independent.
Don't have here appropiate windows machine, so cannot help much.
You may try add this library in tools/CMakeLists.txt
line 18++:
if(WIN32)
list(APPEND commands panoinfo)
list(APPEND _common_libs ../Debug/pano13.lib)
endif()
> After this, a lot of unresolved symbol errors related to getopt kept
> showing up. Copying the compat_win32 folder all over the place didn't
> help. Finally, I managed to get rid of them by adding the following
> line to PTCommon.c:
> #include "tools/compat_win32/getopt.c"
> Only the .h file was included, apparently this was not enough.
Here I would add tools/compat_win32/getopt.c to the list of sources ov pano13 lib
like (from line 46 on):
IF(WIN32)
SET(wxWidgets_ROOT_DIR ${SOURCE_BASE_DIR}/wxWidgets-2.8.10)
ADD_DEFINITIONS(-D__Win__)
FIND_PACKAGE(wxWidgets REQUIRED)
SET(win_c tools/compat_win32/getopt.c)
ENDIF(WIN32)
> I don't know if all of these solutions I found by trial and error are
> good practice, but they seem to have worked. Suggestions for how to do
> it better are welcome. All tools build now, except for PTBlender. This
> gives an error that says:
>
> "pano13.lib(ColourBrightness.obj) : error LNK2019: unresolved external
> symbol _htons@4 referenced in function _OutputPhotoshopCurve"
_htons is network. It transforms local (short) data to network order.
On OpenSuSE it is in library /usr/lib/libc.a, which is part of package glibc-devel.
> Any idea what could cause that?
>
> Allard
>
Please try and report here.
Kornel
--
Kornel Benko
Kornel...@berlin.de
Could you please post this line?
> > This Debug-folder was new to me. Somehow I start to think, that even
> > cmake is very platform independent. Don't have here appropiate windows
> > machine, so cannot help much.
> >
> > You may try add this library in tools/CMakeLists.txt
> >
> > line 18++:
> > if(WIN32)
> > list(APPEND commands panoinfo)
> > list(APPEND _common_libs ../Debug/pano13.lib)
> > endif()
>
> I think this problem has already been solved in 1098 so this is no
> longer necessary
Good.
> > Here I would add tools/compat_win32/getopt.c to the list of sources ov
> > pano13 lib
> >
> > like (from line 46 on):
> > IF(WIN32)
> > SET(wxWidgets_ROOT_DIR
> > ${SOURCE_BASE_DIR}/wxWidgets-2.8.10) ADD_DEFINITIONS(-D__Win__)
> > FIND_PACKAGE(wxWidgets REQUIRED)
> > SET(win_c tools/compat_win32/getopt.c)
> > ENDIF(WIN32)
>
> That works! Thanks, allard
Ok, I will add it.
--
Kornel Benko
Kornel...@berlin.de
This lib should be added to ${_common_libs}
CMakeLists.txt:68
set(_common_libs ${TIFF_LIBRARIES} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES})
if(WIN32)
find_library(WXSOCK32 wsock32)
if(NOT ${WXSOCK32} MATCHES "-NOTFOUND")
list(APPEND _common_libs ${WXSOCK32})
endif()
endif(WIN32)
...
> Allard
--
Jim Watters
http://photocreations.ca
This is, what he was saying.
Instead of calling
x = htons(y)
we should use
short * px = &x;
SHORTNUMBER(y, px);
or better define own function
short our_htons(short y)
{
short x;
short * px = &x;
SHORTNUMBER(y, px);
return(x);
}
The only file which uses htons is ColourBrightness.c, not much work.
Kornel
--
Kornel Benko
Kornel...@berlin.de
I missed that one.
Back to the problem.
If nobody objects, I will
1.) replace calls to htons() in ColourBrightness.c with local implementation using macro SHORTNUMBER()
2.) Add "tools/compat_win32/getopt.c" to ${win_c} in CMakeLists.txt
The problem with __FILE__ (in fftn.c) will still be there without general solution.