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

Including tlse.c when using VS 2002 compiler, gives this error #122

Open
naushadck opened this issue Feb 11, 2025 · 5 comments
Open

Including tlse.c when using VS 2002 compiler, gives this error #122

naushadck opened this issue Feb 11, 2025 · 5 comments

Comments

@naushadck
Copy link

As per the usage part, it shows as follows.

You just #include "tlse.c" in your code. Everything is a single file.

However by including the tlse.c, compiler gives 161 errors.

Error (active) E0337 linkage specification is incompatible with previous "crypt_argchk" (declared at line 12953 of "libtomcrypt.c")
libtomcrypt.c 17022

@eduardsui
Copy link
Owner

eduardsui commented Feb 12, 2025

Hello,

I've tested with both gcc and clang, everything seems ok. What compiler (and version) are you using?

Also, please provide full info when opening an issue, in order to be able to check it.

You can also use the standard libtomcrypt library (recommended), and include tlse.h and and tlse.c to your project. I don't think "wrong usage is given" is the best decription for this issue. You could try something like this: "Including tlse.c when using X compiler, gives this error" :)

Also, it is possible to you had included tlse.c or libtomcrypt.c more than once (maybe in different source files). If this is the case, please add tlse.c to your project and just include tlse.h without defining TLSE_AMALGAMATION.

E.

@naushadck naushadck changed the title Wrong usage is given. Including tlse.c when using VS 2002 compiler, gives this error Feb 12, 2025
@naushadck
Copy link
Author

Hello Sir,

Please see the details given below.
Windows 10
Visual studio 2022
Followed to the usage section and added tlse.c in to newly created windows project.
We can add tlse.h in to our source and compiling. Works file.

However, adding tlse.c gives the mentioned error.
I can send you the screen shot of the error.

I like this product. Trying to explore more on this and how to make use of it in my project.

@eduardsui
Copy link
Owner

Ok, I've tested with VS2022, seems that it compiles libtomcrypt.c with the C++ compiler instead of C compiler (or using C++ rules on C code). It is just frustrating that Microsoft forces C++ compiler rules on C code. You should compile the standard tomcrypt library, then include tlse.c to your project. Use "extern "C" before including tlse.c. However, on the libtomcrypt.c side, I cannot help you. It is just a mess with the MS C/C++ compiler. tlse.c seems to be compiling just fine, but libtomcrypt.c ... it's another story.

I recommend compiling tomcrypt and adding it to your project, instead of using libtomcrypt. If tomcrypt compiles using VS2022, then TLSe should compile just fine.

Hope it helps,
Eduard

@naushadck
Copy link
Author

Thank you for your time and support.

@naushadck
Copy link
Author

Just sharing on what i was able to do.

Build the tlse.lib.
tlse.h was added to my project and linked with tlse.lib.
There was a small name conflict with one enum. Which i modified slightly and works fine.

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