g++

main.obj : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x6

谁都会走 提交于 2019-12-24 09:14:06
问题 I am on a Windows 10 machine, I have 2 files, main.cpp and cuda.cu (I have built this project on Ubuntu successfully I am trying to get it to build on Windows). I compiled both of them to make object files of 64 bit architecture. I have MS Visual Studio 2010 currently installed and I know it is too old. I can install 2015 if you think that is causing this (but I don't think so). When I try to link the two files using the command nvcc main.obj cuda.obj I get this error:- main.obj : fatal error

g++ with std::exclusive_scan (c++17)

╄→гoц情女王★ 提交于 2019-12-24 07:18:46
问题 Is std::exclusive_scan implemented with libstdc++ ? I'm trying to use the function but I'm getting compilation error saying std::exclusive_scan is not found. Here is the sample code. With clang compiler I'm able to run the code without stdlib=libc++ option. I've included the correct header file ( <numeric> ) and compiling using std=c++17 flag. 来源: https://stackoverflow.com/questions/55771604/g-with-stdexclusive-scan-c17

g++ with std::exclusive_scan (c++17)

依然范特西╮ 提交于 2019-12-24 07:18:08
问题 Is std::exclusive_scan implemented with libstdc++ ? I'm trying to use the function but I'm getting compilation error saying std::exclusive_scan is not found. Here is the sample code. With clang compiler I'm able to run the code without stdlib=libc++ option. I've included the correct header file ( <numeric> ) and compiling using std=c++17 flag. 来源: https://stackoverflow.com/questions/55771604/g-with-stdexclusive-scan-c17

Error ./vpdetection: /gpfs/apps/x86_64-rhel5/matlab/R2012a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found

守給你的承諾、 提交于 2019-12-24 07:14:11
问题 I am now trying to run some MATLAB code in Linux environment: Linux version is Red Hat Enterprise Linux Server release 5.9 (Tikanga). gcc version is 4.1.2. MALTAB version is R2012b. The statement in MALTAB that causes the problem is: [status, result] = system('./vpdetection lines.tmp lines.out'); I got an error as follows: ./vpdetection: /gpfs/apps/x86_64-rhel5/matlab/R2012a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found I have googled several solutions but they all require

Run g++ linking to special libraries

萝らか妹 提交于 2019-12-24 07:05:27
问题 These ideas may seems strange... I've made other environment on my Gnu/Linux system by creating directory and copy there necessary files to bin, lib, usr, etc and others. Then I do 'chroot' and then do some operations inside. The problem is that all files in environment were taken from older OS (2.4 kernel version). But compiler must be taken modern (with support of modern language standarts). When I'm trying to run compiler inside the environment it goes with errors: g++: /lib/libc.so.6:

Run g++ linking to special libraries

≯℡__Kan透↙ 提交于 2019-12-24 07:05:07
问题 These ideas may seems strange... I've made other environment on my Gnu/Linux system by creating directory and copy there necessary files to bin, lib, usr, etc and others. Then I do 'chroot' and then do some operations inside. The problem is that all files in environment were taken from older OS (2.4 kernel version). But compiler must be taken modern (with support of modern language standarts). When I'm trying to run compiler inside the environment it goes with errors: g++: /lib/libc.so.6:

gcc or g++ path search order on default directories when linking libraries

前提是你 提交于 2019-12-24 06:34:06
问题 I've seen this article and learned that: Directories specified on the command line with -L option are searched before the default directories. The directories specified in -L are searched in the order in which they are specified on the command line. The question is: Is there an search order for the default directories? For example, if I run this command: $ gcc -Xlinker --verbose 2>/dev/null | grep SEARCH | sed 's/SEARCH_DIR("=\?\([^"]\+\)"); */\1\n/g' | grep -vE '^$' (command copied from this

forward declaration of class using templates

岁酱吖の 提交于 2019-12-24 05:36:20
问题 Can I use forward declaration for template class? I try: template<class que_type> class que; int main(){ que<int> mydeque; return 0; } template<class que_type> class que {}; I get: error: aggregate 'que<int> mydeque' has incomplete type and cannot be defined. 回答1: Forward declaration of a class should have complete arguments list specified. This would enable the compiler to know it's type. When a type is forward declared, all the compiler knows about the type is that it exists; it knows

__stdcall typedef g++ problem

余生颓废 提交于 2019-12-24 05:33:12
问题 This code compiles (as I would expect): typedef void __stdcall (*Func)(); struct A { static void __stdcall f() { } }; int main() { Func p = A::f; } But this one: struct A { typedef void __stdcall (*Func)(); static void __stdcall f() { } }; int main() { A::Func p = A::f; } fails with not-very-helpful error message: error: invalid conversion from `void (*)()' to `void (*)()' I'm using g++ 3.4.2 under Vista (I know, it's ancient, but I don't have access to any other environment right now).

Compilation error while reading a cv::Mat from a cv::FileNode without temporary variable

☆樱花仙子☆ 提交于 2019-12-24 04:45:05
问题 I have a piece of code that saves a row of a cv::Mat onto a file using OpenCV FileStorage API. I'm trying to read this matrix onto a row without using a temporary variable that points to the row itself. The code that does this job is the following: #include <opencv2/highgui/highgui.hpp> using namespace cv; int main(int argc, char **argv) { Mat src = imread(argv[1], -1); FileStorage fs("test.yml", FileStorage::WRITE); fs << "imgs" << "[" << "{" << "img" << src.row(500) << "}" << "]"; fs