Code::Blocks Forums

User forums => Help => Topic started by: Straywind on May 01, 2021, 09:47:23 am

Title: Trouble getting freeglut to work on 20.03
Post by: Straywind on May 01, 2021, 09:47:23 am
When attempting to run the codeblocks standard openGL program I get the following errors.

Quote
||=== Build: Debug in shape (compiler: GNU GCC Compiler) ===|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `__dyn_tls_init_callback'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `[email protected]'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `__cpu_features_init'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_fpreset'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_CRT_glob'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `__getmainargs'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_CRT_fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_imp___iob'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_setmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_CRT_fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_setmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_CRT_fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_setmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `__p__fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_fmode'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_pei386_runtime_relocator'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `__p__environ'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_cexit'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `[email protected]'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `signal'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `signal'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `signal'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `signal'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `signal'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| more undefined references to `signal' follow|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_fpreset'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_imp____set_app_type'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_imp____set_app_type'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_imp__atexit'|
C:\TDM-GCC-32\bin\..\lib\gcc\mingw32\5.1.0\..\..\..\crt2.o:crt1.c|| undefined reference to `_imp___onexit'|
||error: ld returned 1 exit status|
||=== Build failed: 32 error(s), 0 warning(s) (0 minute(s), 11 second(s)) ===|

It's all french to me, so if anyone is able to point me in the right direction, I would appreciate it
Title: Re: Trouble getting freeglut to work on 20.03
Post by: stahta01 on May 01, 2021, 02:35:58 pm
Look at the "build log" instead of "build messages".

The errors you posted are linking errors, this normally means you are missing a library from the linking settings.

I have no recent experience with GL or freeglut; so, I have no idea what caused the error.

Internet search results on "undefined reference to [email protected]" implies you need to link to kernel32

Edit: Add link to CB Wiki
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_My_build_fails_with_multiple_undefined_reference_errors.3F (https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_My_build_fails_with_multiple_undefined_reference_errors.3F)
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)

Tim S.