g++

gcc / C++ Disable generation of vex instructions

岁酱吖の 提交于 2019-12-14 03:21:35
问题 We are debugging memory issues with our large legacy app and would like to use Valgrind to track it down. The app uses the ACE/TAO CORBA library however, Valgrind complains of illegal "vex" instructions in the library. ==29992== Memcheck, a memory error detector ==29992== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==29992== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==29992== Command: DvMain ==29992== DvMain. Version 6.0 Build 38B16 vex x86->IR:

Boost.test cannot find main

喜夏-厌秋 提交于 2019-12-14 01:58:39
问题 I'm working with gcc 4.8, boost 1.59 on kubuntu 12.04. I wrote a simple main.cpp file: #define BOOST_TEST_MODULE My_Module #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE( foo ) {} This doesn't work when I build with g++ -std=c++11 main.cpp -I/usr/local/include -L/usr/local/lib -lboost_unit_test_framework -o test I get a bunch of linker errors: /usr/lib/x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to 'main' /tmp/cc57ppN0.o: In function `__static

How to get rid of “inline function used but never defined” warning in g++

一笑奈何 提交于 2019-12-14 01:11:54
问题 I'm using mingw-w64. I'm including strsafe.h and getting the following warning: warning: inline function 'HRESULT StringCchPrintfA(STRSAFE_LPSTR, size_t, STRS AFE_LPCSTR, ...)' used but never defined [enabled by default] The only flags flags I used are -Wall -DDEBUG -g . I know that you have to define inline functions in the same header and I looked at strsafe.h and I clearly can see that StringCchPrintfA in the header, so I don't know why its giving me this error. Also, here is a link to

How to allow -z multidefs with g++47

柔情痞子 提交于 2019-12-14 00:27:41
问题 How can I tell the linker of g++ to allow multiple definitions of symbols (choose the first appearance)? -z multidefs Allows multiple symbol definitions. By default, multiple symbol definitions occurring between relocatable objects (.o files) will result in a fatal error condition. This option suppresses the error condition and allows the first symbol definition to be taken. This option is valid only when the -b svr4 option is specified. The -zmuldefs option is not recognized by g++ , nor -z

lambda expression under g++ compiler in linux

痴心易碎 提交于 2019-12-13 18:17:34
问题 i need to to use c++ find_if() lambda expression, in my vc compiler it compiles without any errors, and i can't compile it in linux:debian:g++4.4 : -CPP function: istream_iterator<string> it = find_if(istream_iterator<string>(ss), f, [=](const string& str) {return str == to_string(urlHash);}); -Error output: -error: expected primary-expression before '[' token -error: expected primary-expression before '=' token -error: expected primary-expression before ']' token -error: expected primary

Where is __v2di declared when using -std=c++11 under GCC?

我是研究僧i 提交于 2019-12-13 17:53:32
问题 I'm having trouble compiling some code under GCC 4.9 when using -std=c++11 . GCC 4.9 is provided under Debian 8.5 (Stable), so its fairly popular. The relevant code is: __inline __m128i clmulepi64_si128 (__m128i a, __m128i b, const int i) { asm ("pclmulqdq %2, %1, %0" : "+x"(a) : "xm"(b), "i"(i)); return a; } Attempting to compile it results in: In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:43:0, from /usr/include/x86_64-linux-gnu/c++/4.9/bits/opt_random.h:33,

How do c++ and g++ deal with unicode?

放肆的年华 提交于 2019-12-13 17:49:51
问题 I'm trying to figure out the proper way to deal with unicode in c++. I want to understand how g++ handles literal wide character strings, and regular c strings containing unicode characters. I have set up some basic tests and don't really understand what is happening. wstring ws1(L"«¬.txt"); // these first 2 characters correspond to 0xAB, 0xAC string s1("«¬.txt"); ifstream in_file( s1.c_str() ); // wifstream in_file( s1.c_str() ); // this throws an exception when I // call in_file >> s;

g++ compile static with OpenSSL and MySQLClient

不羁的心 提交于 2019-12-13 17:31:02
问题 I have been looking for this issue on the internet, but can't find a solution. What I'm trying to achieve is to build a CGI-application with both dependencies of OpenSSL and MySQLClient . When I compile my program, with the following command: g++ -Wall -o test.cgi test.cpp -I/usr/include/mysql -lcgicc -lmysqlcppconn -lmysqlclient -lcurl -lnghttp2 -lssl -lcrypto -lpthread -ldl -DCURL_STATICLIB -std=c++11 -lz -static I get the following error: //usr/local/lib/libcrypto.a(err.o): In function

g++ linking issues: undefined reference to functions

亡梦爱人 提交于 2019-12-13 16:49:57
问题 I used CMake and Visual C++ to build the HyDE library. Then, still in VC++, I was able to successfully create code and build an executable that links into HyDE.lib and the HyDE header files. I then discovered that in order to work with others at my company, it would be preferable to develop in Eclipse CDT. Knowing very little about Eclipse CDT, I created a default hello world project, deleted the code and then dumped in all of my code into the src folder. Then I attempted to change the

Partial specialization of a class template in derived class affects base class

扶醉桌前 提交于 2019-12-13 16:22:50
问题 I have a metafunction: struct METAFUNCION { template<class T> struct apply { typedef T type; }; }; Then I define a helper: template<class T1, class T2> struct HELPER { }; And then I have second metafunction which derives from the METAFUNCTION above and defines partial specialization of apply struct: struct METAFUNCION2 : METAFUNCION { template<class T1, class T2> struct apply<HELPER<T1, T2> > : METAFUNCION::apply<T2> { }; }; So far, so good - the code compiles under g++ 4.3.2. So I used it