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

How to import n2n.lib to windows QT? #525

Open
Tex-Tang opened this issue Dec 5, 2020 · 2 comments
Open

How to import n2n.lib to windows QT? #525

Tex-Tang opened this issue Dec 5, 2020 · 2 comments

Comments

@Tex-Tang
Copy link

Tex-Tang commented Dec 5, 2020

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 Tex-Tang changed the title How to import .lib to windows QT? How to import n2n.lib to windows QT? Dec 5, 2020
@huangli0125
Copy link

huangli0125 commented Sep 23, 2021

  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

@Logan007
Copy link
Collaborator

@huangli0125 Do you want to provide a pull request?

ChingCdesu added a commit to ChingCdesu/n2n that referenced this issue Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants