undefined reference to glClear

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

undefined reference to glClear

Postby TheOneMore » Thu Aug 24, 2017 23:47

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

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: undefined reference to glClear

Postby lucebac » Fri Aug 25, 2017 10:09

You have to link opengl32.a

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Fri Aug 25, 2017 13:51

but, were is it from ?
Its not in CEGUI dependencies ...

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: undefined reference to glClear

Postby lucebac » Fri Aug 25, 2017 13:53

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.

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Fri Aug 25, 2017 14:14

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

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: undefined reference to glClear

Postby lucebac » Fri Aug 25, 2017 14:21

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.

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Sat Aug 26, 2017 13:52

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

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: undefined reference to glClear

Postby Ident » Sat Aug 26, 2017 15:24

It cant find the dynamic library that it says it cant find. Is it present?
CrazyEddie: "I don't like GUIs"

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Sat Aug 26, 2017 15:30

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

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: undefined reference to glClear

Postby Ident » Sat Aug 26, 2017 16:38

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.
CrazyEddie: "I don't like GUIs"

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Sat Aug 26, 2017 17:44

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 ...

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: undefined reference to glClear

Postby Ident » Sat Aug 26, 2017 17:46

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?
CrazyEddie: "I don't like GUIs"

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Sat Aug 26, 2017 18:15

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.

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: undefined reference to glClear

Postby Ident » Sat Aug 26, 2017 18:26

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?
CrazyEddie: "I don't like GUIs"

TheOneMore
Just popping in
Just popping in
Posts: 11
Joined: Thu Aug 24, 2017 22:51

Re: undefined reference to glClear

Postby TheOneMore » Sun Aug 27, 2017 00:38

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest