How to include the headings of the gotoxy() and textcolor() functions

Asked

Viewed 539 times

2

Which library could be used to compile a C code that uses the functions gotoxy() and textcolor(), by Code::Blocks 16.1, Windows 7 environment?

I’m using: stdio.h, conio.h, windows.h and stdlib.h but it’s not working, I’m getting the bugs:

undefined reference to gotoxy

and

undefined reference to textcolor.

Grateful.

  • 2

    Show the code you are using. It should be working with conium. h, from what I understand.

  • I believe that the original code ran on Linux, because it did not use windows. h and used conio2.h: The original code is at this link: http://codigosfontes-ccplus-plus.blogspot.com.br/2012/11/convertendo-matriz-bidimensional-em.html Thank you.

2 answers

1

Problem solved! I added to <windows.h> and then compiled without errors or warnings, and executed as planned! Everyone who responded not only helped, but also added more knowledge to me, but without the @monfico user tip, I wouldn’t have gotten to that result so quickly, anyway, thank you all, and I hope that this old problem of mine will serve as a solution for others.

  • I note that the code was compiled by mingw from Dev-C++, because in code::Blocks, although it appears as a downloaded conium 2.0, the right-click option install returns with the error: Error reading froam stream!

  • Last problem solved, I hope that these solutions will be useful to those who go through the same problems. To rotate round also in code::Blocks, step by step solution here: https://github.com/Fernando-Lafeta/Biblioteca-Conio-2/blob/master/Tutorial_de_instalacao_(Codeblocks). txt

1

The functions you quoted are part of the conium. The error undefined reference is a link error, that is, you may not be linking to the library. Go to the Code::Blocks link counters and add one -lconio.

  • Since the posting, there’s been some progress. As the code uses conio2.h, I downloaded from devpaks.org, 3 bilbiotecas conium: conium 2.0, conium 2.0 win-64 bits and conium 2.1. The only one who recognized conio2.h was conium 2.0, but is still returning the same type of error, only with one more piece of information: [Linker error] undefined reference to textcolor [Linker error] undefined reference to gotoxy With your hint, the only mistake is now: [Linker error] undefined reference to 'Sleep', Thank you! Now all that remains is to solve the problem of sleep.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.