mingw

Embeded python3.6 with MinGW in C++ fail on linking

大憨熊 提交于 2020-01-15 10:04:38
问题 Try to embed python3.6 in C++ on Win10 64bit system. Python is installed by python-3.6.1-amd64.exe . The CMakeList.txt is showing below cmake_minimum_required(VERSION 3.8) project(EmbedPython) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) find_package(PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIRS}) add_executable(EmbedPython ${SOURCE_FILES} ${PYTHON_INCLUDE_DIRS}) target_link_libraries(EmbedPython ${PYTHON_LIBRARIES}) And CMake found the Python package. PYTHON_INCLUDE

Embeded python3.6 with MinGW in C++ fail on linking

ぃ、小莉子 提交于 2020-01-15 10:03:17
问题 Try to embed python3.6 in C++ on Win10 64bit system. Python is installed by python-3.6.1-amd64.exe . The CMakeList.txt is showing below cmake_minimum_required(VERSION 3.8) project(EmbedPython) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) find_package(PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIRS}) add_executable(EmbedPython ${SOURCE_FILES} ${PYTHON_INCLUDE_DIRS}) target_link_libraries(EmbedPython ${PYTHON_LIBRARIES}) And CMake found the Python package. PYTHON_INCLUDE

Understanding which swprintf will be used (or again, convert a char* string to wchar_t*)

泄露秘密 提交于 2020-01-15 09:14:34
问题 I am trying to convert a char* string to wchar_t*. I have seen this question has been asked many times, with no resolving/portable answer/solution. As suggested here, swprintf seemed the right solution to me, but I found out there exist two versions out there!! Namely: http://www.cplusplus.com/reference/cwchar/swprintf/ (second argument is the string capacity) http://msdn.microsoft.com/en-us/library/ybk95axf%28v=vs.71%29.aspx (second argument is already the format string) My program would

MinGW's compiler option Wl,--kill-at does not work

女生的网名这么多〃 提交于 2020-01-15 08:15:12
问题 I am currently struggling to compile a Dll for JNI use, using Eclipse CDT and MinGW. Following a tutorial, i created a Java class that declares native methods, then used javah to get the relevant header file and I implemented it in a C++ class. The C++ code is very simple and compilation works, but when I load the library into the Java class, i get this error : Exception in thread "main" java.lang.UnsatisfiedLinkError: Main.integerMethod(I)I at Main.integerMethod(Native Method) at Main.main

搭建Eclipse C++开发环境

孤者浪人 提交于 2020-01-15 08:01:24
我的Eclipse版本:3.0.1 1,下载Mingw.exe,安装(假定安装在C:]MinGW),设置环境变量: PATH = C:\MinGW\bin;%PATH% LIBRARY_PATH = C:\MinGW\lib C_INCLUDE_PATH = C:\MinGW\include CPLUS_INCLUDE_PATH = C:\MinGW\include\c++\3.2.3;C:\MinGW\include\c++\3.2.3\mingw32;C:\MinGW\include\c++\3.2.3\backward;C:\MinGW\include 2,下载org.eclipse.cdt-2.1.1-win32.x86.zip,安装。 注意,CDT 2.*适用于Eclipse 3.0.*。CDT3.*适用于Eclipse 3.1.* 3,打开eclipse,进入可以创建C/C++项目了! 写一个helloworld程序会发现不能build。因为Eclipse是调用make命令构件,而C:\MinGW\bin下只有mingw32-make.exe。把mingw32-make.exe改成make.exe就行了。 简单使用了一下,感觉比VS亲切。 来源: https://www.cnblogs.com/xiaotie/archive/2005/10/02/248076.html

g++: error: CreateProcess no such file or directory

扶醉桌前 提交于 2020-01-15 04:05:58
问题 I get the following error: g++: error: CreateProcess no such file or directory whenever I try to compile a program. I have installed the MinGw 7.2 version at work on a windows machine and the problem does not occur, however after installing Windows SP3 on my home computer I get this error and I just can't figure it out since I have set all the environment variables properly. I even tried setting the path to C:\MinGw\libexec\gcc\i686-mingw32\4.6.1 where cc1plus.exe and cc1.exe are located but

Determine 64-bit file size in C on MinGW 32-bit

耗尽温柔 提交于 2020-01-14 14:57:15
问题 I'm going crazy trying to get this to work in MinGW 32-bit. It works on all other platforms I've tried. All I want to do is get the size of a > 4GB file into a 64-bit int. This works fine on other platforms: #define _FILE_OFFSET_BITS 64 #include <sys/stat.h> int64_t fsize(const char *filename) { struct stat st; if (stat(filename, &st) == 0) return st.st_size; return -1; } I tried adding the following defines before the above code, based on various suggestions I found online: #define

Embedding prolog engine in a dll

对着背影说爱祢 提交于 2020-01-14 13:57:29
问题 I've been working on a C++ application that embeds a prolog reasoning engine lately and, as stated in the title, I am now trying to generate a DLL instead of an executable so I can use it in another project. Since I am new to DLL development, I thought I could start with a small example. I have 3 files: likes.pl : sample prolog file defining the predicate likes/2 likes.cpp : defining the function get_food() that calls PlQuery and return the results in a std::string food.cpp : using the DLL to

Configure options for building MinGW-64 on linux-64 for linux-64 (ultimately targetting windows-64)

孤者浪人 提交于 2020-01-14 09:46:06
问题 I want to build MinGW-w64 where: A: I want to compile MinGW itself on Linux (64-bit). B: I want the MinGW tools (compiler, etc) to run on Linux (64-bit). C: I want the MinGW tools (compiler, etc) to produce code that runs on Windows 64-bit (Win7 & Win8). I'm having trouble at the configure stage. I've googled around a bit but I can't find out what options I need to pass to configure. I have downloaded the source for MinGW-w64 SVN from (https://svn.code.sf.net/p/mingw-w64/code/trunk/). (AFAICT

Windows CLion 使用 + 配置 ----- 最高效

青春壹個敷衍的年華 提交于 2020-01-14 07:26:05
一、下载 Clion 下载 Clion 2、安装 clion 请自行寻找破解方法 或者 自行寻找注册码 3、配置运行环境 让 Clion 有很多种方式,这里我介绍 MinGW 3.1下载 MinGW 下载 MinGW 向下拉,寻找到这个界面,下载红色框中的 然后,解压到合适的地方 这是解压后的图 4、配置 MinGW 打开 Clion,快捷键 ctrl + alt + s 打开设置 第二步 来源: CSDN 作者: Lavau 链接: https://blog.csdn.net/Snakehj/article/details/103820922