Code broken when change to another board

Hi, my friend send me his code and library. He use Arduino Uno R3, it work fine. But I only have Wemos D1 R1, and it messed up with datatypes. After a while, I end up with this error:

Arduino: 1.8.8 (Windows 10), Board: "WeMos D1 R1, 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

c:/users/euphoria celestial/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\sketch_dec05a.ino.cpp.o: in function `ULongLongToString(unsigned long long)':

D:\Desktop on HDD\New folder\Arduino\sketch_dec05a/sketch_dec05a.ino:83: undefined reference to `present_64_128_key_schedule(unsigned char*, char*)'

c:/users/euphoria celestial/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\sketch_dec05a.ino.cpp.o: in function `loop':

D:\Desktop on HDD\New folder\Arduino\sketch_dec05a/sketch_dec05a.ino:46: undefined reference to `present_64_128_key_schedule(unsigned char*, char*)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board WeMos D1 R1.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

this is my code:

#include <grain128.h>
#include <DHT.h>
#include <present.h>
           
const int DHTPIN = 2;       
const int DHTTYPE = DHT11; 
 
DHT dht(DHTPIN, DHTTYPE);
int encryptType = 1;
char roundkey[PRESENT_KEY_SIZE_128/8*(PRESENT_ROUNDS+1)];
unsigned char key[] = "1234567890123456";
unsigned char IV[] = "123456789012";
Grain grain(key, IV);
unsigned char * tmp1 = new unsigned char[8];
char str_text[8];
unsigned long time1 = 0;
unsigned long time2 = 0;
void setup() {
  
  Serial.begin(9600);
  dht.begin();         
  //Serial.println("OK");
}
 
void loop() {
     
      int doam =  dht.readHumidity();
      int nhietdo = dht.readTemperature();
      int ran = random(10,99); 
      String tmp = String(nhietdo)+"#"+ String(doam)+"#"+ String(ran);
      //Serial.println(tmp);
      int len = tmp.length();
      //Serial.println(key);
      tmp.toCharArray(str_text, 9);
      if(encryptType == 1)
      {
        //Serial.println(str_text);
        present_64_128_key_schedule(key,roundkey);
        unsigned long long ull_tmp = *(unsigned long long *)str_text;
         // Serial.println(ULongLongToString(ull_tmp)); 
         //time1 = time2;
         //present_encrypt((char *)&ull_tmp, roundkey);
         present_encrypt((char *)&ull_tmp, roundkey);
         //time2 = millis();
         //unsigned long timeTest = time2-time1;
         //Serial.println(timeTest);
        Serial.println(ULongLongToString(ull_tmp));        
      }
      if(encryptType == 2)   
     {
      //unsigned long time1 = millis();
       grain.Encrypt((unsigned char *)str_text, tmp1, 8);
       //unsigned long time2 = millis();
       //Serial.println(time2-time1);
       unsigned long long ull_tmp = *(unsigned long long *)tmp1;
       Serial.println(ULongLongToString(ull_tmp));
      }
      delay(500);

 
}
 String ULongLongToString(unsigned long long number)
 {
  unsigned long long tmp_num = number;
  if(tmp_num ==0) return "0";
  String tmp="";
  while(tmp_num!=0)
  {
    int n= tmp_num%10;
    tmp = String(n) + tmp;
    tmp_num = tmp_num/10;
  }
  return tmp;
 }

present crypto library:

#ifndef PRESENT_H
#define PRESENT_H

#include <Arduino.h>

#define PRESENT_BLOCK_SIZE   (64)  /* block size in bits */
#define PRESENT_KEY_SIZE_80  (80)  /* key size in bits */
#define PRESENT_KEY_SIZE_128 (128) /* key size in bits */
#define PRESENT_ROUNDS       (31)  /* rounds */


/*
 * key schedule
 * inputKey: the original keys
 * keys: round keys
 */

void present_64_128_key_schedule(unsigned char * inputKey, char * keys );

/*
 * encrypt
 * plainText: plainText has just one block.
 * keys: round keys
 */
void present_encrypt(char * plainText, const char * keys );
void present_enCtr(char * plainText,int length, const char *keys,const char *IV);
/*
 * decrypt
 * cipherText: cipherText has just one block.
 * keys: round keys
 */
void present_decrypt(char * cipherText, const char * keys );
void present_deCtr(char * cipherText,int length, const char *keys,const char *IV);
#endif

grain library:

#ifndef GRAIN128_H_INCLUDED
#define GRAIN128_H_INCLUDED

#include <Arduino.h>
class Grain
{
private:
    unsigned char *KEY, *IV, NFSR[128], LFSR[128];
    void ECRYPT_ivsetup();
    unsigned char grain_keystream();
public:
    Grain(unsigned char *key,unsigned char *iv);
    void Encrypt(unsigned char * plain, unsigned char *cipher, int length);
    void Decrypt(unsigned char * cipher, unsigned char *plain, int length);
};
#endif // GRAIN128_H_INCLUDED

Oh I forgot, the program above is after I edited, trying to make it work for my board.
This is his original working code for Uno R3:

#include <grain128.h>



#include <DHT.h>

#include <present.h>
        
const int DHTPIN = 2;       
const int DHTTYPE = DHT11;  
 
DHT dht(DHTPIN, DHTTYPE);
int encryptType = 1;
char roundkey[PRESENT_KEY_SIZE_128/8*(PRESENT_ROUNDS+1)];
char key[16] = "1234567890123456";
char IV[12] = "123456789012";
Grain grain(key, IV);
unsigned char * tmp1 = new char[8];
char str_text[8];
unsigned long time1 = 0;
unsigned long time2 = 0;
void setup() {
  
  Serial.begin(9600);
  dht.begin();        
  //Serial.println("OK");
}
 
void loop() {
        
  if(Serial.available())
  {
      String typeAndKey = Serial.readString();
      encryptType = typeAndKey.substring(0,1).toInt();
      typeAndKey.substring(1).toCharArray(key, 17);
      //Serial.println("a" +encryptType);
      //Serial.println(String(encryptType) + " key = " + String(key));
      //Clear cache in memory of serial
      while(Serial.available() > 0) {
          Serial.read();
      };
  }
  else
  {
      int doam =  dht.readHumidity();
      int nhietdo = dht.readTemperature();
      int ran = random(10,99); 
      String tmp = String(nhietdo)+"#"+ String(doam)+"#"+ String(ran);
      //Serial.println(tmp);
      int len = tmp.length();
      //Serial.println(key);
      tmp.toCharArray(str_text, 9);
      if(encryptType == 1)
      {
        //Serial.println(str_text);
        present_64_128_key_schedule(key,roundkey);
        unsigned long long ull_tmp = *(unsigned long long *)str_text;
         // Serial.println(ULongLongToString(ull_tmp)); 
         //time1 = time2;
         present_encrypt((char *)&ull_tmp, roundkey);
         //time2 = millis();
         //unsigned long timeTest = time2-time1;
         //Serial.println(timeTest);
        Serial.println(ULongLongToString(ull_tmp));        
      }
      if(encryptType == 2)   
     {
      //unsigned long time1 = millis();
       grain.Encrypt(str_text, tmp1, 8);
       //unsigned long time2 = millis();
       //Serial.println(time2-time1);
       unsigned long long ull_tmp = *(unsigned long long *)tmp1;
       Serial.println(ULongLongToString(ull_tmp));
      }
      delay(500);
  }
 
}
 String ULongLongToString(unsigned long long number)
 {
  unsigned long long tmp_num = number;
  if(tmp_num ==0) return "0";
  String tmp="";
  while(tmp_num!=0)
  {
    int n= tmp_num%10;
    tmp = String(n) + tmp;
    tmp_num = tmp_num/10;
  }
  return tmp;
 }

Those libraries you posted are only the .h files. Do you also have the corresponding .cpp files in the right place?
Also, can YOU compile it for an UNO? (Even if you don't have an UNO board to upload it to.)

Can you change your board type to Uno and "verify" the code? You don't need an Uno to do that.

It looks like a simple problem, maybe with one library installed incorrectly.

I got .cpp file in here as well, it not the cause.
And I tried change board setting to Uno, it show up this error, may be I messed up the code

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

Build options changed, rebuilding all
C:\Users\EUPHOR~1\AppData\Local\Temp\ccPY0KFl.ltrans0.ltrans.o: In function `loop':

D:\Desktop on HDD\New folder\Arduino\sketch_dec05a/sketch_dec05a.ino:54: undefined reference to `present_64_128_key_schedule(unsigned char*, char*)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Yes that does seem to be the case. It is not finding that present function for some reason.

So, where is this present_64_128_key_schedule function supposed to come from? It is not defined in the code you posted. Which is what the compiler (linker) is telling you.

This might mean that your friend has a different set of libraries installed on his computer. You need the same set of libraries to compile this code.

The header files that you posted so far are not "libraries". They are just header files for those libraries. Speaking figuratively, they are just tips of the iceberg. And you need the whole iceberg.

Yes. The .h declares the function. It says that there is going to be a function with that signature (name and input parameters.)

The .cpp defines the function. It contains the real code inside the function. The error message is "undefined reference" so it means the .cpp is missing or incorrect.