Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error #136

Open
tkona opened this issue Mar 1, 2018 · 8 comments
Open

compilation error #136

tkona opened this issue Mar 1, 2018 · 8 comments

Comments

@tkona
Copy link

tkona commented Mar 1, 2018

Hi,

I tired you library, but I am getting fatal error:

@danaack
Copy link
Collaborator

danaack commented Mar 1, 2018

Hi @tkona,

Thanks for reaching out! What was your method of cloning the library, are you using v2.20 from https://www.arduinolibraries.info?

@tkona
Copy link
Author

tkona commented Mar 1, 2018 via email

@danaack
Copy link
Collaborator

danaack commented Mar 1, 2018

If you will be compiling on Arduino, that will be the simplest option for you. You can accomplish this by either:

Example use sketches can be found in the examples folder or File -> Examples -> IonDB.

If you are not compiling on Arduino, please let me know what error you were getting and I can try and help you further.

@tkona
Copy link
Author

tkona commented Mar 1, 2018 via email

@tkona
Copy link
Author

tkona commented Mar 2, 2018 via email

@tkona
Copy link
Author

tkona commented Mar 2, 2018 via email

@danaack
Copy link
Collaborator

danaack commented Mar 2, 2018

Hi Natko,

I'm glad you were able to get it compiling! As for the wrong value being returned, I tried it out on Arduino and I was able to get the correct output with the following sketch:


void
setup(
) {
  Serial.begin(9600);

  Dictionary < char, int > *m_Numbers = new SkipList<char, int>(-1,
  key_type_char_array, sizeof(char), sizeof(int), 21);

  m_Numbers->insert('0', 0);
  m_Numbers->insert('1', 1);
  m_Numbers->insert('2', 2);
  m_Numbers->insert('3', 3);
  m_Numbers->insert('4', 4);
  m_Numbers->insert('5', 5);
  m_Numbers->insert('6', 6);
  m_Numbers->insert('7', 7);
  m_Numbers->insert('8', 8);
  m_Numbers->insert('9', 9);
  m_Numbers->insert('A', 10);
  m_Numbers->insert('C', 11);
  m_Numbers->insert('E', 12);
  m_Numbers->insert('F', 13);
  m_Numbers->insert('H', 14);
  m_Numbers->insert('J', 15);
  m_Numbers->insert('L', 16);
  m_Numbers->insert('P', 17);
  m_Numbers->insert('S', 18);
  m_Numbers->insert('U', 19);
  m_Numbers->insert('-', 20);

  /* Retrieve a value by providing a key */
  int my_value1 = m_Numbers->get('A');

  /* You should check the status on every operation to ensure good data integrity */
  if (err_ok != m_Numbers->last_status.error) {
	printf("Oh no! Something went wrong with my get operation\n");
  }

  printf("A -> %d\n", my_value1);

  my_value1 = m_Numbers->get('C');

  /* You should check the status on every operation to ensure good data integrity */
  if (err_ok != m_Numbers->last_status.error) {
      printf("Oh no! Something went wrong with my get operation\n");
  }

  printf("C -> %d\n", my_value1);

  my_value1 = m_Numbers->get('-');

  /* You should check the status on every operation to ensure good data integrity */
  if (err_ok != m_Numbers->last_status.error) {
      printf("Oh no! Something went wrong with my get operation\n");
  }

  printf("- -> %d\n", my_value1);
	
  /* Always clean up your dictionaries when you're done with them! */
  delete m_Numbers;
}

void
loop(
) {}

Was your code similar?

@tkona
Copy link
Author

tkona commented Mar 3, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants