-
Notifications
You must be signed in to change notification settings - Fork 338
Replies: 3 comments · 12 replies
-
Yes. Integration with CMake is much easier when you need to link other libraries. Did you build from source or used the package? Did you also build with MinGW? |
Beta Was this translation helpful? Give feedback.
All reactions
-
I think not. I thought the package was something like "after built". Do you imply that after fetching the prebuilt package, like [matplotplusplus-1.1.0-Linux.tar.gz], with /include and /lib, it still has to be built or configured? I think that's my lack of knowledge on the workflow. Please enlighten me on the following steps, and the complete workflow.
|
Beta Was this translation helpful? Give feedback.
All reactions
-
It all needs to be built with the same compiler + platform. The prebuilt package you downloaded is for Linux + GCC. If you need windows + mingw, then you need to install it from source, or use one of the other methods such as fetchcontent. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried to build it from source with CMake several times, but always encounter this. Is there a general workaround for a typedef conflict or a resolution?
|
Beta Was this translation helpful? Give feedback.
All reactions
-
We do test the library with MinGW for every commit, but it seems like MinGW has lots of pitfalls and integration problems that are hard to foresee and fix. In this case, |
Beta Was this translation helpful? Give feedback.
All reactions
-
I think you are right. I tried to bypass the collision by modifying include paths, but it seems the problem is intrinsic. I have been starting to feel that MinGW do have its ecosystem problem. I stick to MinGW for I appreciate the lightweight and minimal project setup of GCC. My ultimate compiling platform is Linux + GCC, but I don't wanna set a subsystem nor a virtual env for it as my previous practice makes me tired of them. In the future I will switch to Linux + GCC once I figured out how to boot from an external hard drive. Before that I think I may struggle with other toolchains. MSVC isn't my best option though I am always a Windows user. It takes a lot of space for installation and its project system is perplexing. But it may be an intermediate remedy if have to. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Visual Studio has CMake projects now. Or you can bypass the Visual Studio IDE and use CLion with MSVC. Or just move to GCC on Linux, depending on the application. I don't have a lot of experience with MinGW. I had problems almost every time I needed it. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Greetings. I have switched to MSVC for less trouble developing C++ in full capacity, for now. I used cl.exe with VSCode rather than its IDE, so the file system along with dev operation is acceptable and transition is kinda smooth. But when building packages, especially popular packages nowadays, including yours, utilizes C++17 standards. It seems VC2019 is defaulted as C14. I searched a lot for changing this default, almost all the answers I can find is changing C++ Standard on a VS IDE project-level, and such changes are not global. How would I change the MSVC C/C++ Standard permanently and globally? Thanks for the help. |
Beta Was this translation helpful? Give feedback.
All reactions
-
That's not possible. The target standard is defined in the command line. If you're using an IDE, then you have to tell which standard to use for your targets. In CMake, that would be: target_compile_features(myexe PRIVATE cxx_std_17) |
Beta Was this translation helpful? Give feedback.
All reactions
-
That reminds me of a command in g++, which I thought I would never have to use:
So similarly, if I do:
Would that enable my compilation under C++17? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes. I believe so. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Greetings. I have switched to MSVC with matplot++ installed with vcpkg. It took me some time to get comfortable with compiling with cl. So far so good. Then as planned, I wished to utilize matplot into a simple line plot. While running the cl command I encountered messages which might be related to different version from static-release and dynamic-release? Or is it that I use the wrong command?
Message:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried to switch the command and it seems the errors are reduced. I presumed that I am on the right direction, right? Then what do those following errors relate to? Are they errors from source code, or some extra libraries I need to link to? Btw, I am surprising to find that the matplot.lib needs to be dynamically linked, as I thought only the .dll need to be dynamically linked. Mind enlightening the difference?
Errors now become:
|
Beta Was this translation helpful? Give feedback.
All reactions
This discussion was converted from issue #260 on April 16, 2022 17:07.
-
Bug category
Describe the bug
I am a newbie in the way of C++ and try to build some tasks as I did with Python. Since I am using mingw, I use the system-prebuilt Linux distribution for include and lib and put them into my default include and lib path. To test my installation, I run the script in examples/line_plot/plot/plot_1.cpp with g++ plot_1.cpp -lmatplot. ld could find the libmatplot.a but it complies as if no matplot functions were in the .a file. What am I doing wrong with the build process?
Cmake seems a big program so I currently stick to make with simple g++ commands. The only experience I have with Cmake was building packages, so a complie-able command is highly appreciated.
I used the similar command to link to other third-party libraries and it complies well, so I suppose the syntax is fine.
Steps to Reproduce
Output
Some user-specific details are trimmed.
Platform
Environment Details:
Additional context
Beta Was this translation helpful? Give feedback.
All reactions