Page 1 of 2

undefined reference to glClear

Posted: Thu Aug 24, 2017 23:47
by TheOneMore
Hi all,

I´m trying to build my fist window with CEGUI, for around two weeks now.
I was able to make some progress, but i´m still stuck.

I fallowed this video:
https://www.youtube.com/watch?v=mwf_gDVudsE

Read this articles:
http://static.cegui.org.uk/docs/0.8.7/building_deps.html
http://static.cegui.org.uk/docs/0.8.7/compiling.html
And the tutorials:
http://cegui.org.uk/wiki/How_to_install_CEGUI_0.7.5_With_Code::Blocks_10.5

I´m using Code::Blocks
And my linked libs are:
deps\lib\Release\libCEGUIBase-0.dll.a;
deps\lib\Release\libCEGUIOpenGLRenderer-0.dll.a;
deps\lib\Release\libexpat.dll.a;
deps\lib\Release\libfreetype.dll.a;
deps\lib\Release\libglew.dll.a;
deps\lib\Release\libglfw.dll.a;
deps\lib\Release\libpcre.dll.a;
deps\lib\Release\libSDL2.a;
deps\lib\Release\libSDL2.dll.a;
deps\lib\Release\libSDL2main.a;
deps\lib\Release\libzlib.dll.a;


As pointed in here:
http://static.cegui.org.uk/docs/0.8.7/building_deps.html

I only unchecked:
    CEGUI_BUILD_RENDERER_DIRECT3D10
    CEGUI_BUILD_RENDERER_DIRECT3D9

The code that i`m trying to compile is this one:
https://bitbucket.org/lucebac/cegui/src/ea8f8c814a4d5dbaa56344218659eb68ce173961/application_templates/SDL2.cpp

Using CEGUI 0.8.7 and SDL2

And this is the errors:
obj\Release\main.o:main.cpp|| undefined reference to `glClearColor@16'|
obj\Release\main.o:main.cpp|| undefined reference to `glClear@4'|
obj\Release\main.o:main.cpp|| undefined reference to `glViewport@16'|


I already clicked in problably most of the links that google brings for 'CEGUI' search.

So if you can provide any clue i appreciate,
Tks in advance
+1

Re: undefined reference to glClear

Posted: Fri Aug 25, 2017 10:09
by lucebac
You have to link opengl32.a

Re: undefined reference to glClear

Posted: Fri Aug 25, 2017 13:51
by TheOneMore
but, were is it from ?
Its not in CEGUI dependencies ...

Re: undefined reference to glClear

Posted: Fri Aug 25, 2017 13:53
by lucebac
yes, because it's an "optional" dependency if you decide to use OpenGLRenderer. And if you had looked into my application template, you would have noticed that I wrote down opengl as a dependency for that.

Re: undefined reference to glClear

Posted: Fri Aug 25, 2017 14:14
by TheOneMore
I saw it Mr. Ebach, and i searched the internet for such dependency, to find out that opengl is a specification and not a framework. So I supposed this would be embedded somewhere in that CEGUI dependencies. But, anyway, thank you for your attention.

If anybody else has any aditional hint I appreciate it !!!

Regards
OneMoreGuy

Re: undefined reference to glClear

Posted: Fri Aug 25, 2017 14:21
by lucebac
Yes, you are right - OpenGL is a specification. But all graphics cards implement it and almost any operating system ships with the respective driver (suite) to use OpenGL for graphics rendering. The GCC compiler shipped with CodeBlocks should have a opengl32.dll.a somewhere around and you just have to add it to the list of libraries to link with.

FYI: OpenGL32.dll is a built-in component of windows, you can find it somewhere withn C:\Windows\system32\ I think.

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 13:52
by TheOneMore
Hi all,

Now i´m able to compile and execute the app ! :D

But, as soon as the window opens it crashes.
And the only message that i get n the log is that:

Code: Select all

26/08/2017 01:38:22 (Std)    CEGUI::Logger singleton created. (02f323c8)
26/08/2017 01:38:23 (Error)   CEGUI::GenericException in function 'CEGUI::DynamicModule::DynamicModule(const CEGUI::String&)' (F:\DEVEL\cpplibs\cegui-0.8.7\cegui\src\DynamicModule.cpp:224) : Failed to load module 'libCEGUI.dll': Unknown Error


Anybody knows what it means ?

regards

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 15:24
by Ident
It cant find the dynamic library that it says it cant find. Is it present?

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 15:30
by TheOneMore
no. but seems to me that it shouldn't be necessary, at least with this name.

This is what i have in the exe folder:

libCEGUIBase-0.dll
libCEGUICoreWindowRendererSet.dll
libCEGUIOpenGLRenderer-0.dll
libexpat.dll
libfreetype.dll
libglew.dll
libglfw.dll
libpcre.dll
libzlib.dll
SDL2.dll

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 16:38
by Ident
Something with the naming is indeed wrong here, this could be a CEGUI bug in the configuration you use. As a quickfix you can obviously rename this either in the project settings or rename the file itself.

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 17:44
by TheOneMore
I duplicated the "libCEGUIBase-0.dll" and rename the copy to "libCEGUI.dll". But the program still crashes. this time with practically no message on log:

Code: Select all

26/08/2017 14:31:45 (Std)    CEGUI::Logger singleton created. (0233e3c0)


About the project settings, i dont know anything that i could change there, but maybe you meant the configuration fase ...

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 17:46
by Ident
TheOneMore wrote:I duplicated the "libCEGUIBase-0.dll" and rename the copy to "libCEGUI.dll". But the program still crashes. this time with practically no message on log:

Code: Select all

26/08/2017 14:31:45 (Std)    CEGUI::Logger singleton created. (0233e3c0)


About the project settings, i dont know anything that i could change there, but maybe you meant the configuration fase ...

Did you debug?

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 18:15
by TheOneMore
Kind of.

i got this messages:
Image

And a popup saying : segmentation fault

The line where the error apear to be is this:

Code: Select all

CEGUI::System::create(cegui_renderer);


And i have no idea what to do with any of those things.

Re: undefined reference to glClear

Posted: Sat Aug 26, 2017 18:26
by Ident
Segfaults are hard to trace. Typically happens when you use a memory address you already deleted or in general when you access memory adresses you are not supposed to access.

Are you using identical code from the application template? Did you try to go step by step through the code to see if it processes the lines as you d expecT?

Re: undefined reference to glClear

Posted: Sun Aug 27, 2017 00:38
by TheOneMore
Ident wrote:Are you using identical code from the application template?


Yes, its the same code. My idea was to put a 'hello world' working to start studying how CEGUI works.