0

I am trying to use the "libxd" library for C++ which is similar to Processing or p5.js (https://bernhardfritz.github.io/libxd/#/?id=libxd-032)

I followed everything correctly from this site: https://bernhardfritz.github.io/libxd/#/quickstart

This is the example I am trying to run:

#include <xd/xd.hpp>

using namespace xd;

void setup() 
{
    size(640, 480);
}

void draw() 
{
    rect(50, 50, 100, 100);
}

void destroy() 
{

}

Upon trying to run their "Hello rectangle" example (also https://bernhardfritz.github.io/libxd/#/quickstart) using this compiling options:

g++ -std=c++11 sketch.cpp -o sketch -Iinclude -Llib -lxd -lglad -lglfw3 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

I get this error:

c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: lib/libglfw3.a(init.c.obj):init.c:(.text+0x22): undefined reference to `__ms_vsnprintf'
collect2.exe: error: ld returned 1 exit status

Here is also the picture:

error

I tried changing #include option, switching directories, similar stuff like that.

I really have no clue what could be the issue.

MatejR
  • 76
  • 9
  • Please [edit your question](https://stackoverflow.com/posts/57137240/edit) and add the code and errors inside the question. That makes your question easier to read and easier to answer. –  Jul 21 '19 at 21:57
  • Fixed it, hopefully it is better now :D – MatejR Jul 21 '19 at 22:01
  • 2
    Almost, please copy text as text, don't screenshot and post as image. Screenshots of text are bad for plenty of reasons: They can't be used by search engines to help other people with the same issue find your question (and hopefully answers), they can't be easily copied by people who want to help, and they can't be read by people who use screenreaders or otherwise are unable to see images. – Max Vollmer Jul 21 '19 at 22:06
  • One thing I noticed: The error message in your title and the one in your screenshot do not match. – Max Vollmer Jul 21 '19 at 22:15
  • For the one in your screenshot this seems related: https://stackoverflow.com/questions/29199720/undefined-reference-to-ms-vsnprintf-when-linking-glfw-statically – Max Vollmer Jul 21 '19 at 22:15
  • @MaxVollmer wow I didn't even notice, I was also trying to fix that and went to write about that, but fortunately I managed to fix that error. – MatejR Jul 21 '19 at 22:17
  • I have both versions and tried changing the PATH variable to match the 64 one but the problem still exists. – MatejR Jul 21 '19 at 22:19

0 Answers0