4

I've been trying to compile some basic linked-list example i took somewhere else.

The problem i am having is more of user kind. I guess the picture says it all:

What's the reason for all the weird symbols ? Normal MinGW output should look something like error: invalid conversion from ‘void*’ to ‘element*’

That's the problem i am having, but i would be happy to receive explanation on the error itself. Here is my code:

#include <stdio.h>
#include <stdlib.h>
struct element {
       int info;
       struct element *next;
};
int main(void){
struct element *head, *node;
int arv;
head = NULL;
printf("Enter number! (0 to exit)");
scanf("%d",&arv);
while (arv != 0){
      node = malloc(sizeof *node);
      node->next = head;
      node->info = arv;
      head = node;
      printf("Enter number! (0 to exit)");
      scanf("%d",&arv);
}
}

Edit Solved ! Thanks for the info guys. Similar question:

mingw g++ gives warnings in wrong language (german instead of english)

Non-localized version of MinGW?

As for the solution, i removed everything from "\mingw\share\locale". Might not be the best practice though.

Community
  • 1
  • 1
user1230585
  • 77
  • 2
  • 6

1 Answers1

3

I am wildly guessing here, but your compiler might be outputting error messages localized in your language using UTF-8, and your terminal does not understand UTF-8 and displays it in some Windows codepage. Are your language settings configured for a non-latin language?

thiton
  • 35,651
  • 4
  • 70
  • 100
  • 1
    +1: with the information provided that is what I would guess as well (see my comment/hint on the question). Only thing strange is, that part of the message "In function '%s':" doesn't seem to be localized. – Christian.K May 03 '12 at 08:42