cygwin

cygwin or linux: what is the directory location of diff?

别说谁变了你拦得住时间么 提交于 2020-01-07 07:59:16
问题 My normal installation of diff in cygwin seems to be missing. Would you please tell me the normal location of diff in cygwin or linux? This is the primary diff tool, diff(1) in the man page. 回答1: On Linux it's in /usr/bin/diff 来源: https://stackoverflow.com/questions/32238796/cygwin-or-linux-what-is-the-directory-location-of-diff

sed replace using string containing backslashes

旧城冷巷雨未停 提交于 2020-01-07 04:03:09
问题 I need to replace text in a file with a Windows-style directory path containing backslash (REVERSE SOLIDUS) characters. I am already using an alternative expression delimiter. The backslashes appear to be treated as escape characters. How can I keep the backslashes in the output? $ echo DIR=foobar | sed -e "s#DIR=.*#$(cygpath -w $(pwd))#" C:gwin64homelit The desired output is: C:\cygwin64\home\lit 回答1: You'll have to escape metacharacters in sed replacement pattern. Fortunately, there are

How do compile a simple program using boost::thread in cygwin?

夙愿已清 提交于 2020-01-07 03:09:32
问题 I installed the boost package from cygwin and have a directory /usr/include/boost that includes a bunch of *.hpp files, including thread.hpp, which I need to include in the c++ file, via #include <boost/thread.hpp> Also, several *.a files seem to be related to boost::thread. $ ls /usr/lib/libboost_thread* -1 /usr/lib/libboost_thread-gcc-mt-1_33_1.a /usr/lib/libboost_thread-gcc-mt.a /usr/lib/libboost_thread-mt.a /usr/lib/libboost_thread-mt.dll.a What should my g++ compilation command look like

g++ Cygwin/Linux or version discrepancy

一世执手 提交于 2020-01-07 02:49:06
问题 Can someone explain the discrepancy in how two instances of g++ handle compilation of the following code to shared libraries? Foo.h #ifndef Foo_h #define Foo_h void Foo(); #endif // Foo_h Foo.cpp #include "Foo.h" #include <iostream> void Foo() { std::cout << "Greetings from Foo()!" << std::endl; } Bar.h #ifndef Bar_h #define Bar_h void Bar(); #endif // Bar_h Bar.cpp #include "Bar.h" #include "Foo.h" #include <iostream> void Bar() { Foo(); std::cout << "Greetings from Bar()!" << std::endl; }

Cygwin和MinGW有什么区别?

巧了我就是萌 提交于 2020-01-06 17:15:51
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我想让我的C ++项目跨平台,我正在考虑使用Cygwin / MinGW。 但它们之间有什么区别? 另一个问题是我是否能够在没有Cygwin / MinGW的系统上运行二进制文件? #1楼 维基百科说 : MinGW 从 Cygwin 1.3.3版本开始。 尽管 Cygwin 和 MinGW 都可用于将 UNIX 软件移植到 Windows ,但它们有不同的方法: Cygwin 旨在提供完整的 POSIX layer ,提供 Linux , UNIX 和 BSD 变体上存在的多个系统调用和库的模拟。 POSIX layer 在 Windows 之上运行,在必要时牺牲性能以实现兼容性。 因此,这种方法要求使用 Cygwin 编写的 Windows 程序在copylefted兼容库之上运行,该库必须与程序一起分发,以及程序的 source code 。 MinGW 旨在通过直接的 Windows API calls 提供本机功能和性能。 与 Cygwin 不同, MinGW 不需要兼容层 DLL ,因此程序不需要与 source code 一起分发。 由于 MinGW 依赖于 Windows API calls ,因此无法提供完整的 POSIX API ; 它无法编译可以使用 Cygwin 编译的一些 UNIX

Linking SDL_image errors

吃可爱长大的小学妹 提交于 2020-01-06 15:58:24
问题 I am running into problems when linking SDL_image in gcc 3 on cygwin under Windows 7. I receive the following error: /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lSDL_image My makefile appears as this: all: rabbit rabbit: main.o rabbit.o renderer.o g++ -o rabbit main.o rabbit.o renderer.o -lSDLmain -lSDL -lSDL_image main.o: main.cpp rabbit.h g++ -c main.cpp rabbit.o: rabbit.cpp rabbit.h gameobject.h g++ -c rabbit.cpp renderer.o: renderer.cpp renderer.h g++

Git Push需要用户名和密码

风流意气都作罢 提交于 2020-01-06 14:25:49
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我从GitHub帐户克隆了一个Git存储库到我的PC。 我想同时使用PC和笔记本电脑,但要使用一个GitHub帐户。 当我尝试使用PC推送或从GitHub拉出时,它需要用户名和密码,但在使用笔记本电脑时则不需要! 我不想每次与Origin交互时都输入用户名和密码。 我在这里想念什么? #1楼 我遇到了同样的问题,发现的最简单的解决方案是使用SSH URL而不是HTTPS: ssh://git@github.com/username/repo.git 而不是这样: https://github.com/username/repo.git 现在,您可以 仅 使用SSH密钥而不是 username 和 password 。 #2楼 除了更改为SSH之外,如果您不介意以明文形式输入密码,也可以继续使用HTTPS。 将其放在您的 ~/.netrc ,它不会询问您的用户名/密码(至少在Linux和Mac上如此): machine github.com login <user> password <password> 添加 (请参阅VonC的第二条注释):在Windows上,文件名为 %HOME%\\_netrc 。 如果您想加密,还请阅读VonC的第一条评论。 如果您拥有 Git 1.7.10或更高版本, 则可以使用

Getting error while reading unicode file in C

笑着哭i 提交于 2020-01-06 12:45:25
问题 I want to read a unicode file in C (Cygwin/GCC) using the following code: #include <stdio.h> #include <stdlib.h> #include <glib.h> void split_parse(char* text){ char** res = g_strsplit(text, "=", 2); printf("Key = %s : ", res[0]); printf("Value = %s", res[1]); printf("\n"); } int main(int argc, char **argv) { setenv ("CYGWIN", "nodosfilewarning", 1); GIOChannel *channel; GError *err = NULL; int reading = 0; const gchar* enc; guchar magic[2] = { 0 }; gsize bytes_read = 0; const char* filename

Windows batches in Cygwin with spaces in path and arguments

拥有回忆 提交于 2020-01-06 07:16:25
问题 Consider this dummy Windows batch script: echo %1 Supposed just to echo to the terminal its first argument. Assume its path in resp. Windows, Cygwin style is: c:\test\win.bat /cygdrive/c/test/win.bat From Cygwin bash: $ c:\test\win.bat "hello world" "hello world" So quotes correctly identify a single argument. But now let us introduce spaces in path: "c:\te st\win.bat" /cygdrive/c/te\ st/win.bat Then: $ /cygdrive/c/te\ st/win.bat "hello world" Gives: "C:\te" is not recognized as an internal

cygwin compile error in sys/_types.h

烈酒焚心 提交于 2020-01-06 07:10:36
问题 I am trying to use cywin to get some linux code building on a win32 machine. I get the following VS.net 2003 error in ym compiler: "c:\cygwin\usr\include\sys_types.h(15): error C2144: syntax error : '__int64' should be preceded by ';' " and c:\cygwin\usr\include\sys_types.h(15): error C2501: ' extension ' : missing storage-class or type specifiers The code line is __extension__ typedef long long _off64_t; Obviously I am missing something here but I have never used cygwin before and this is