Author Topic: Compiler error where Code had worked before  (Read 11531 times)

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Compiler error where Code had worked before
« on: January 25, 2015, 05:34:44 pm »
Hi
I got help in this Forum a couple weeks back while I was getting SFML setup in C::B.
All was well, the sample code from the SFML book worked.  I haven't attempted to build and run that particular code another time until now, and I'm getting these error messages:


Code
mingw32-g++.exe -LD:\SFML-2.2\lib -L..\..\SFML-2.2\lib -o bin\Debug\2015-01-05.exe obj\Debug\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj): In function `ZNK2sf12RenderWindow7captureEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderWindow.cpp:92: undefined reference to `glReadPixels@28'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget5clearERKNS_5ColorE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:99: undefined reference to `glClearColor@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:100: undefined reference to `glClear@4'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget4drawEPKNS_6VertexEjNS_13PrimitiveTypeERKNS_12RenderStatesE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:269: undefined reference to `glVertexPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:270: undefined reference to `glColorPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:271: undefined reference to `glTexCoordPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:280: undefined reference to `glDrawArrays@12'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget12pushGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:299: undefined reference to `glGetError@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:309: undefined reference to `glPushClientAttrib@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:310: undefined reference to `glPushAttrib@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:312: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:313: undefined reference to `glPushMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:314: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:315: undefined reference to `glPushMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:316: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:317: undefined reference to `glPushMatrix@0'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget11popGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:329: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:330: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:331: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:332: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:333: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:334: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:336: undefined reference to `glPopClientAttrib@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:337: undefined reference to `glPopAttrib@0'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget13resetGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:355: undefined reference to `__GLEW_ARB_multitexture'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:357: undefined reference to `__glewClientActiveTextureARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:358: undefined reference to `__glewActiveTextureARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:362: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:363: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:364: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:365: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:366: undefined reference to `glEnable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:367: undefined reference to `glEnable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:368: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:369: undefined reference to `glEnableClientState@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:370: undefined reference to `glEnableClientState@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:371: undefined reference to `glEnableClientState@4'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget16applyCurrentViewEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:407: undefined reference to `glViewport@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:410: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:411: undefined reference to `glLoadMatrixf@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:414: undefined reference to `glMatrixMode@4'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget14applyBlendModeERKNS_9BlendModeE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:424: undefined reference to `__GLEW_EXT_blend_func_separate'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:426: undefined reference to `__glewBlendFuncSeparateEXT'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:432: undefined reference to `glBlendFunc@8'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:437: undefined reference to `__GLEW_EXT_blend_equation_separate'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:439: undefined reference to `__glewBlendEquationSeparateEXT'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:445: undefined reference to `__glewBlendEquation'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget14applyTransformERKNS_9TransformE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:457: undefined reference to `glLoadMatrixf@4'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(GLCheck.cpp.obj): In function `ZN2sf4priv12glCheckErrorEPKcj':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/GLCheck.cpp:40: undefined reference to `glGetError@0'
D:\SFML-2.2\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `checkMaximumTextureSize':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:64: undefined reference to `glGetIntegerv@8'


Yes, openGL references.  If this were happening before the Code actually worked my next step would be to go find the GLUT files, or whatever I needed, but this Code had already worked.  And I haven't done anything on this computer (that I know of) to cause problems now.
If files are missing, why did the Code work before.  I need to first understand what changed.
I didn't delete anything and as far as I know I didn't change any Project.Build Options information--of if I did, then I don't see what I did.
If I can get some help interpreting these error messages, so I can be clear on what they're saying the compiler needs, I'll go ahead and try to remedy the paths, pointers, whatever is needed.

Thanks
« Last Edit: January 26, 2015, 05:02:34 pm by OldFangle »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler error where Code had worked before
« Reply #1 on: January 25, 2015, 05:52:45 pm »
Code had already worked.  And I haven't done anything on this computer (that I know of) to cause problems now.
It is obvious that you're not linking to opengl and glew.
You've either deleted the linking options in the project -> build option, changed the inheritance scheme or removed some global linking options from the compiler settings.

You just have to remember what have you changed since the last time it has worked.

p.s. and next time please use code tags for long pastes.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #2 on: January 25, 2015, 06:53:56 pm »
Hi

Yup, that's what I've been trying to guess or remember.  One of those.  Or something.
So I'll dig into 'global linking options', see what I can figure there.

(Please point me to information about using "code tags for long pastes".)

Thanks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler error where Code had worked before
« Reply #3 on: January 25, 2015, 07:40:05 pm »
Just surround the paste with [ code ] [/ code ] tags. Also there is a button in the UI called Insert code ('#') which does it for you.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #4 on: January 26, 2015, 10:51:05 am »
> Just surround the paste with [ code ] [/ code ] tags. Also there is a button in the UI called Insert code ('#') which does it for you.

Ouch.  Sorry.  I actually should put a Post-It note on the monitor about that.
Thanks.


Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #5 on: January 26, 2015, 05:08:50 pm »
Hi

I've spent the better part of five hours today reading articles and experimenting with settings, in an attempt to get that SFML sample working again.
(I'm not even sure, from things I've read, whether the Project/Build Options should be in the Workspace area or the <file>.cbp area. For now I'm putting information in the <file>.cbp area.)

Here are the Build Option settings according to what I understand of various articles I've read (error code to follow)

First:
In C::B my build options are not on the Workspace level, they're one level down, the ProjectName level.
C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\
C:\SFML-2.2

1) Linker settings (in this specific order)

sfml-graphics-s-d
sfml-window-s-d
sfml-system-s-d
freeglut
opengl
gdi32
winmm

2) Search Directories
   Compiler:
C:\SFML-2.2\include
C:\Program Files (x86)\CodeBlocks\MinGW\lib
C:\Program Files (x86)\CodeBlocks\MinGW\freeglut
   Linker:
C:\SFML-2.2\lib
C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\bin

3) #Defines
SFML_STATIC
-D FREEGLUT_STATIC

I know there are pathway problems but I'm at the extent of my understanding about it.
http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/  has been helpful, I may have misunderstood something or missed a step.
A copy of freeglut.dll is in \freeglut\bin and is also in the Windows System32 directory.
Here's the error log, hopefully I can get a couple of specific pointers and explanations for what I'm still not understanding.
Thanks again.  And sorry if this post was too long.

Code
-------------- Build: Debug in TRY_04 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\SFML-2.2\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\bin" -o bin\Debug\TRY_04.exe obj\Debug\src\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lfreeglut -lopengl32 -lgdi32 -lwinmm
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget13resetGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:355: undefined reference to `__GLEW_ARB_multitexture'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:357: undefined reference to `__glewClientActiveTextureARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:358: undefined reference to `__glewActiveTextureARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget14applyBlendModeERKNS_9BlendModeE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:424: undefined reference to `__GLEW_EXT_blend_func_separate'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:426: undefined reference to `__glewBlendFuncSeparateEXT'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:437: undefined reference to `__GLEW_EXT_blend_equation_separate'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:439: undefined reference to `__glewBlendEquationSeparateEXT'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:445: undefined reference to `__glewBlendEquation'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `ZN2sf7Texture12getValidSizeEj':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:575: undefined reference to `__GLEW_ARB_texture_non_power_of_two'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `checkShadersAvailable':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:119: undefined reference to `__GLEW_ARB_shading_language_100'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:119: undefined reference to `__GLEW_ARB_shader_objects'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:119: undefined reference to `__GLEW_ARB_vertex_shader'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:119: undefined reference to `__GLEW_ARB_fragment_shader'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6ShaderD2Ev':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:149: undefined reference to `__glewDeleteObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader12setParameterERKSsf':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:266: undefined reference to `__glewGetHandleARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:267: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:273: undefined reference to `__glewUniform1fARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:277: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader12setParameterERKSsff':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:290: undefined reference to `__glewGetHandleARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:291: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:297: undefined reference to `__glewUniform2fARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:301: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader12setParameterERKSsfff':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:314: undefined reference to `__glewGetHandleARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:315: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:321: undefined reference to `__glewUniform3fARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:325: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader12setParameterERKSsffff':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:338: undefined reference to `__glewGetHandleARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:339: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:345: undefined reference to `__glewUniform4fARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:349: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader12setParameterERKSsRKNS_9TransformE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:383: undefined reference to `__glewGetHandleARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:384: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:390: undefined reference to `__glewUniformMatrix4fvARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:394: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader4bindEPKS0_':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:455: undefined reference to `__glewUseProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:462: undefined reference to `__glewUniform1iARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:467: undefined reference to `__glewUseProgramObjectARB'
C:\SFML-2.2\lib/libsfml-graphics-s-d.a(Shader.cpp.obj): In function `ZN2sf6Shader7compileEPKcS2_':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:499: undefined reference to `__glewDeleteObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:507: undefined reference to `__glewCreateProgramObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:513: undefined reference to `__glewCreateShaderObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:514: undefined reference to `__glewShaderSourceARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:515: undefined reference to `__glewCompileShaderARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:519: undefined reference to `__glewGetObjectParameterivARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:523: undefined reference to `__glewGetInfoLogARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:526: undefined reference to `__glewDeleteObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:527: undefined reference to `__glewDeleteObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:533: undefined reference to `__glewAttachObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:534: undefined reference to `__glewDeleteObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:541: undefined reference to `__glewCreateShaderObjectARB'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Shader.cpp:542: undefined reference to `__glewShaderSourceARB'

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler error where Code had worked before
« Reply #6 on: January 26, 2015, 06:17:37 pm »
It is obvious that you're not linking to GLEW.  ;D
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #7 on: January 26, 2015, 08:44:22 pm »
Crap, I wasn't even thinking about GLEW.  Glewby.

Thanks for the pointer.  Found these in another thread, will read them now. 
http://stackoverflow.com/questions/6005076/building-glew-on-with-mingw
http://www.gamedev.net/topic/583816-how-to-statically-link-glew-using-mingw/
(Recognise them?)

Thanks.

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #8 on: January 28, 2015, 09:46:49 pm »
Hi

Progress of sorts.  I'm down to this brief error message.

Code
-------------- Build: Debug in TRY_04 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\glew\glew-1.11.0\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib" -L"C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\lib" -LC:\SFML-2.2\lib -LC:\glew\glew-1.11.0\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib" -L"C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\lib" -LC:\SFML-2.2\lib -LC:\glew\glew-1.11.0\lib -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib" -L"C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\lib" -LC:\SFML-2.2\lib -o bin\Debug\TRY_04.exe obj\Debug\src\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lfreeglut -lgdi32 -lwinmm -lopengl -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lfreeglut -lgdi32 -lwinmm -lopengl -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lfreeglut -lgdi32 -lwinmm -lopengl
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lopengl
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lopengl
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lopengl
collect2.exe: error: ld returned 1 exit status

I think the next step is to figure where to put glew32.dll (32bit) and glew32.dll (64bit).
I'm currently getting that sorted.

Before bad habits set in perhaps I can get advice on what's listed here: my #defines, Linkers, and Directory Search paths.  Apart from what might be in the wrong place, what should be added, omitted, or re-sorted differently in the lists?

These are the same in Workspace and in the Project *.

   #defines
GLEW_STATIC
FREEGLUT_STATIC
SFML_STATIC

   Linker Settings
sfml-graphics-s-d
sfml-window-s-d
sfml-system-s-d
freeglut
gdi32
winmm
opengl

   Global & Build Options Search Directories Compiler
C:\glew\glew-1.11.0\include\GL
C:\Program Files (x86)\CodeBlocks\MinGW\include
C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\include\GL
C:\SFML-2.2\include\SFML

   Search Directories Linker
C:\glew\glew-1.11.0\lib
C:\Program Files (x86)\CodeBlocks\MinGW\lib
C:\Program Files (x86)\CodeBlocks\MinGW\freeglut\lib
C:\SFML-2.2\lib


* Something I'm having trouble pinning-down is what's necessary to put into the Workspace Build Opts and Globals, if there's only one Project within the Workspace: Is it enough to put the information in the Project's Project/Build Options and Global Settings and leave the corresponding Workspace areas empty?

Thanks
OF

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiler error where Code had worked before
« Reply #9 on: January 28, 2015, 10:14:37 pm »
Follow the rule: the linker is always right. The lib is not there because it's name is opengl32.

It becomes off-topic for this forum... Additionally please follow the forum rules! Thank you.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #10 on: January 28, 2015, 10:37:53 pm »
Hi

> Follow the rule: the linker is always right. The lib is not there because it's name is opengl32.
Okay, I'm not one to call a linker a liar anyway.  I'd ask why it's there, then, but

> It becomes off-topic for this forum...
I'll look elsewhere.

> Additionally please follow the forum rules! Thank you.
No worries.  Which one(s) did I break?  I wouldn't have if I'd had a hunch I was doing so.

Thank you.
OF

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiler error where Code had worked before
« Reply #11 on: January 28, 2015, 10:50:52 pm »
> Follow the rule: the linker is always right. The lib is not there because it's name is opengl32.
Okay, I'm not one to call a linker a liar anyway.  I'd ask why it's there, then, but
Its there because you setup the project as it is. Check the project's linker options and change opengl to opengl32.

Its recommended that you should understand the basics of compiling/linking before you start with an IDE. This is teached best at the command line reading a book or tutorial, IMHO. Then it is very easy and convenient to transfer these settings to the IDE and leave the command line.

We cannot teach for every SDK out there how to setup C::B for it. Therefore such questions are not allowed here. Are you aware that there are literally millions of SDK's available? So to know what path to setup for the compiler, what options and what libraries to link against is up to the developer (you), not to this forums. By "accident" you found people here that use SFML but that is not guaranteed.

If you have specific (IDE related) questions, like "I know I have to link against opengl32, but where do I set it up best / at all?" after reading the tutorials we provide its OK. In the end: If you want the developers of C::B to continue development on C::B instead of providing general programming support... well.... read and follow the rules. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Compiler error where Code had worked before
« Reply #12 on: January 28, 2015, 10:56:51 pm »
Quote
Something I'm having trouble pinning-down is what's necessary to put into the Workspace Build Opts and Globals, if there's only one Project within the Workspace: Is it enough to put the information in the Project's Project/Build Options and Global Settings and leave the corresponding Workspace areas empty?
You can not modify buld settings in a workspace (this would be a nice feature). You can set the build settings on a global base (all project apply this settings, so this is basically never usefull expect for global include paths ecc.) on a project base (all targets in this project apply this settings) and on a target base (only this target applies this settins)  for future reading:[1] 


Quote
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lopengl
the linker obviously doesn't find the file "opengl". So there are two reasons possible: he doesn't know the path to "opengl" or you have written it wrong...

Quote
Before bad habits set in perhaps I can get advice on what's listed here: my #defines, Linkers, and Directory Search paths.  Apart from what might be in the wrong place, what should be added, omitted, or re-sorted differently in the lists?
this should be obvious... read the wiki link [1]  i posted here, things will get more clear... And more then all learn exactly what a compiler is and the build steps of gcc (wikipedia is your friend)

Quote
> Additionally please follow the forum rules! Thank you.
No worries.  Which one(s) did I break?  I wouldn't have if I'd had a hunch I was doing so.
Any question like "what is the right filename for opengl" or "what are the right additional compiler commands for my build" are wrong in this forum, because we give no support for compiler, only for the IDE. So you can ask "where do i set the compiler option XYZ so that it gets used on every target".  But this kind of question should not come up, if you read [1]

greetings

[1] http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks

[Edit:] So MortenMacFly was faster, but i didn't wanted to throw away what i had already written :), so i will post it anyway
« Last Edit: January 28, 2015, 10:58:31 pm by BlueHazzard »

Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #13 on: January 28, 2015, 11:10:09 pm »
@MortenMacFly

I'm sorry for the trouble.  I've started a chat with someone over at the SFML Forum, I'll take some of this there, then.

> Its recommended that you should understand the basics of compiling/linking before you start with
> an IDE.

This was kind of how I was learning it.  Starting out, it all looked like a big sphere to me, one starting point looked pretty much like any other.

Everything I was trying to learn here was happening inside Code::Blocks and I learned about C::B very recently from YouTube videos which were all showing SFML with it.  In my head it was all connected but I understand you're point.

Thanks very much again, everyone, for your time and patience with these questions.
Shouldn't be too long before I'm back with some actual C::B questions for the group.

Cheers
OF


Offline OldFangle

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compiler error where Code had worked before
« Reply #14 on: January 29, 2015, 02:01:57 pm »
@BlueHazzard

Thanks for the link.  I'm not sure I've seen this article before.  As soon as I clearly recognise a problem I go looking for its solution.  This saves me time for sure.

OF