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

Please provide working .a/.lib files #487

Open
DonaldDuck313 opened this issue Nov 12, 2023 · 1 comment
Open

Please provide working .a/.lib files #487

DonaldDuck313 opened this issue Nov 12, 2023 · 1 comment

Comments

@DonaldDuck313
Copy link

I'm trying to write a program on Windows that uses cmark as a library, but I can't get it to compile. I tried running the following commands in a WSL to build a libcmark.a file for MinGW:

sudo apt install g++-mingw-w64
git clone https://github.com/commonmark/cmark
cd cmark
sed -i 's/i686/x86_64/g' toolchain-mingw32.cmake    # Set the architecture to x86_64
make mingw

This creates a libcmark.a file in build-mingw/src, but when I try to use it in my project, I get a linker error:

main.o:main.cpp:(.text+0x8d): undefined reference to `__imp_cmark_markdown_to_html'

If I try MSVC instead, it's even worse, I haven't even managed to compile a .lib file. It says here to simply run nmake, but when I do that, I get the following error:

NMAKE : fatal error U1064: MAKEFILE not found and no target specified

If I try nmake MAKEFILE instead, I get

NMAKE : fatal error U1073: don't know how to make 'MAKEFILE'

All this would be much easier if you simply provided working .a and .lib files that I could download and use without compiling them myself.

@compnerd
Copy link
Contributor

It would be easier if you just used MSVC to build. CMake, Ninja are both vended by MSVC if you install the C++ CMake Tools component.

cmake -B out -G Ninja -S . -D CMAKE_BUILD_TYPE=Release -D CMARK_BUILD_SHARED=NO
cmake --build out

Should build a static library for you.

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