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

Link error when build with cmake #2

Open
AnnnSt opened this issue Aug 1, 2022 · 14 comments
Open

Link error when build with cmake #2

AnnnSt opened this issue Aug 1, 2022 · 14 comments

Comments

@AnnnSt
Copy link

AnnnSt commented Aug 1, 2022

Hi Keyple team

I am trying to fetch the keyple-cpp-meta repository and build in my local machine with windowns x86 environment using VSCode, but i face several linking error during the compilation of the cpp examples. Below is an example:
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall keyple::plugin::stub::StubPluginFactoryBuilder::Builder::~Builder(void)" (_imp??1Builder@StubPluginFactoryBuilder@stub@plugin@keyple@@QAE@XZ) referenced in function "public: void * __thiscall keyple::plugin::stub::StubPluginFactoryBuilder::Builder::`scalar deleting destructor'(unsigned int)" (??_GBuilder@StubPluginFactoryBuilder@stub@plugin@keyple@@QAEPAXI@Z) under project : UseCase1_ExplicitSelectionAid_Stub and file :Main_ExplicitSelectionAid_Stub.obj

the keyplepluginstubcpplib.lib has exported under build\externals\keyple-plugin-stub-cpp-lib\src\main\Debug, thus i may seek your help regarding the linking error.

Best regards
Ann

@AnnnSt
Copy link
Author

AnnnSt commented Aug 26, 2022

Hi @AlexandreMunsch , @jeanpierrefortune
Good day to you ,

May i know whether you are able to reproduce this error? thanks!

BR
Ann

@AlexandreMunsch
Copy link
Contributor

Hi @AnnnSt

I will have a look today.

Best regards,
Alex

@AnnnSt
Copy link
Author

AnnnSt commented Aug 26, 2022

Hi Alex

Thanks again for your reply.
Another question which related to keyple c++ library using arm-linux-gnueabi . I know that v0.9 is not maintained anymore but on my side this is the working keyple c++ library . I tried to integrate keyple library to a arm 32bit reader, i compiled the v0.9 release of keyple library with arm-linux-gnueabi v9.4 on Ubuntu, and i get multiple definition error . i have attached the error log :

error_log.txt
and my cmake setting:
arm-unknown-gnueabi-linux.txt

BR
Ann

@AnnnSt
Copy link
Author

AnnnSt commented Aug 31, 2022

Hi @AlexandreMunsch

May i know whether you are able to reproduce the error or any solutions ? Thanks a lot for your help.

BR
Ann

@AlexandreMunsch
Copy link
Contributor

Hi @AnnnSt,

I finally found some time to work on your issue and the good news is that I was able to reproduce it. Now I need some more time to understand what's going on. I'll keep you posted.

Best regards,
Alex

@AnnnSt
Copy link
Author

AnnnSt commented Sep 7, 2022

Hi @AlexandreMunsch,

Thanks again for the update, looking forward for the solution. Any ideas for the below issue as well ?

BR
Ann

Hi Alex

Thanks again for your reply. Another question which related to keyple c++ library using arm-linux-gnueabi . I know that v0.9 is not maintained anymore but on my side this is the working keyple c++ library . I tried to integrate keyple library to a arm 32bit reader, i compiled the v0.9 release of keyple library with arm-linux-gnueabi v9.4 on Ubuntu, and i get multiple definition error . i have attached the error log :

error_log.txt and my cmake setting: arm-unknown-gnueabi-linux.txt

BR Ann

@AlexandreMunsch
Copy link
Contributor

Hi @AnnnSt

To reproduce your issue yesterday I had to bypass the TOOLCHAIN_FILE definition check in the main CMakeLists.txt file. As soon as I fixed that, by properly settings the CMAKE_TOOLCHAIN_FILE variable in my VSCode build, it all compiled just fine.

Any chance you did something similar?

If not, I might need more information to help you further like VSCode config files, Windows Kit installed, full log file, etc...

Best regards,
Alex

Note: I'll have a look at your 0.9 issue a bit later on. I'll open an issue on the dedicated repos if a follow up is required.

@AnnnSt
Copy link
Author

AnnnSt commented Sep 7, 2022

Hi @AlexandreMunsch

Thanks again for your response,
Regarding issue 1 on keyple-cpp-meta:
- May i know what do you mean by "bypass the TOOLCHAIN_FILE definition check in the main CMakeLists.txt file", this check happens in several cmakelist.txt file as the external component cmake file will also check the toolchain.
I will fetch the clean repository and build again with visual studio(or cmd line interface) instead of visual studio code.
- In visual studio code i still face the same error, may i know whether you provide the toolchain_file variable in vscode default build config task or you direct modify the cmake cache? By any chance you will publish this fix to a checkpoint so that i can take a look for reference ?

Regarding issue 2 on keyple v0.9
- May i know whether the code is compliant to early version of c++ (etc for gcc v4.6.3), i am trying to create a demo project with keyple library linux reader , unfortunately the reader SDK itself is based on v4.6.3, i am also checking with reader development team for the possible solution to support higher version of gcc.

Really appreciate your effort on reopening the topic.

BR
Ann

@AlexandreMunsch
Copy link
Contributor

AlexandreMunsch commented Sep 7, 2022

@AnnnSt,

In visual studio code i still face the same error, may i know whether you provide the toolchain_file variable in vscode default build config task or you direct modify the cmake cache

As a first step, you can try adding INCLUDE(toolchain/clang-windows.cmake) into the main (root) CMakeLists.txt file, just above the IF(NOT TOOLCHAIN_FILE) check.

By any chance you will publish this fix to a checkpoint so that i can take a look for reference ?

It's not really a fix. It's more of a local setting related to your environment (IDE, toolchain, dev kits installed, etc...). Everyone's different so I can't commit a fix for that. At least I don't think so...

May i know whether the code is compliant to early version of c++ (etc for gcc v4.6.3)

I think I only went down to GCC 6+ at the time. I'll try 4.6 as soon as I can.

Best regards,
Alex

@AnnnSt
Copy link
Author

AnnnSt commented Sep 8, 2022

Hi @AlexandreMunsch

Thanks again for your support , I have included the toolchain file in the cmakelists.txt

As a first step, you can try adding INCLUDE(toolchain/clang-windows.cmake) into the main (root) CMakeLists.txt file, just above the IF(NOT TOOLCHAIN_FILE) check.

Please refer to the logfile from my CMAKE build output as i still got the error:
cmake_build_log.txt
vs_build_log.txt
My MSVC build tool is Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.31.31103

Besides, may i know when the official release date of keyple c++ v2.0 library ? Thanks again

BR
Ann

@AlexandreMunsch
Copy link
Contributor

AlexandreMunsch commented Sep 8, 2022

Hi @AnnnSt,

Regarding issue 2 on keyple v0.9

  • May i know whether the code is compliant to early version of c++ (etc for gcc v4.6.3), i am trying to create a demo project with > keyple library linux reader , unfortunately the reader SDK itself is based on v4.6.3, i am also checking with reader development > team for the possible solution to support higher version of gcc.

I had a very hard time trying to setup a working version of GCC 4.6 on my laptop but succeeded with GCC 4.7, which I suppose is close enough. Keyple 0.9 is almost compatible with this version. I only had 3 issues (related to the STD lib in fact):

  1. missing std::map::emplace()
  2. missing std::thread::sleep_for()
  3. missing #include <cstdint> in 2 or 3 header files

Item 3 is straightforward. Items 1 and 2 should be relatively easy to workaround.

Best regards,
Alex

@AlexandreMunsch
Copy link
Contributor

Hi @AnnnSt,

Please refer to the logfile from my CMAKE build output as i still got the error:
cmake_build_log.txt
vs_build_log.txt
My MSVC build tool is Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.31.31103

Can you pull the latest version and try again? I think I fixed that problem yesterday.

Besides, may i know when the official release date of keyple c++ v2.0 library ? Thanks again

You can already fetch the existing tags. Though I will release new packages in a very short while (couple of weeks top).

Best regards,
Alex

@AnnnSt
Copy link
Author

AnnnSt commented Sep 9, 2022

Hi Alex
Thanks again for your feedback, have you ever encounter any build error with arm-linux-gnueabi?
On my side the error only happened with arm-linux-gnueabi .
BR
Ann

Hi Alex

Thanks again for your reply. Another question which related to keyple c++ library using arm-linux-gnueabi . I know that v0.9 is not maintained anymore but on my side this is the working keyple c++ library . I tried to integrate keyple library to a arm 32bit reader, i compiled the v0.9 release of keyple library with arm-linux-gnueabi v9.4 on Ubuntu, and i get multiple definition error . i have attached the error log :

error_log.txt and my cmake setting: arm-unknown-gnueabi-linux.txt

BR Ann

@AnnnSt
Copy link
Author

AnnnSt commented Sep 9, 2022

Hi @AnnnSt,

Please refer to the logfile from my CMAKE build output as i still got the error:
cmake_build_log.txt
vs_build_log.txt
My MSVC build tool is Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.31.31103

Can you pull the latest version and try again? I think I fixed that problem yesterday.

Besides, may i know when the official release date of keyple c++ v2.0 library ? Thanks again

You can already fetch the existing tags. Though I will release new packages in a very short while (couple of weeks top).

Best regards, Alex
Hi Alex

I have tried to fetch the latest code and rebuild again but unfortunately the error still exist , from the error log the unresolved external symbol is from keyple-plugin-stub-cpp-lib , may i know if you built from keyple-cpp-meta repository you will see the same error ?
BR
Ann

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