n2n icon indicating copy to clipboard operation
n2n copied to clipboard

How to import n2n.lib to windows QT?

Open Tex-Tang opened this issue 4 years ago • 2 comments

Hi, I'm trying to import n2n.lib to my Qt project. Here is the errors what I got.

First trial

Directory structure

TestQT
├── n2n   # API server
  ├── include       # same as include dir as n2n-2.8 stable repo
  └── n2n.lib        # Built by following Building.md
├── edge.cpp      # Trying to do function to connect supernode
└── TestQT.pro    # My Qt configurations

Errors

Cannot open include file: 'win32/n2n_win32.h': No such file or directory

After copying win32 folder from n2n folder

Directory structure

TestQT
├── n2n   # API server
  ├── n2n.lib        # Built by following Building.md
  └── include       # same as include dir as n2n-2.8 stable repo
    └── win32       # Folder copied from n2n folder
├── edge.cpp      # Trying to do function to connect supernode
└── TestQT.pro    # My Qt configurations

Errors

Cannot open include file: 'config.h': No such file or directory

After adding config.h based on #366

Directory structure

TestQT
├── n2n   # API server
  ├── n2n.lib        # Built by following Building.md
  └── include       # same as include dir as n2n-2.8 stable repo
    ├── config.h    # Added
    └── win32       # Folder copied from n2n folder
├── edge.cpp      # Trying to do function to connect supernode
└── TestQT.pro    # My Qt configurations

Errors

'speck_context_t': redefinition; different basic types

How should I do to import the library properly, I'm using Qt / C++.

Tex-Tang avatar Dec 05 '20 15:12 Tex-Tang

  1. redefine speck_context_t as typedef struct { u128 rk[34]; u64 key[34]; u32 keysize; }speck_context_t,he_context_t;
  2. add #include "speck.h" in n2n_typedefs.h
  3. delete typedef struct speck_context_t he_context_t; in n2n_typedefs.h

huangli0125 avatar Sep 23 '21 02:09 huangli0125

@huangli0125 Do you want to provide a pull request?

Logan007 avatar Sep 23 '21 06:09 Logan007