Closed TheElesty closed 12 months ago
Sorry that building causing problem. The best way to build is to use cmake. The CMakeList.txt configuration file unfortunately have the MDF_SHARED_LIB=ON. This means that also the C# interface is built which CMake handle but not CLion. If you turn off the C# interface build, most of your errors will disappear.
The MDF library is dependent on 2-5 external libraries,The C++ library depends on ZLIB and EXPAT. The unit test is dependent on the Google Unit test while the MdfViewer are dependent on WxWindows and Boost.
Basically there exist 3 different way to solve external dependencies. The first solution is to use an external component path. See the COMP_DIR option below. This is the preferred solution if "you" are many user of the library. This is typical used by companies. The ihedvall/components repository includes script files for building external libraries.
The second way is to replace the component path with vcpkg. The vcpkg is little bit funky but it will build all external dependencies for you on the fly. It will take some more compilation time at the first build (boost and wxWindows). This functionality is newly added.
The third way is let CMake download the external libraries if they are missing. This works OK for smaller libraries as Google unit test, ZLIB and expat but doesn't work for GUI (boost/wxWindows) . I think this is your current mode.
My current CLion settings are as below:
Please build mdf library before building mdf_test. I think you need a chicken before you want a egg.
Please build mdf library before building mdf_test. I think you need a chicken before you want a egg.
mdf_test is my testing project using mdf.lib from instalator
Sorry, I have not seen that you are using the library from installator. Can you try to use the .lib from github action? https://github.com/ihedvall/mdflib/actions/runs/6019755660
Note: you may still need the lib of dependeces(zlib, expat) to link.
Thank, will try both suggestion and I let u know if that worked
I don't like this .NET Framework... stuff in the compiler. Just wondering if the /clr compiler option is set in Visual Studio ?
So using prebuild lib from github action works. Thanks for fast response
When trying to use mdflib (installed using .exe file in both main and release 2.0.0), I am unable to compile the test project. Tested in CLion with Visual Studio 2017/2022 and NMake generator
MDF lib v2.0.0 CLion with NMake generator:
CLion with Visual Studio 15 2017 generator:
CLion with Visual Studio 17 2022 generator:
Visual Studio 2022:
When using version form main (using CLion with Visual Studio 15 2017 generator) I got this:
I tried also to build lib from source, but without success (again in both vs17 and vs22). I was able to build mdflib target in vs 17, but for mdflibrary I got an error that build tools are incorrect, and even after retargeting solution it won't change.