fenugrec / nissutils

49 stars 15 forks source link

MSYS2 (MINGWS64) build issues #16

Open nistunedev opened 1 year ago

nistunedev commented 1 year ago

Build issues from g++.exe (Rev4, Built by MSYS2 project) 12.2.0 when using Nislib as part of a C++ project

cli_utils/md5/md5.c -#include +#include "md5.h"

nislib.c (Line 207) error: expected primary-expression before 'xor' token

fenugrec commented 1 year ago

yeah, you can't always just compile C code as C++.

If you want to use nissutils from a c++ app you may need to add some extern C { ... directives

nistunedev commented 1 year ago

First error also happens if building using the standard makefile using just gcc (same version 12.2.0) inside MSYS/MINGW. I ended up taking the bits I needed from nislib and compiling into a static library and linking that in for now

fenugrec commented 1 year ago

any reason you're not adapting the cmake files ? cmake should add the correct -I... gcc flags automatically , regardless of platform + compiler combo

fenugrec commented 1 year ago

BTW, I'm glad you find nisprog + npkern + nissutils useful in your software, but remember it's GPL-licensed which has certain restrictions and requirements regarding using modified source code.

nistunedev commented 1 year ago

Thanks. Will look into cmake. Using this the functions to decode later CAN DAT files in a standalone utility. Aware of GPL restrictions and no parts used in commercial software.