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

Compile on windows #8

Closed
vabatta opened this issue Dec 2, 2014 · 3 comments
Closed

Compile on windows #8

vabatta opened this issue Dec 2, 2014 · 3 comments

Comments

@vabatta
Copy link

vabatta commented Dec 2, 2014

Hi,

I would like to have more info on how to compile the hans code (branch "cygwin") on windows.
I downloaded cygwin with gcc-c++ and make, but then I do the .exe compiler through the cygwin terminal, if I execute it, I get:
"Error while starting application (0xc000007b)".

What should I do?

Thanks!

@friedrich
Copy link
Owner

Did you run hans as administrator? Does it work with the binary provided?

@vabatta
Copy link
Author

vabatta commented Dec 3, 2014

Yes. Binary provided works perfectly. Now, I did some change to the source, and I would like to recompile it but for windows.

@Anime4000
Copy link

I trying to compile hans-1.0 with cygwin, no luck...
trying to using older gcc (5.4.0) still same error

anime4000@anime-pc ~/hans-master
$ make
mkdir -p build
i686-pc-cygwin-g++ -c src/tun.cpp -o build/tun.o -c -g -std=c++98 -pedantic -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -fpermissive `sh osflags c `
src/tun.cpp: In constructor ‘Tun::Tun(const string*, int)’:
src/tun.cpp:78:33: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     winsystem(cmdline.str().data());
                                 ^
src/tun.cpp:44:13: note:   initializing argument 1 of ‘void winsystem(char*)’
 static void winsystem(char *cmd)
             ^
src/tun.cpp: In member function ‘void Tun::setIp(uint32_t, uint32_t)’:
src/tun.cpp:100:33: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     winsystem(cmdline.str().data());
                                 ^
src/tun.cpp:44:13: note:   initializing argument 1 of ‘void winsystem(char*)’
 static void winsystem(char *cmd)
             ^
i686-pc-cygwin-g++ -c src/sha1.cpp -o build/sha1.o -c -g -std=c++98 -pedantic -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -fpermissive `sh osflags c `
i686-pc-cygwin-g++ -c src/main.cpp -o build/main.o -c -g -std=c++98 -pedantic -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -fpermissive `sh osflags c `
src/main.cpp: In function ‘int main(int, char**)’:
src/main.cpp:225:29: error: variable ‘main(int, char**)::addrinfo hints’ has initializer but incomplete type
             struct addrinfo hints = {0};
                             ^
src/main.cpp:229:44: error: ‘AI_ADDRCONFIG’ was not declared in this scope
             hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
                                            ^
src/main.cpp:231:72: error: ‘getaddrinfo’ was not declared in this scope
             int err = getaddrinfo(serverName.data(), NULL, &hints, &res);
                                                                        ^
src/main.cpp:234:68: error: ‘gai_strerror’ was not declared in this scope
                 syslog(LOG_ERR, "getaddrinfo: %s", gai_strerror(err));
                                                                    ^
src/main.cpp:238:72: error: invalid use of incomplete type ‘struct main(int, char**)::addrinfo’
             sockaddr_in *sockaddr = reinterpret_cast<sockaddr_in *>(res->ai_addr);
                                                                        ^
src/main.cpp:225:20: note: forward declaration of ‘struct main(int, char**)::addrinfo’
             struct addrinfo hints = {0};
                    ^
src/main.cpp:245:29: error: ‘freeaddrinfo’ was not declared in this scope
             freeaddrinfo(res);
                             ^
src/main.cpp:251:24: error: ‘daemon’ was not declared in this scope
             daemon(0, 0);
                        ^
make: *** [Makefile:41: build/main.o] Error 1

@vabatta vabatta closed this as completed Apr 6, 2019
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

3 participants