Skip to content

Issue while compiling the project on Windows #24

@alpyildirim97

Description

@alpyildirim97

Hi,

I encountered with a compilation error when I am trying to compile the code on my windows machine. I use Mingw64 to use make and other POSIX compatibilities. The issue appeared on Options.hpp which indicates 'getopt' was not declared in this scope. I am sharing the detailed error message below:

g++ -std=c++11 -Wno-deprecated -O2 -DWIN32 -I./include -o bin/vf3 main.cpp -DVF3 main.cpp: In function 'int32_t main(int32_t, char**)': main.cpp:125:34: error: 'opt' was not declared in this scope 125 | std::ifstream graphInPat(opt.pattern); | ^~~ main.cpp:129:48: error: 'CreateLoader' was not declared in this scope; did you mean 'CreateJobSet'? 129 | ARGLoader<data_t, Empty>* pattloader = CreateLoader<data_t, Empty>(opt, graphInPat); | ^~~~~~~~~~~~ | CreateJobSet main.cpp:129:67: error: expected primary-expression before ',' token 129 | ARGLoader<data_t, Empty>* pattloader = CreateLoader<data_t, Empty>(opt, graphInPat); | ^ main.cpp:131:67: error: expected primary-expression before ',' token 131 | ARGLoader<data_t, Empty>* targloader = CreateLoader<data_t, Empty>(opt, graphInTarg); | ^ main.cpp:146:40: error: 'CreateMatchingEngine' was not declared in this scope 146 | MatchingEngine<state_t >* me = CreateMatchingEngine(opt); | ^~~~~~~~~~~~~~~~~~~~ make: *** [Makefile:10: vf3] Error 1
After some research I noticed that in Options.hpp file, #include <unistd.h> was defined in #ifdef WIN32 block which prevents to include getopt on windows. I updated that part as follows and the project compiled:

#ifdef WIN32 #include <getopt.h> #else #include <unistd.h> #endif
Please take a look if this is a real issue or somehow somethings wrong with my build. Hope it helps, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions