Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NOEXCEPT' does not name a type #30

Closed
antonlukyanov opened this issue Mar 30, 2015 · 14 comments
Closed

'NOEXCEPT' does not name a type #30

antonlukyanov opened this issue Mar 30, 2015 · 14 comments

Comments

@antonlukyanov
Copy link

When I compile curlcpp on Windows with MinGW I get the following error:

$ make
Scanning dependencies of target curlcpp
[ 12%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_easy.cpp.obj
[ 25%] Building CXX object src/CMakeFiles/curlcpp.dir/curl_header.cpp.obj
In file included from C:/curlcpp/src/curl_head
er.cpp:6:0:
C:/curlcpp/include/curl_header.h:66:22: error:
 expected ';' at end of member declaration
         ~curl_header() NOEXCEPT;
                      ^
C:/curlcpp/include/curl_header.h:66:24: error:
 'NOEXCEPT' does not name a type
         ~curl_header() NOEXCEPT;
                        ^
make[2]: *** [src/CMakeFiles/curlcpp.dir/curl_header.cpp.obj] Error 1
make[1]: *** [src/CMakeFiles/curlcpp.dir/all] Error 2
make: *** [all] Error 2

How can I fix this?

@JosephP91
Copy link
Owner

Hi @antonlukyanov ,
can you try replacing it with noexcept?

@antonlukyanov
Copy link
Author

@JosephP91, replacing NOEXCEPT to noexcept solved the problem, thanks. However, there are many places in headers where NOEXCEPT is used and everything compiles fine except for curl_header.h.

@JosephP91
Copy link
Owner

@antonlukyanov yes, I noticed this thing now. It's very strange. @qqiangwu how is this possible? In curl_header.h and curl_header.cpp, if I replace NOEXCEPT with noexcept, everything compiles. If I use NOEXCEPT it does not compile.

@qqiangwu
Copy link
Contributor

qqiangwu commented Apr 1, 2015

@antonlukyanov What's your compiler? gcc or mingw?

@JosephP91
Copy link
Owner

@qqiangwu I think MinGW. It is written in the first comment.

@antonlukyanov
Copy link
Author

@qqiangwu, here is more precise information about used compiler:

$ g++ --version
g++.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 4.9.1

@qqiangwu
Copy link
Contributor

qqiangwu commented Apr 1, 2015

@JosephP91 I forgot to add #include "curl_config.h" to curl_header.h, so the macro NOEXCEPT cannot be found and be parsed as a normal symbol.

@JosephP91
Copy link
Owner

@qqiangwu Oh, ok! I added the include. Thank you!

@JosephP91
Copy link
Owner

Solved

@qqiangwu
Copy link
Contributor

qqiangwu commented Apr 1, 2015

@JosephP91 BTW, destructors are by default noexcept, so the NOEXCEPT in ~curl_header() NOEXCEPT; is redundant. :)

@JosephP91
Copy link
Owner

@qqiangwu So I could remove the NOEXCEPT from every destructor declaration. Right?

@qqiangwu
Copy link
Contributor

qqiangwu commented Apr 1, 2015

@JosephP91
Copy link
Owner

It's always good to learn something! Thank you!

@yghaziza
Copy link

yghaziza commented Jul 6, 2015

I still see this error when I compile with curl...
c:/.../curlcpp/include/curl_exception.h:64:25: error: expected ';' at end of member declaration
~curl_exception() NOEXCEPT;
^
In file included from c:/.../curlcpp/include/curl_easy.h:33:0,

c:/.../curlcpp/include/curl_config.h:32:22: error: 'noexcept' does not name a type
#define NOEXCEPT noexcept
etc.
I'm using the recent package of curlcpp and my gcc compiler version is even newer:
$ gcc --version
gcc.exe (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2

Any suggestions how to fix this compilation error? I don't want (and don't think I should be) to remove NOEXCEPT from curlcpp package as it compiles just fine and I was able to create the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants