www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - linking erro

↑ ↓ ← "Sean" <seanchen telus.net> writes:
My program compiles OK but when linking there is some erro.

my command line is:
dmc -g -mn -L/exetype:windows main Contour mainwindow material math
object_3d parts tesselator opengl32.lib glu32.lib gdi32.lib comctl32.lib

here is the output of dmc:

main.cpp:
Contour.cpp:
mainwindow.cpp:
material.cpp:
math.cpp:
object_3d.cpp:
parts.cpp:
tesselator.cpp:
link
main+Contour+mainwindow+material+math+object_3d+parts+tesselator,,,opengl32+
glu32+gdi32+comctl32+user32+kernel32/co/noi/exetype:windows;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
F:\DM\BIN\..\lib\SNN.lib(winstart)
 Error 83: Illegal frame on start address
OPTLINK : Warning 174: 32-bit Segments Inappropriate for 16-bit Segmented
output
main.obj(main)
 Error 35: Cannot Reach TARGET from FRAME at Relative 0001FH  from
 Segment _TEXT
 FRAME  = Frame of Group FLAT 0000
 TARGET = External Symbol ?RegisterWinClass GLWindow  SAHPAX Z (int cdecl
GLWindow::RegisterWinClass(void *)) 09BF6H
 FIXUPP Type = 32-bit Conditional JMP

--- errorlevel 2

My main.cpp looks like this:

int PASCAL WinMain( HINSTANCE this_inst, HINSTANCE prev_inst, LPSTR cmdline,
                    int cmdshow )
{
    MSG         msg;

    if( !prev_inst ) {
        if (!GLWindow::RegisterWinClass(this_inst)) return (FALSE);
    }
    GLWindow mainWindow(this_inst);

    while( GetMessage( &msg, NULL, NULL, NULL ) ) {

        TranslateMessage( &msg );
        DispatchMessage( &msg );

    }
    InitCommonControls();
    return( msg.wParam );

} /* WinMain */

class GLWindow looks like this:

class GLWindow {
    private:
      HWND m_HWnd;
      HINSTANCE m_HInstance;
      HDC m_HDC;
      HGLRC m_HRC;
      struct Layout {
         LONG x, y, width, height;
      } m_Layout;
      static LONG FAR PASCAL MessageProc(HWND hwnd, unsigned msg,
                                     UINT wparam, LONG lparam);

    public:
      GLWindow(HINSTANCE hInst);
      ~GLWindow();
      static BOOL RegisterWinClass(HINSTANCE hInst);
      void initializeWindowLayout();
      void resize(LONG lparam);
      void saveWindowLayout();
      void enableOpenGL();
      void initializeGL();
      void disableOpenGL();
      void display();
      void reshape(int width, int height);
      void drawAxes();
};

Could anybody give me a hint what this erro means and how to fix it?
Dec 17 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
"Sean" <seanchen telus.net> wrote in message
news:brqod2$r93$1 digitaldaemon.com...
 dmc -L/exetype:windows

exetype:windows specifies the output as a 16 bit windows app. Try exetype:nt instead. See www.digitalmars.com/ctg/ctgDefFiles.html#exetype
Dec 17 2003
↑ ↓ → "Sean" <seanchen telus.net> writes:
It works! Thank you, Walter.

"Walter" <walter digitalmars.com> дÈëÓʼþ
news:brqupj$14tj$1 digitaldaemon.com...
 "Sean" <seanchen telus.net> wrote in message
 news:brqod2$r93$1 digitaldaemon.com...
 dmc -L/exetype:windows

exetype:windows specifies the output as a 16 bit windows app. Try

 instead. See www.digitalmars.com/ctg/ctgDefFiles.html#exetype

Dec 17 2003