libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking with fltk-1.1


From: Ted Irons
Subject: Re: linking with fltk-1.1
Date: Wed, 13 Feb 2002 18:41:56 -0700

Tim -

Thanks for the reply.  The "-mconsole" link flag made
no difference.   As per the cygwin user's guide I'm
using '-mwindows -Wl,-e,_mainCRTStartup' - to get
a GUI app in cygwin.

I am including the link line and debugger output for toyView.exe.
I am running gdb in emacs.   (It is odd that I don't get the "error reading 
line numbers"
messages  when I run 'gdb ./toyView.exe' from the command line.)
Maybe this might shed some light on the "disconnect" that I talked about
earlier.   I seem to only get these problems when I'm linking to the fltk libs.

Thanks again,
- Ted


/bin/sh ../../libtool --mode=link g++ -DLittleEndian  -I/usr/local/include  
-I../../../LADARDataModel/src        -g -DWIN32 -Dx86   -o toyView.exe 
-no-undefined -mwindows -Wl,-e,_mainCRTStartup AuxViewWin.o ControllerWin.o 
HelpText.o LdrMainViewWinCb.o LdrMainViewWinHandle.o LdrViewWin.o 
TopLevelMenuBar.o TopLevelWin.o ViewWinHandle.o toyView.o 
../../src/View/libView.la ../../src/SimData/libSimData.la 
../../src/Shape/libShape.la ../../src/Util/libUtil.la -L/usr/local/lib 
-lfltk_gl -lfltk -lglut -lglu32
-lopengl32 -lwsock32 -lm

g++ -DLittleEndian -I/usr/local/include -I../../../LADARDataModel/src -g 
-DWIN32 -Dx86 -o toyView.exe -mwindows -Wl,-e -Wl,_mainCRTStartup AuxViewWin.o 
ControllerWin.o HelpText.o LdrMainViewWinCb.o LdrMainViewWinHandle.o 
LdrViewWin.o TopLevelMenuBar.o TopLevelWin.o ViewWinHandle.o toyView.o  
../../src/View/.libs/libView.a -L/usr/local/lib -L/usr/lib -L/usr/lib/w32api 
-L/bin/../lib/gcc-lib/i686-pc-cygwin/2.95.3-5 -L/bin/../lib/gcc-lib 
-L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5 -lgcc -lgcc
../../src/SimData/.libs/libSimData.a -lgcc -lgcc 
../../src/Shape/.libs/libShape.a -lgcc -lgcc ../../src/Util/.libs/libUtil.a 
-lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc 
-lfltk_gl -lfltk -lglut -lglu32 -lopengl32 -lwsock32



Current directory is d:\cygwin\usr\local\tmp\cygwin\src\ldrView/
GNU gdb 5.0 (20010428-3)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /usr/local/tmp/cygwin/src/ldrView/toyView.exe
"/cygdrive/c/WINNT/system32/KERNEL32.dll": error reading line numbers

"/cygdrive/c/WINNT/system32/ADVAPI32.dll": error reading line numbers

"/cygdrive/c/WINNT/System32/GLU32.DLL": error reading line numbers

"/cygdrive/c/WINNT/System32/OPENGL32.dll": error reading line numbers

"/cygdrive/c/WINNT/System32/DCIMAN32.dll": error reading line numbers

"/cygdrive/c/WINNT/System32/WINMM.dll": error reading line numbers

"/cygdrive/c/WINNT/System32/mmdrv.dll": error reading line numbers

"/cygdrive/c/WINNT/System32/MCD32.DLL": error reading line numbers

GL mode is (FL_RGB | FL_DOUBLE | FL_DEPTH)

Program received signal SIGSEGV, Segmentation fault.
0x0043fd92 in TopLevelWin::_Resize (this=0x10042d00)
    at ../../../LADARDataModel/src/ldrView/TopLevelWin.h:202
Current language:  auto; currently c++
(gdb) where
#0  0x0043fd92 in TopLevelWin::_Resize (this=0x10042d00)
    at ../../../LADARDataModel/src/ldrView/TopLevelWin.h:202
#1  0x0044d303 in TopLevelWin::resize (this=0x10042d00, x=4, y=7, w=800, h=825)
    at ../../../LADARDataModel/src/ldrView/TopLevelWin.h:218
#2  0x004287f2 in address@hidden ()
    at ../../../LADARDataModel/src/Util/BatchNew.C:107
#3  0x77e71303 in $R005528 ()
#4  0x77e71962 in $R005528 ()
#5  0x77f763ef in ?? ()
#6  0x0042911c in Fl_Window::show ()
    at ../../../LADARDataModel/src/Util/BatchNew.C:107
#7  0x0040ad66 in TopLevelWin::TopLevelWin (this=0x10042d00, address@hidden,
    address@hidden, wd=800, ht=800,
    label=0x40bfcb "A picture of the platform.")
    at ../../../LADARDataModel/src/ldrView/TopLevelWin.C:146
#8  0x004409a3 in toyViewWin::toyViewWin (this=0x10042d00, address@hidden,
    address@hidden, wd=800, hy=800,
    label=0x40bfcb "A picture of the platform.")
    at ../../../LADARDataModel/src/ldrView/toyView.C:10
#9  0x0040c17b in main (argc=1, argv=0x100425c8)
    at ../../../LADARDataModel/src/ldrView/toyView.C:31
#10 0x61003f8e in _libuser32_a_iname ()
#11 0x61004282 in _libuser32_a_iname ()
#12 0x610042c1 in _libuser32_a_iname ()
#13 0x0041e33b in cygwin_crt0 ()
    at ../../../LADARDataModel/src/Util/BatchNew.C:107
#14 0x0040103d in mainCRTStartup ()
#15 0x77f1b9ea in ?? ()
(gdb) quit

Debugger finished



Tim Van Holder wrote:

> On Wed, 2002-02-13 at 03:01, Ted Irons wrote:
> > We are using cygwin (1.3.9) with fltk-1.1 on a
> > Windows NT machine.
> >
> > Our C++ package uses autoconf, automake, and
> > libtool to maintain the build system.
> > CXXFLAGS contains -DWIN32.
> > LDFLAGS contains -no-undefined and -mwindows.
> > configure.ac contains the AC_LIBTOOL_WIN32_DLL.
> > However, when I run configure I'm using the --disable-shared flag.
> >
> > The program has fltk, glut, and opengl calls.
> > Fltk was built using its configure under cygwin
> > (one of the flags that this sets is -DWIN32).   The fltk
> > test programs build and run fine.
> >
> > Since the program seg faults  (in an fltk call)
> > when invoked,  I was wondering if there was
> > some kind of disconnect between the fltk libraries
> > and our libraries.  Something that I may have
> > missed?   The program seems to link correctly
> > (except for a missing _WinMainCRTStartup call,
> > which it says it can't find and will default to
> > some address that seems to correspond to _mainCRTStartup).
> >
> > This program works under  Solaris, Linux, and IRIX.
> >
> > Thanks in advance,
> > - Ted
>
> IIRC, Windows needs a WinMain entry point for GUI apps, and
> a standard main() entry point for console apps.
> It looks like you're building this app as a GUI one, but only
> have a main() entry point.  Try adding '-mconsole' to LDFLAGS;
> this should cause the app to be built as a console one.
> Note that this has the unfortunate side-effect that your app
> will open an empty console window if launched from Windows
> Explorer instead of the command line.
>
> An alternative would be to add a WinMain function; this has the
> big drawback that WinMain gets the command line as one big string,
> so you have to chop it up into pieces yourself.
>
> int
> #if !defined(WIN32)
> main(int argc, char** argv)
> #else
> main_entry_point(int argc, char** argv)
> #endif
> {
> ...
> }
>
> #if defined(WIN32)
> INT WINAPI
> WinMain(check_your_win_api_ref_for_correct_signature)
> {
> int myargc = 0;
> char** myargv = NULL;
>   /* Get the executable name (for argv[0]) using the Win32 API */
>   ...
>   /* Chop up the command line into pieces, adding them to myargv */
>   ...
>   /* Chain to the regular entry point */
>   return main_entry_point(myargc, myargv);
> }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]