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

Building on Windows #8

Closed
becherling opened this issue Aug 7, 2021 · 7 comments
Closed

Building on Windows #8

becherling opened this issue Aug 7, 2021 · 7 comments

Comments

@becherling
Copy link

Hey bro,

Im trying to compile this awesome tool on Windows. Im using msys2 x64 with make and gcc installed. I get the following error when I try to compile:

C:\Users\pizza\Code3\xmq>make
Building 0.2-82-gef7507c
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/cmdline.cc -MMD -fPIC -c -o build/cmdline.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/document.cc -MMD -fPIC -c -o build/document.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/parse.cc -MMD -fPIC -c -o build/parse.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/render.cc -MMD -fPIC -c -o build/render.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/util.cc -MMD -fPIC -c -o build/util.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -Ibuild -I. src/main/cc/xmq_implementation.cc -MMD -fPIC -c -o build/xmq_implementation.o
src/main/cc/xmq_implementation.cc: In function 'bool xmq_implementation::isHtml(std::vector<char>&)':
src/main/cc/xmq_implementation.cc:63:14: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'?
   63 |             !strncasecmp(&buffer[i], doctype, strlen(doctype)))
      |              ^~~~~~~~~~~
      |              strncmp
src/main/cc/xmq_implementation.cc:68:15: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'?
   68 |             (!strncasecmp(&buffer[i], html, strlen(html))))
      |               ^~~~~~~~~~~
      |               strncmp
src/main/cc/xmq_implementation.cc: In function 'bool xmq_implementation::firstWordIsHtml(std::vector<char>&)':
src/main/cc/xmq_implementation.cc:87:42: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'?
   87 |         if (i+len+1 < buffer.size() && (!strncasecmp(&buffer[i], "html", len)))
      |                                          ^~~~~~~~~~~
      |                                          strncmp
src/main/cc/xmq_implementation.cc: In function 'bool xmq_implementation::firstWordIs(const char*, size_t, const char*)':
src/main/cc/xmq_implementation.cc:112:36: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'?
  112 |         if (i+len+1 < buf_len && (!strncasecmp(&buffer[i], word, len)))
      |                                    ^~~~~~~~~~~
      |                                    strncmp
make: *** [Makefile:74: build/xmq_implementation.o] Error 1

@weetmuts
Copy link
Collaborator

weetmuts commented Aug 7, 2021

Cool, that problem is probably just that you have to include the right header file on Windows. https://stackoverflow.com/questions/39659331/strncasecmp-and-strcasecmp-has-not-been-declared

becherling added a commit to becherling/xmq that referenced this issue Aug 7, 2021
@weetmuts
Copy link
Collaborator

Did you solve the problem?

@becherling
Copy link
Author

Hey, sorry for late reply. I didnt solve it.

@weetmuts
Copy link
Collaborator

I created a github action that builds on Windows. https://github.com/weetmuts/xmq/actions/runs/1267057348
Is this of help to you?

@becherling
Copy link
Author

Hey my friend. I got it partially compiled using https://jmeubank.github.io/tdm-gcc/. Only the xmq binary builds, the other binaries throw errors. Is enough for me whenever I have to use Windows.
Im using XMQ for my static site generator: https://gitlab.com/schnell1/nexa.

@weetmuts
Copy link
Collaborator

@becherling Interesting, first time I heard of tdm-gcc. If you have any build script please share and I might be able to integrate it.

@weetmuts
Copy link
Collaborator

weetmuts commented Feb 8, 2024

Building on windows now works and even creates an installer!

@weetmuts weetmuts closed this as completed Feb 8, 2024
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

Successfully merging a pull request may close this issue.

2 participants