I am trying to compile libaws on Windows using mingw compiler. Inside the libaws (https://sourceforge.net/projects/libaws/) code, I try this:
C:/la/include/libaws/config.h:2:0: warning: "WIN32" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
In file included from C:/tools/libaws-0.9.2/src/canonizer.h:23:0,
from C:\tools\libaws-0.9.2\src\s3\s3connection.cpp:25:
C:/tools/libaws-0.9.2/src/s3/s3connection.h:62:9: error: expected identifier before '(' token
C:/tools/libaws-0.9.2/src/s3/s3connection.h:62:9: error: expected '}' before '(' token
C:/tools/libaws-0.9.2/src/s3/s3connection.h:62:9: error: expected unqualified-id before numeric constant
C:/tools/libaws-0.9.2/src/s3/s3connection.h:62:9: error: expected ')' before numeric constant
C:/tools/libaws-0.9.2/src/s3/s3connection.h:70:5: error: expected unqualified-id before 'public'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:109:19: error: 'ActionType' was not declared in this scope
C:/tools/libaws-0.9.2/src/s3/s3connection.h:109:43: error: expected primary-expression before 'const'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:110:19: error: expected primary-expression before 'const'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:110:51: error: expected primary-expression before 'aExpiration'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:129:5: error: expected unqualified-id before 'private'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:135:51: error: 'ActionType' has not been declared
C:/tools/libaws-0.9.2/src/s3/s3connection.h:139:40: error: variable or field 'setRequestMethod' declared void
C:/tools/libaws-0.9.2/src/s3/s3connection.h:139:40: error: 'ActionType' was not declared in this scope
C:/tools/libaws-0.9.2/src/s3/s3connection.h:154:5: error: expected unqualified-id before 'public'
C:/tools/libaws-0.9.2/src/s3/s3connection.h:161:1: error: expected declaration before '}' token
C:/tools/libaws-0.9.2/src/s3/s3connection.h:143:7: warning: 'size_t aws::s3::getS3Data(void*, size_t, size_t, void*)' declared 'static' but never defined [-Wunused-function]
C:/tools/libaws-0.9.2/src/s3/s3connection.h:146:7: warning: 'size_t aws::s3::setCreateBucketData(void*, size_t, size_t, void*)' declared 'static' but never defined [-Wunused-function]
C:/tools/libaws-0.9.2/src/s3/s3connection.h:149:7: warning: 'size_t aws::s3::setPutData(void*, size_t, size_t, void*)' declared 'static' but never defined [-Wunused-function]
C:/tools/libaws-0.9.2/src/s3/s3connection.h:152:7: warning: 'size_t aws::s3::getHeaderData(void*, size_t, size_t, void*)' declared 'static' but never defined [-Wunused-function]
src\CMakeFiles\aws.dir\build.make:561: recipe for target 'src/CMakeFiles/aws.dir/s3/s3connection.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aws.dir/s3/s3connection.cpp.obj] Error 1
CMakeFiles\Makefile2:1006: recipe for target 'src/CMakeFiles/aws.dir/all' failed
mingw32-make[1]: *** [src/CMakeFiles/aws.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
C:\la>
The place where it is happening is in a class
class S3Connection {
enum ActionType {
// VALUES
};
};
The problem is that one of the enum names in
s3connection.hconflicts with a macro name in the Win32 SDK. In Win32,DELETEis a macro used for dealing with ACLs (access control lists). Probably the best way to deal with this is to have:somewhere after the Windows headers are included and before the the
libawsheaders are included.Either that, or modify the enum names (and anywhere they might be used) so there’s no conflict.
Keep in mind that this is an indication that
libawsprobably hasn’t had much use/testing directly on a Windows target, so you might have to pay more in terms of being a pioneer. You might have better luck using Cygwin instead of MinGW, since it looks likelibawshas had at least some work done on the Cygwin platform.