compilation

Error: Cannot use typeid with -fno-rtti

一个人想着一个人 提交于 2019-12-19 16:51:10
问题 I´m getting this "Cannot use typeid with -fno-rtti" when I´m trying to compile my project, I´m using an opencv framework. I googled the problem but, it seems the errors I found in internet does not have relation with my problem. I don´t know if the problem is related with the includes, the code or the compiler. Xcode is giving me the error a lot of times, but the first error is here: virtual const std::type_info& type() { return typeid(T); } 回答1: It's telling you the error right in the

Visual C++ Library Directories Command Line equivalent

懵懂的女人 提交于 2019-12-19 15:40:35
问题 To use some recompiled libraries (f.ex. boost chrono) i need to specify the library folder in visual studio at Properties -> VC++ Directories -> Library Directories. How can i achieve this using the command line? I have been using the /LIBPATH but i get linker error (LNK1104). 回答1: You need to specify /link <linkoptions> for cl.exe command line to pass the required settings to the linker: cl -I "path\to\Boost" test.cpp /link /LIBPATH:"C:\path\to\Boost\stage\lib" 来源: https://stackoverflow.com

Compiling multiple languages together

喜欢而已 提交于 2019-12-19 09:27:34
问题 Is it possible to compile multiple languages together in order to get the best of the different languages. 回答1: It's definitely possible to link them together (if suitably programmed) after compiling them separately, if the compilers and linkers are all compatible. For example: g77 -c one.f gcc -c two.c gcc -o together one.o two.o this compiles a Fortran file, then a C file, then links them together in a single executable named together (assuming they call each other properly;-) using the GCC

how to disable specific warning when -Wall is enabled

拥有回忆 提交于 2019-12-19 08:48:16
问题 I have used -Wall -Werror in my Makefile but I want to disable following specific type of warning : warning: '_wrap_delete_DMXTSFILTER' defined but not used How shoud I do that? 回答1: This way 回答2: Assuming it's unused variable: -Wno-unused-variable 回答3: Finnaly, I used this trick __attribute__((unused)) . The advantage is I could apply it to individual functions / variables instead of the whole source file which the -Wno-unsed-xxxxx will apply on. 来源: https://stackoverflow.com/questions

Why can't I compile HelloWorld in C++?

久未见 提交于 2019-12-19 08:44:44
问题 I'm trying to compile a simple Hello World program in C++ but I keep getting the following error...why? gcc -o HelloWorldCompiled HelloWorld.cc /tmp/ccvLW1ei.o: In function `main': HelloWorld.cc:(.text+0xa): undefined reference to `std::cout' HelloWorld.cc:(.text+0xf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/ccvLW1ei.o: In function `__static

Why can't I compile HelloWorld in C++?

眉间皱痕 提交于 2019-12-19 08:44:36
问题 I'm trying to compile a simple Hello World program in C++ but I keep getting the following error...why? gcc -o HelloWorldCompiled HelloWorld.cc /tmp/ccvLW1ei.o: In function `main': HelloWorld.cc:(.text+0xa): undefined reference to `std::cout' HelloWorld.cc:(.text+0xf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/ccvLW1ei.o: In function `__static

Does #include affect program size?

你。 提交于 2019-12-19 07:54:37
问题 When my cpp file uses #include to add some header, does my final program's size gets bigger? Header aren't considered as compilation units, but the content of the header file is added to the actual source file by the preprocessor, so will the size of the output file (either exe or dll) be affected by this? Edit: I forgot to mention that the question is not about templates/inline functions. I meant what will happen if I place an #include to a header that doesn't have any implementation detail

inlining failed in call to always_inline '__m128i _mm_cvtepu8_epi32(__m128i)': target specific option mismatch _mm_cvtepu8_epi32 (__m128i __X) [duplicate]

吃可爱长大的小学妹 提交于 2019-12-19 05:16:21
问题 This question already has an answer here : inlining failed in call to always_inline ‘_mm_mullo_epi32’: target specific option mismatch (1 answer) Closed last year . I am trying to compile this project from github which is implemented in C++ with SIMD intrinsic (SSE4.1). The project in github is given as a Visual Studio solution, but I am trying to port it in Qtcreator with cmake. While I am trying to compile it I get the following error: /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include

Haskell ghc compiling/linking error, not creating executable. (linux)

耗尽温柔 提交于 2019-12-19 05:08:58
问题 I wrote a basic hello world program in haskel and tried to compile it with: ghc filename.hs. It produces .hi and .o files but no executable and displays this error in the linker: marox@IT-marox:~/Marox$ ghc tupel.hs Linking tupel ... /usr/bin/ld: --hash-size=31: unknown option /usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status Googling didn't return any useful information. I am on ubuntu 12.04. How can I fix this? 回答1: Have you binutils-gold installed

Inexplicable MissingFieldException

心已入冬 提交于 2019-12-19 04:07:06
问题 In the following code snippet, it throws a MissingFieldException: Field Not Found: DepthBidLevels exception but only in certain weird situations that are described below. for(int i=DomSize-1; i>=0; i--) { fixed( ushort *p = binary.DepthBidLevels) { if( i!=DomSize-1) { builder.Append( ","); } builder.Append( *(p + i)); } The type for the binary variable is a struct that is defined in a separate assemply: unsafe public struct TickBinary { public const int DomLevels = 5; public const int