Opened 20 years ago

Last modified 20 years ago

#614 closed defect (fixed)

compile errors in .../ogr/ogrct.cpp

Reported by: dcw2@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Got the compile error below in this environment.  Can supply entire
configure/make session if you want it.  Unfamiliar with bugzilla etiquette,
sorry for any faux pas

/don

Solaris 9 (SunOS 5.9)
gcc (GCC) 3.3
GNU Make 3.80
GDAL 1.2.2

 g++ -Wall -O2 -Iogrsf_frmts -I. -I../port -I../gcore -I../ogr -I../alg
-I/usr/local/include -DPROJ_STATIC -DHAVE_GEOS=1 -I/usr/local/include -I../port
-I/usr/sfw -I/usr/sfw/include -I/usr/local/include -I/usr/local/include
-I/usr/sfw -I/usr/sfw/include -c ogrct.cpp  -fPIC -DPIC -o .libs/ogrct.o
ogrct.cpp: In function `int LoadProjLibrary()':
ogrct.cpp:207: error: invalid conversion from `int*(*)(...)' to `int*(*)()'
ogrct.cpp:210:19: warning: extra tokens at end of #ifdef directive
make[1]: *** [ogrct.o] Error 1
make[1]: Leaving directory `/opt/local/src/gdal-1.2.2/ogr'
make: *** [ogr-target] Error 2

Change History (4)

comment:1 by warmerdam, 20 years ago

Don,

I have committed a fix for the warning about the #ifdef test. However, that
doesn't seem to be at the core of the real problem.  The error is on the
line where pj_get_errno_ref is assigned.  

This function was added in PROJ 4.4.4.  One possibility is that you 
are using an old PROJ.4.  If so, please upgrade to the latest. 

I don't know what other explanation is reasonable.  I tried building with
static PROJ.4 enabled using gcc 3.3.3 on Linux and did not see the casting
issue you see.  

Looking into the PROJ.4 code, I see a C style prototype without "void" in
the brackets is provided.  Perhaps this is confusing things. I have committed
changes to CVS altering this:

    pfn_pj_get_errno_ref = pj_get_errno_ref;
    pfn_pj_strerrno = pj_strerrno;
    pfn_pj_dalloc = pj_dalloc;
#ifdef PJ_VERSION >= 446

to look like this:

    pfn_pj_get_errno_ref = (int *(*)(void)) pj_get_errno_ref;
    pfn_pj_strerrno = pj_strerrno;
    pfn_pj_dalloc = pj_dalloc;
#if PJ_VERSION >= 446

Could you try applying the same change and seeing if it fixes your build?

comment:2 by warmerdam, 20 years ago

This change has been committed in CVS.

comment:3 by dcw2@…, 20 years ago

Frank,

I made the changes to ogrct.cpp that you suggested and it now compiles OK.  

BTW, I'm using PROJ 4.4.8

I won't be run-time testing it until I've got my mapserver environment complete,
but I'm still fighting postgresql.  I'll let you know.

thanks,
/don

comment:4 by warmerdam, 20 years ago

Thanks Don.

Note: See TracTickets for help on using tickets.