This question already has answers here:
Where and why do I have to put the "template" and "typename" keywords?
(8 answers)
Closed 7 years ago.
There is a tuple implementation given here.
While the code compiles with gcc 4.8, with clang 3.5 it gives the following error: "expected expression" for the line return tail.get<M-1>();
I can't figure out what is wrong with the code and the error is not clear as to what is wrong.
That's a dependent expression, so it should be
return tail.template get<M-1>();
Related
This question already has answers here:
Yet Another MinGW "gcc: error: CreateProcess: No such file or directory"
(9 answers)
Closed 4 years ago.
I am trying to run a command that will compile an ada program. I installed the ada compiler through MinGW on Windows 10 64 bit. the command I write exactly is
gcc -c .\stack.adb
the MinGW bin is in my path, and I can compile C code just fine with gcc, I only get the error in the title when I try to compile ada.
You need to install gcc-ada package if you are using Cygwin, then everything will work.
As Jim Rogers said - GNAT GPS is much better options to make Ada projects and is free to use
The pcre library is used. When compiling in win32, there is no error
The problem is solved. The topic can be closed
I am trying to to compile wxWidgets 3.0.2 found here.
I need this library, so that I can compile SimSpark.
I have tried installing the library via MacPorts - this does work. But when I try to compile SimSpark, the compiler states the following:
In file included from /opt/local/include/gcc49/c++/type_traits:35:0,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/strvararg.h:25,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/string.h:46,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/memory.h:15,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/object.h:19,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/event.h:16,
from /Users/YEED/Downloads/simspark-0.2.4/plugin/inputwx/inputwx.cpp:23:
/opt/local/include/gcc49/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I believe that I need to compile wxWidgets with C++11 support, since I already included the C++11 relevant flags when making SimSpark.
When I try to compile wxWidgets, I get a bunch of compiler errors that refer to the same .h file - which is part of CoreFoundation:
In file included from /usr/include/Availability.h:184:0,
from /usr/include/stdlib.h:61,
from /usr/include/assert.h:44,
from ../include/wx/debug.h:13,
from ../include/wx/defs.h:743,
from ../include/wx/wxprec.h:12,
from ../src/common/filefn.cpp:20:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: expected '}' before '__attribute__'
kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),
When you look into that specific file, there are a bunch of lines that miss a closing ) and resemble the one printed by the compiler as well. (There should be a closing ) before the comma at the end of the line, right?)
So my question is, is this an actual error in CoreFoundation? If so, how can I fix this or work around it? Or am I actually completely misunderstanding the compiler error thrown when compiling SimSpark in the first place?
EDIT:
I couldn't get wxWidgets to compile, but I have fixed my issues compiling SimSpark with the MacPorts version of wxWidgets. The problem lay within using different compilers (gcc and clang) for the two.
I am trying to compile a bunch of C files using MEX under windows 7 (64 bits). In order to do that I installed Matlab R2014a and the Microsoft SDK 7.1 with the C/C++ utilities.
The fact is that when I execute the command:
mex -g file_1.c file_2.c
I got many error like the one posted in the title.
I already tried setting MEX to use the c and c++ VS compiler because I thought it was an error due to the bad compiler choose, but unfortunately it didn't.
Does anyone have some hints what could I try?
Thanks in advance!
After updating a new Mac (OS 10.8), my colleague and I are unable to compile a C++ code that we have been using. We are not experienced with coding and would be very grateful if someone could point us in the right direction at a newbie level. We see that there are many posts on this type of error, but if any of them are relevant, we don't see how, except that the posts all seem to say that this is likely to be a linker problem.
When we do "make," there is a lot of output. The first part is this:
Us$ make g++ -o ourProg 1.o main.o 2.o -L/Prog/libraries
-L/Prog/support_libraries -l_codea -l_codeb ... Undefined symbols for architecture x86_64:
The final part is this:
ld: symbol(s) not found for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation) make: ***
[ourProg] Error 1
Unfortunately, a condition of using the code is that we can't post it online, so it may be that there is not enough information that anyone can help.
The thing that stands out for me is that it looks like Clang is being used for linking, even though we have specifically said we want g++ to be used for compiling. In the makefile, we have said:
CC = g++
(Answered by the OP in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
Thanks everyone; the problem is solved. I'm not sure whether to indicate this anywhere in the question, sorry. I'd like to describe how we fixed it, in case any other newbies are having trouble understanding the more sophisticated posts on this problem!
First, we followed the advice here by updating to OS 10.9 and installing the new command line tools. Then we came across a forum post that discussed where the linking problem comes from. In OS 10.8 and 10.9, the C++ default standard libraries are different. So we first added a new include to our makefile:
/usr/bin/clang++
Then we added to the compiler flag line and the libraries:
-stdlib=libstdc++