g++

C++/mingw-gcc-g++ string declaration error

谁说胖子不能爱 提交于 2020-01-05 07:20:41
问题 I am using g++ to compile a very simple c++-program with g++ main.cpp -o main.exe My code: #include <string> int main() { std::string a; return 0; } [Windows 10 | mingw-gcc-g++ 6.3.0-1] When I try to run the created main.exe, I get the exit code: 3221225785. gdb returns: (gdb) start Temporary breakpoint 2 at 0x401464 Starting program: C:/[...]/main.exe [New Thread 14272.0x1238] [New Thread 14272.0x548c] [New Thread 14272.0x42fc] [New Thread 14272.0x3db4] During startup program exited with

C++/mingw-gcc-g++ string declaration error

懵懂的女人 提交于 2020-01-05 07:20:33
问题 I am using g++ to compile a very simple c++-program with g++ main.cpp -o main.exe My code: #include <string> int main() { std::string a; return 0; } [Windows 10 | mingw-gcc-g++ 6.3.0-1] When I try to run the created main.exe, I get the exit code: 3221225785. gdb returns: (gdb) start Temporary breakpoint 2 at 0x401464 Starting program: C:/[...]/main.exe [New Thread 14272.0x1238] [New Thread 14272.0x548c] [New Thread 14272.0x42fc] [New Thread 14272.0x3db4] During startup program exited with

Generating standalone MEX file with GNU compilers, including libraries

纵饮孤独 提交于 2020-01-05 07:08:33
问题 I have written and compiled a MEX function to be called from a MATLAB routine, it runs great on my computer. However, when I try to have a different computer run my routine, it breaks with an error saying the module does not exist. My MEX function is referencing the GSL libraries, and some others. I want to know if it is possible to compile my MEX function so that is a standalone. When I say standalone I mean that if I just copy the MEX file to another computer, and there are no libraries or

How to use visual studio code to compile multi-cpp file?

為{幸葍}努か 提交于 2020-01-05 07:08:07
问题 I have followed some instructions to construct Visual studio code C/C++ compile and debug environment.But g++ compiler can only compile the selected cpp file, so the included .h file associated the cpp file can not compiled. then the terminal shows 'Undefined symbols for architecture x86_64' error. the code as below: the a.h file int func(); the a.cpp file include <iostream> include "a.h" using namespace std; int func(){ return 111; } the main.cpp file include "a.h" using namespace std; int

Getting RInside example to work with extra linker option -framework

做~自己de王妃 提交于 2020-01-05 03:55:10
问题 I got the RInside example to run and work but I had to manually add the linker option: "-F/Library/Frameworks/R.framework/.. -framework R" at the end for g++ (on Mac Snow Leopard 10.6.8 with Xcode 3.x). It works, but I don't know why. Can anyone say what these options actually do ? I could not find it on this list: http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html Here is the original code: #include <RInside.h> // for the embedded R via RInside int main(int argc, char *argv[]) { RInside R

Conflicting type attributes specified for virtual destructor

懵懂的女人 提交于 2020-01-05 01:52:34
问题 The following extract was previously compiling under Borland C++, MSVC and OpenWatcom: class aaa { virtual _fastcall ~aaa(); }; class bbb:public aaa { }; It doesn't compile under gcc/g++ (MinGW 4.8.0). Error: probz.cpp:7:7: error: conflicting type attributes specified for 'virtual bbb::~bbb()' class bbb:public aaa { ^ probz.cpp:3:20: error: overriding 'virtual aaa::~aaa()' virtual _fastcall ~aaa()=0;///can't be abstract ^ Obviously, there is no bbb::~bbb()! EDIT The actual class hierarchy is

Mac Error: Undefined symbols for architecture x86_64

怎甘沉沦 提交于 2020-01-04 15:28:09
问题 I'm trying to install the MIT Language Modeling Toolkit. I've installed the dependencies, and ./autogen.sh works fine. However, when I compile with make , I get the error below. I am running OSX 10.10.3. Undefined symbols for architecture x86_64: "std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const", referenced from: std::_Hashtable<unsigned long, std::pair<unsigned long const, int>, std::allocator<std::pair<unsigned long const, int> >, std::

Header for _blsr_u64 with Sun supplied GCC on Solaris 11?

柔情痞子 提交于 2020-01-04 05:21:14
问题 We've got some code that runs on multiple platforms. The code uses BMI/BMI2 intrinsics when available, like a Core i7 5th gen. GCC supplied by Sun on Solaris 11.3 is defining __BMI__ and __BMI2__ , but its having trouble locating BMI/BMI2 intrinsics: $ cat test.cxx #include <x86intrin.h> int main(int argc, char* argv[]) { unsigned long long t = argc; #if defined(__BMI__) || defined(__BMI2__) t = _blsr_u64(t); #endif return int(t); } $ /bin/g++ -march=native test.cxx -o test.exe test.cxx: In

Header for _blsr_u64 with Sun supplied GCC on Solaris 11?

梦想与她 提交于 2020-01-04 05:21:08
问题 We've got some code that runs on multiple platforms. The code uses BMI/BMI2 intrinsics when available, like a Core i7 5th gen. GCC supplied by Sun on Solaris 11.3 is defining __BMI__ and __BMI2__ , but its having trouble locating BMI/BMI2 intrinsics: $ cat test.cxx #include <x86intrin.h> int main(int argc, char* argv[]) { unsigned long long t = argc; #if defined(__BMI__) || defined(__BMI2__) t = _blsr_u64(t); #endif return int(t); } $ /bin/g++ -march=native test.cxx -o test.exe test.cxx: In

Trouble linking libusb using Cmake

早过忘川 提交于 2020-01-04 05:20:30
问题 I've been trying to 'hack' 2 programs together and one of them (openTLD) uses cmake. I've been reading up and working on this issue for a bit now and can't seem to sort it. When I 'make' where there is no instantiation of the cpp object it compiles fine, when I have an object (that relies on libusb) that I hacked in I'm getting linking (I think) errors. My CMakeLists (added bits delimeted by ** or CAPS) #Set minimum version requered cmake_minimum_required(VERSION 2.4.6) #just to avoid the