RE: [Flightgear-devel] FGFS Link Error

2002-04-20 Thread Norman Vine

Paul Deppe writes:
>
>When making the latest CVS FGFS on Cygwin/Win2k, the following
>link error occurs:

>/usr/lib/libplibul.a(ulContext.o)(.text+0x47):ulContext.cxx: undefined
>reference
> to `wglGetCurrentContext@0'
>collect2: ld returned 1 exit status
>
>It looks like the link order is wrong - the PLIB libraries should be linked
>before the OpenGL libraries.  But a check of src/Main/Makefile shows:
>
>fgfs: $(fgfs_OBJECTS) $(fgfs_DEPENDENCIES)
>   @rm -f fgfs
>   $(CXXLINK) $(fgfs_LDFLAGS) $(fgfs_OBJECTS) $(fgfs_LDADD) $(LIBS)
>
>and from src/Main/Makefile.am:
>
>fgfs_LDADD = \
>   $(top_builddir)/src/Aircraft/libAircraft.a \
>... lots more libraries...
>   $(THREAD_LIBS) \
>   -lplibpu -lplibfnt -lplibnet -lplibssg -lplibsg \
>   -lmk4 -lz \
>   $(opengl_LIBS) \
>   $(audio_LIBS)
>
>..which looks correct and hasn't changed in a few days.  Yes, this was a
>clean rebuild from autogen.sh on up.  The dates on the src/Main/Makefile*
>files are correct.  automake: 1.4-p5 (14).  This was working yesterday.
Any
>ideas?

PLib has been reorganized to better support MacOSX and the check for
a valid OpenGL context was moved from libplibssg into libplibul

The link problem stems from automake including libraries automatically
included by the AC_CHECK_LIB macro at the end of the linked libs

It appears as if the easiest way to fix this is to change the line in the
Main / Makefile.am file that includes the other PLib libraries to also
include -lplbul

Note that this is probably only a Cygwin problem and will not appear on
Unix because of the difference in the way linking is done.
On Cygwin all symbols must be defined at link time.  ie
ld --no-undef   behaviour in Linux

ld allows including a library more then once in the link library list
so this should not be a problem

Cheers

Norman

=== cut ==
src / Main / Makefile.am
86c86
< -lplibpu -lplibfnt -lplibnet -lplibssg -lplibsg \
---
> -lplibpu -lplibfnt -lplibnet -lplibssg -lplibsg -lplibul \


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel



Re: [Flightgear-devel] FGFS Link Error

2002-04-20 Thread Julian Foad

Paul Deppe wrote:
> 
> When making the latest CVS FGFS on Cygwin/Win2k, the following link error
> occurs:
> 
> /usr/lib/libplibul.a(ulContext.o)(.text+0x47):ulContext.cxx: undefined
> reference to `wglGetCurrentContext@0'
> collect2: ld returned 1 exit status

I don't know the reason for it, but you can work around it temporarily by patching 
plib/src/util/ulContext.cxx: ulIsValidContext() so that it just returns "true" without 
trying to call wglGetCurrentContext.

  bool ulIsValidContext ( void )
  {
- #if defined(CONSOLE)
+ #if 1 // defined(CONSOLE)
return true ;
  #elif defined(WIN32)
return ( wglGetCurrentContext () != NULL ) ;
  #elif defined(macintosh)
return ( aglGetCurrentContext () != NULL ) ;
  #elif defined(__APPLE__)
return ( CGLGetCurrentContext () != NULL ) ;
  #else
return ( glXGetCurrentContext () != NULL ) ;
  #endif
  }

I'll ask Sebastian Ude on the plib list about this, because he has just moved that 
function from a different module (plib/src/ssg/ssg.cxx).

- Julian

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel