help needed with fixing error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ripiz
    New Member
    • Nov 2006
    • 11

    help needed with fixing error

    OS Windows 98
    Dev-C++ Newest at the moment

    I'm getting this strange error
    cannot find -lobjc
    That line contains
    Code:
    MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",NULL);
    And here's all int
    Code:
    int InitGL(void){
    	MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",NULL);
    	createlevel("levels/test0.txt",curlvl);
    	initcamera(mainc);
    	LoadGLTextures();
    	glShadeModel(GL_SMOOTH);						
    	glClearColor(0.0f, 0.0f,0.0f, 0.5f);				
    	glClearDepth(1.0f);		
    	glEnable(GL_DEPTH_TEST);							
    	glDepthFunc(GL_LEQUAL);							
    	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    	initdeftiles();
    	ticks=GetTickCount();
    	return true;
    }
    Please help to fix it.
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    Originally posted by Ripiz
    OS Windows 98
    Dev-C++ Newest at the moment

    I'm getting this strange error
    cannot find -lobjc
    That line contains
    Code:
    MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",NULL);
    Please help to fix it.
    I thought the 4'th paramet to MessageBox() was a UINT that specified the contents and behavior of the dialog box and NULL (the C++ null pointer) would not be suitable. Try
    Code:
    	MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",MB_OK);

    Comment

    • Ripiz
      New Member
      • Nov 2006
      • 11

      #3
      I know what was the problem.. It's my compiler...
      I get this error when I use 'Link and Objective C Program' option. When I don't use it I get linking errors.. I got no idea how to fix them.
      Maybe anyone can suggest other compiler?

      Comment

      • horace1
        Recognized Expert Top Contributor
        • Nov 2006
        • 1510

        #4
        Originally posted by Ripiz
        I know what was the problem.. It's my compiler...
        I get this error when I use 'Link and Objective C Program' option. When I don't use it I get linking errors.. I got no idea how to fix them.
        Maybe anyone can suggest other compiler?
        I tried the function call
        Code:
        MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",MB_OK);
        with DEV-C++ using a Windows Application project - it worked OK

        Comment

        • Ripiz
          New Member
          • Nov 2006
          • 11

          #5
          Just great, when I use that linking option I can't compile at all...
          It always says "552 C:\WINDOWS\Desk top\Untitled1.c pp cannot find -lobjc"
          Maybe anyone had this problem before?

          Comment

          • horace1
            Recognized Expert Top Contributor
            • Nov 2006
            • 1510

            #6
            Originally posted by Ripiz
            Just great, when I use that linking option I can't compile at all...
            It always says "552 C:\WINDOWS\Desk top\Untitled1.c pp cannot find -lobjc"
            Maybe anyone had this problem before?
            when you downloaded DEV-C++ did you include the Mingw compiler and libraries? If not try downloading it.

            Comment

            • Ripiz
              New Member
              • Nov 2006
              • 11

              #7
              Yeh, I checked Download Updates/Packs option and now downloading newer version.
              And it's still same error =[
              When I check compile log:
              Code:
              Compiler: Default compiler
              Executing  g++.exe...
              g++.exe "C:\WINDOWS\Desktop\Untitled1.cpp" -o "C:\WINDOWS\Desktop\Untitled1.exe"   -ansi -traditional-cpp -w -fno-access-control -fmessage-length=0  -I"C:\DEV-CPP\lib\gcc\mingw32\3.4.2\include"  -I"C:\DEV-CPP\include\c++\3.4.2\backward"  -I"C:\DEV-CPP\include\c++\3.4.2\mingw32"  -I"C:\DEV-CPP\include\c++\3.4.2"  -I"C:\DEV-CPP\include"  -I"C:\Dev-Cpp\lib"  -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"   -L"C:\DEV-CPP\lib" -lobjc -fmessage-length=0 
              C:\DEV-CPP\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lobjc
              collect2: ld returned 1 exit status
              
              Execution terminated

              Comment

              • horace1
                Recognized Expert Top Contributor
                • Nov 2006
                • 1510

                #8
                veer odd, if I run DEV-C++ and create a New file (no project!) and paste and save the following code as a C++ file
                Code:
                #include <iostream>
                #include <windows.h>
                
                using namespace std;
                
                int main(int argc, char *argv[])
                {
                 MessageBox(NULL,"Please vote for this code at PlanetSourceCode.com","I'm begging you!",MB_OK);
                    system("PAUSE");
                    return EXIT_SUCCESS;
                }
                it compiles and runs and the message box appears OK

                Comment

                • Ripiz
                  New Member
                  • Nov 2006
                  • 11

                  #9
                  Yes it is.
                  Here I'm trying to compile other code. It don't have any errors at all, but these
                  Code:
                    cannot find -lobjc 
                    ld returned 1 exit status
                  But when I disable that Linking Option everything works for other code and compiles successfully. But for first code (when all used, not piece) I get linking errors:
                  Code:
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x110):main.cpp: undefined reference to `glEnable@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x187):main.cpp: undefined reference to `glBindTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x1ba):main.cpp: undefined reference to `glBindTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x1c9):main.cpp: undefined reference to `glBegin@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x208):main.cpp: undefined reference to `glTexCoord2f@8'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x265):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x2a4):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x301):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x340):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x39d):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3a5):main.cpp: undefined reference to `glEnd@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3f1):main.cpp: undefined reference to `glBindTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x44b):main.cpp: undefined reference to `glTranslatef@12'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x495):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x4e4):main.cpp: undefined reference to `gluSphere@20'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x50f):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x559):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x5e0):main.cpp: undefined reference to `gluCylinder@36'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x60b):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x655):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x6c6):main.cpp: undefined reference to `gluCylinder@36'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x6f1):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x75a):main.cpp: undefined reference to `glTranslatef@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x77d):main.cpp: undefined reference to `glDisable@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x78d):main.cpp: undefined reference to `glPointSize@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x79c):main.cpp: undefined reference to `glBegin@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x813):main.cpp: undefined reference to `glColor4f@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x875):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x887):main.cpp: undefined reference to `glEnd@0'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x8a6):main.cpp: undefined reference to `glColor3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x1905):main.cpp: undefined reference to `gluNewQuadric@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x1957):main.cpp: undefined reference to `gluQuadricNormals@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x199c):main.cpp: undefined reference to `gluQuadricTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x19e1):main.cpp: undefined reference to `gluQuadricDrawStyle@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x2e15):main.cpp: undefined reference to `timeGetTime@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x2e23):main.cpp: undefined reference to `timeGetTime@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x32eb):main.cpp: undefined reference to `glFogf@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3303):main.cpp: undefined reference to `glFogf@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x331a):main.cpp: undefined reference to `glFogfv@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3332):main.cpp: undefined reference to `glFogf@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x334f):main.cpp: undefined reference to `glFogf@8'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x335e):main.cpp: undefined reference to `glEnable@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x336d):main.cpp: undefined reference to `glClear@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3467):main.cpp: undefined reference to `glLoadIdentity@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x348f):main.cpp: undefined reference to `glRotatef@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x34cb):main.cpp: undefined reference to `glTranslatef@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x34ed):main.cpp: undefined reference to `glTranslatef@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3595):main.cpp: undefined reference to `glLoadIdentity@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x35aa):main.cpp: undefined reference to `glBindTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x35cc):main.cpp: undefined reference to `glTranslatef@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x35ff):main.cpp: undefined reference to `glBegin@4'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x361e):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3640):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3667):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3689):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x36b0):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x36d2):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x36f1):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3713):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x371b):main.cpp: undefined reference to `glEnd@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x374e):main.cpp: undefined reference to `glBegin@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x376d):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x378f):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x37b6):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x37d8):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x37ff):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3821):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3840):main.cpp: undefined reference to `glTexCoord2f@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3862):main.cpp: undefined reference to `glVertex3f@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x386a):main.cpp: undefined reference to `glEnd@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x389a):main.cpp: undefined reference to `glViewport@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x38a9):main.cpp: undefined reference to `glMatrixMode@4'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x38b1):main.cpp: undefined reference to `glLoadIdentity@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x38df):main.cpp: undefined reference to `gluPerspective@32'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x38ee):main.cpp: undefined reference to `glMatrixMode@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x38f6):main.cpp: undefined reference to `glLoadIdentity@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3946):main.cpp: undefined reference to `auxDIBImageLoadA@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3a7c):main.cpp: undefined reference to `auxDIBImageLoadA@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3ab1):main.cpp: undefined reference to `glGenTextures@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3ad1):main.cpp: undefined reference to `glBindTexture@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3af0):main.cpp: undefined reference to `glTexParameteri@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3b0f):main.cpp: undefined reference to `glTexParameteri@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3b5c):main.cpp: undefined reference to `gluBuild2DMipmaps@28'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3c84):main.cpp: undefined reference to `glShadeModel@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3caf):main.cpp: undefined reference to `glClearColor@16'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3cbc):main.cpp: undefined reference to `glClearDepth@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3ccb):main.cpp: undefined reference to `glEnable@4'
                  
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3cda):main.cpp: undefined reference to `glDepthFunc@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3cf1):main.cpp: undefined reference to `glBlendFunc@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3d08):main.cpp: undefined reference to `glHint@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3d78):main.cpp: undefined reference to `wglMakeCurrent@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x3db3):main.cpp: undefined reference to `wglDeleteContext@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x4258):main.cpp: undefined reference to `ChoosePixelFormat@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x42bc):main.cpp: undefined reference to `SetPixelFormat@12'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x430b):main.cpp: undefined reference to `wglCreateContext@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x436d):main.cpp: undefined reference to `wglMakeCurrent@8'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x4670):main.cpp: undefined reference to `timeGetTime@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x4681):main.cpp: undefined reference to `timeGetTime@0'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x46fd):main.cpp: undefined reference to `SwapBuffers@4'
                  C:\WINDOWS\TEMP/cc0nw5fb.o(.text+0x4723):main.cpp: undefined reference to `SwapBuffers@4'
                  There's total 100 or so errors

                  Comment

                  • auser
                    New Member
                    • Mar 2008
                    • 1

                    #10
                    I've got exactly same problem....

                    in eclipse-cdt:

                    Severity and Description Path Resource Location Creation Time Id
                    undefined reference to `glBegin@4' SDL1 Lesson36.cpp line 201 1206461675109 1149
                    undefined reference to `glClear@4' SDL1 Lesson36.cpp line 330 1206461675125 1157
                    undefined reference to `glClearColor@1 6' SDL1 Lesson36.cpp line 79 1206461675109 1141
                    undefined reference to `glColor4f@16' SDL1 Lesson36.cpp line 204 1206461675109 1150
                    undefined reference to `glEnd@0' SDL1 Lesson36.cpp line 213 1206461675125 1155
                    undefined reference to `glGetError@0' SDL1 Lesson36.cpp line 91 1206461675109 1147
                    undefined reference to `glLoadIdentity @0' SDL1 Lesson36.cpp line 83 1206461675109 1143
                    undefined reference to `glLoadIdentity @0' SDL1 Lesson36.cpp line 88 1206461675109 1146
                    undefined reference to `glLoadIdentity @0' SDL1 Lesson36.cpp line 216 1206461675125 1156
                    undefined reference to `glMatrixMode@4 ' SDL1 Lesson36.cpp line 82 1206461675109 1142
                    undefined reference to `glMatrixMode@4 ' SDL1 Lesson36.cpp line 87 1206461675109 1145
                    undefined reference to `glOrtho@48' SDL1 Lesson36.cpp line 84 1206461675109 1144
                    undefined reference to `glTranslatef@1 2' SDL1 Lesson36.cpp line 198 1206461675109 1148
                    undefined reference to `glVertex3f@12' SDL1 Lesson36.cpp line 207 1206461675109 1151
                    undefined reference to `glVertex3f@12' SDL1 Lesson36.cpp line 208 1206461675109 1152
                    undefined reference to `glVertex3f@12' SDL1 Lesson36.cpp line 209 1206461675109 1153
                    undefined reference to `glVertex3f@12' SDL1 Lesson36.cpp line 210 1206461675125 1154


                    in vs 2005 c++ express:
                    Error 1 error LNK2019: unresolved external symbol __imp__glGetErr or@0 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_N XZ) Lesson36.obj
                    Error 2 error LNK2019: unresolved external symbol __imp__glOrtho@ 48 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_N XZ) Lesson36.obj
                    Error 3 error LNK2019: unresolved external symbol __imp__glLoadId entity@0 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_N XZ) Lesson36.obj
                    Error 4 error LNK2019: unresolved external symbol __imp__glMatrix Mode@4 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_N XZ) Lesson36.obj
                    Error 5 error LNK2019: unresolved external symbol __imp__glClearC olor@16 referenced in function "bool __cdecl init_GL(void)" (?init_GL@@YA_N XZ) Lesson36.obj
                    Error 6 error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "public: void __thiscall Square::show(vo id)" (?show@Square@@ QAEXXZ) Lesson36.obj
                    Error 7 error LNK2019: unresolved external symbol __imp__glVertex 3f@12 referenced in function "public: void __thiscall Square::show(vo id)" (?show@Square@@ QAEXXZ) Lesson36.obj
                    Error 8 error LNK2019: unresolved external symbol __imp__glColor4 f@16 referenced in function "public: void __thiscall Square::show(vo id)" (?show@Square@@ QAEXXZ) Lesson36.obj
                    Error 9 error LNK2019: unresolved external symbol __imp__glBegin@ 4 referenced in function "public: void __thiscall Square::show(vo id)" (?show@Square@@ QAEXXZ) Lesson36.obj
                    Error 10 error LNK2019: unresolved external symbol __imp__glTransl atef@12 referenced in function "public: void __thiscall Square::show(vo id)" (?show@Square@@ QAEXXZ) Lesson36.obj
                    Error 11 error LNK2019: unresolved external symbol __imp__glClear@ 4 referenced in function _SDL_main Lesson36.obj
                    Error 12 fatal error LNK1120: 11 unresolved externals

                    Comment

                    Working...