Coder Social home page Coder Social logo

meganz / sdk Goto Github PK

View Code? Open in Web Editor NEW
1.3K 145.0 504.0 93.12 MB

MEGA C++ SDK

License: BSD 2-Clause "Simplified" License

Shell 0.64% Objective-C 4.44% Objective-C++ 2.02% C++ 62.09% PHP 0.18% Makefile 0.10% Java 4.23% C 21.73% Python 0.94% QMake 0.32% Batchfile 0.04% M4 0.84% Perl 0.04% CMake 1.93% SWIG 0.10% Vim Script 0.01% Kotlin 0.16% Swift 0.03% Groovy 0.14%
sdk mega end-to-end-encryption privacy cloud-storage

sdk's Introduction

[[TOC]]

MEGA SDK - Client Access Engine Coverity Scan Build Status

MEGA --- The Privacy Company --- is a Secure Cloud Storage provider that protects your data thanks to end-to-end encryption. We call it User Controlled Encryption, or UCE, and all our clients automatically manage it.

All files stored on MEGA are encrypted. All data transfers from and to MEGA are encrypted. And while most cloud storage providers can and do claim the same, MEGA is different – unlike the industry norm where the cloud storage provider holds the decryption key, with MEGA, you control the encryption, you hold the keys, and you decide who you grant or deny access to your files.

This SDK brings you all the power of our client applications and let you create your own or analyze the security of our products. Are you ready to start? Please continue reading.

SDK Contents

In this SDK, you can find our low level SDK, that was already released few months after the MEGA launch, a new intermediate layer to make it easier to use and to bind with other programming languages, and example apps for all our currently supported platforms (Windows, Linux, OSX, Android and iOS).

In the examples folder you can find example apps using:

  1. The low level SDK:
  • megacli (a powerful command line tool that allows to use all SDK features)
  1. The intermediate layer:
  • An example app for Visual Studio in examples/win32
  • An example app for Android (using Java bindings based on SWIG) in examples/android
  • An example app for iOS (using Objective-C bindings) in examples/iOS

MEGAcmd, a higher level command line application that uses the SDK to provide interactive and scriptable access to MEGA, can be found here.

How to build the SDK library

For the SDK development and compilation we mainly use CMake as the cross-platform project configuration tool. We also use VCPKG to manage the required dependencies to build the SDK in most platforms: Windows, MacOS and Linux.

The prior autotools and qmake build systems are still available but obsolete, so their usage is discouraged.

Building tools

Some common development tools should be available in the system to be able to build the MEGA SDK and the needed dependencies:

  • Git: Use the one from your system package manager or install it from https://git-scm.com
  • CMake 3.18 or higher: Use the one from your system package manager or install it from https://cmake.org

Windows

Ensure you have installed Visual Studio, with the necessary components for building C++ sources, and the Windows SDK on your system.

MacOS

Xcode and the Developer tools are needed. To install the Developer tools, run the following command and follow the instructions:

$ xcode-select --install

The following packages should be available in the system as well:

  • autoconf, autoconf-archive, automake, pkg-config and nasm.

You can use any package manager if you have one installed or build and install them from sources

Linux

For debian-based distributions, you can install the needed compilers and tools using the following command:

sudo apt install build-essential curl zip unzip autoconf autoconf-archive nasm

Package names may vary for other Linux distros, but it should build successfully with similar packages to the ones listed above.

Prepare the sources

First of all, prepare a directory of your choice to work with the MEGA SDK. The mega directory will be used as the workspace directory in the examples in this document.

mkdir mega
cd mega

Then, clone the MEGA SDK repository to obtain the source code for the MEGA SDK.

git clone https://github.com/meganz/sdk

Next to the MEGA SDK, clone the VCPKG repository. If you are already using VCPKG and have a local clone of the VCPKG repository, you can skip this step and use the VCPKG you already have in your system.

git clone https://github.com/microsoft/vcpkg

Configuration

The following instructions are for configuring the project from the CLI, but cmake-gui or any editor or IDE compatible with CMake should be suitable if the same CMake parameters are configured.

The SDK is configured likne any other regular CMake project. The only parameter that is always needed is the VCPKG directory to manage the third-party dependencies. To configure the SDK with the dafault options, from the workspace (mega directory), run CMake:

cmake -DVCPKG_ROOT=vcpkg -DCMAKE_BUILD_TYPE=Debug -S sdk -B build_dir

Note: The -DCMAKE_BUILD_TYPE=<Debug|Release> may not be needed for multiconfig generators, like Visual Studio.

In the command above, relative paths have been used for simplicity. If you want to change the location of VCPKG, the SDK or the build directory, simply provide a valid relative or absolute path for any of them.

During the configuration of the project, VCPKG will build and configure the necessary libraries for the platform. It may take a while on the first run, but once the libraries are built, VCPKG will retrieve them from the binary cache.

Some options to configure the SDK library can be found in the sdklib_options.cmake file, like ENABLE_SYNC or USE_PDFIUM. The options to manage the examples and tests are in the CMakeLists.txt.

Building the sources

Once the MEGA SDK is configured, simply build the complete project:

cmake --build build_dir

You can specify --target=<target> like SDKlib or megacli, or just leave the command as it is to build all the tagets. Additionally, -j<N> can be added to manage concurrency and speed up the build.

Once the build is finished, binaries will be available in the build_dir

Run megacli

To run the example app megacli, go to the examples directory in the build_dir and execute the megacli binary.

How to build the SDK library (Obsolete methods)

Build the SDK and 3rdParty Dependencies with vcpkg + cmake

  • The steps to build the SDK are already prepared in the build_from_scratch.cmake script. It contains instructions too.
  • To get started with it, eg for windows, follow these steps:
    • mkdir mybuild
    • cd mybuild
    • git clone https://github.com/meganz/sdk.git
    • cd sdk\contrib\cmake
    • <on Win, choose VS version by editing vcpkg_extra_triplets\xNN-windows-mega.cmake>
    • cmake -DTRIPLET=x64-windows-mega -DEXTRA_ARGS="-DUSE_PDFIUM=0" -P build_from_scratch.cmake
  • Visual Studio solution is generated at mybuild\sdk\build-x64-windows-mega
  • That folder contains Debug and Release subfolders which contain build products
  • Similar steps work for other platforms too (Linux with triplet x64-linux-mega (including WSL), Mac with triplet x64-osx-mega or arm64-osx-mega).

Building with POSIX Autotools (Linux/Darwin/BSD/OSX ...)

For platforms with Autotools, first set up needed libraries and then the generic way to build and install it is:

sh autogen.sh
./configure
make
sudo make install

Notice that you would need Autotools installed in your system (in Linux this normally entails having autoconf and libtool packages installed).

That compilation will include the example using our low level SDK: megacli. You also have specific build instructions for OSX (doc/OSX.txt) and FreeBSD (doc/FreeBSD.txt) and a build script to automatically download and build the SDK along with all its dependencies (contrib/build_sdk.sh)

For other platforms, or if you want to see how to use the new intermediate layer, the easiest way is to get a smooth start is to build one of the examples in subfolders of the examples folder.

All these folders contains a README.md file with information about how to get the project up and running, including the installation of all required dependencies.

Dependencies for POSIX Autotools:

Install the following development packages, if available, or download and compile their respective sources (package names are for Debian and RedHat derivatives, respectively):

  • cURL (libcurl4-openssl-dev, libcurl-devel), compiled with --enable-ssl
  • c-ares (libc-ares-dev, libcares-devel, c-ares-devel)
  • OpenSSL (libssl-dev, openssl-devel)
  • Crypto++ (libcrypto++-dev, libcryptopp-devel)
  • zlib (zlib1g-dev, zlib-devel)
  • SQLite (libsqlite3-dev, sqlite-devel) or configure --without-sqlite
  • FreeImage (libfreeimage-dev, freeimage-devel) or configure --without-freeimage
  • pthread

Optional dependencies:

  • Libraw (libraw-dev, libraw-devel)
  • Sodium (libsodium-dev, libsodium-devel), configure --with-sodium
  • MediaInfoLib (optional, see third_party/README_MediaInfo.txt)
  • libudev (libudev-dev, libudev-devel)

Filesystem event monitoring: The provided filesystem layer implements the Linux inotify and the MacOS fsevents interfaces.

PDF thumbnail generation: The PDFium library is detected automatically by the configure step if installed. There is a helper script located at contrib/build_pdfium to install it in a Linux system (/usr). To download, build and install it in the system, run the following:

cd contrib/build_pdfium
build.sh -b
sudo build.sh -i

Library will be installed under /usr/lib/ and headers under /usr/include/. Once installed, the generated workspace folder could be removed to free up space.

To build the reference megacli example, you may also need to install:

  • GNU Readline (libreadline-dev, readline-devel) on Mac, you will probably need to download the source and build it yourself, and adjust the project to refer to that version.

For Android, we provide an additional implementation of the graphics subsystem using Android libraries.

For iOS, we provide an additional implementation of the graphics subsystem using Objective C frameworks.

Usage

The low level SDK doesn't have inline documentation yet. If you want to use it, please check our example app examples/megacli.

The new intermediate layer has been documented using Doxygen. The only public header that you need to include to use is include/megaapi.h. You can read the documentation in that header file, or download the same documentation in HTML format from this link:

https://mega.nz/#!7glwEQBT!Fy9cwPpCmuaVdEkW19qwBLaiMeyufB1kseqisOAxfi8

Additional info

Folder syncing

In this version, the sync functionality is limited in scope and functionality:

  • There is no locking between clients accessing the same remote folder. Concurrent creation of identically named files and folders can result in server-side dupes.

  • Syncing between clients with differing filesystem naming semantics can lead to loss of data, e.g. when syncing a folder containing ABC.TXT and abc.txt with a Windows client.

  • On POSIX platforms, filenames are assumed to be encoded in UTF-8. Invalid byte sequences can lead to undefined behaviour.

  • Local filesystem items must not be exposed to the sync subsystem more than once. Any dupes, whether by nesting syncs or through filesystem links, will lead to unexpected results and loss of data.

  • No in-place versioning. Deleted remote files can be found in //bin/SyncDebris (only when syncing to the logged in account's own cloud drive - there is no SyncDebris facility on syncs to inbound shares), deleted local files in a sync-specific hidden debris folder located in the local sync's root folder.

  • No delta writes. Changed files are always overwritten as a whole, which means that it is not a good idea to sync e.g. live database tables.

  • No direct peer-to-peer syncing. Even two machines in the same local subnet will still sync via the remote storage infrastructure.

  • No support for unidirectional syncing (backup-only, restore-only). Syncing to an inbound share requires it to have full access rights.

megacli on Windows

The megacli example is currently not handling console Unicode input/output correctly if run in cmd.exe.

Filename caveats: Please prefix all paths with \\?\ to avoid the following issues:

  • The MAX_PATH (260 character) length limitation, which would make it impossible to access files in deep directory structures

  • Prohibited filenames (con/prn/aux/clock$/nul/com1...com9/lpt1...lpt9). Such files and folders will still be inaccessible through e.g. Explorer!

Also, disable automatic short name generation to eliminate the risk of clashes with existing short names.

sdk's People

Contributors

aabellagm avatar adlonmega avatar alber2510 avatar alfredo-mega avatar antonioborondo avatar catalinr-m avatar cb-mega avatar cjr-mega avatar dmo-mega avatar dwmega avatar gene-thomas avatar javiergm1983 avatar javisanesp avatar javiserrano avatar javitrujillo avatar jgandres avatar jnavarrom avatar jraragon avatar mattw-mega avatar mega-lia avatar ms-mega avatar ortmann avatar polmr avatar rgmez avatar sergiohs84 avatar simonwng avatar vmgagh avatar vtmateos avatar wizzard avatar yenel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

On iOS, MEGAAcountDetails is not available

It is not possible to get account details with current iOS binding
In MEGARequest.mm :
- (MEGAAcountDetails *) megaAccountDetails {
return nil;
}
Is there a fix for this planned ?

cannot pass "make -j"

Hello,
I'm on ubuntu 14.04. I want to use the mage sdk but the "make -j" doesn't pass it seems like there is an infinite loop somewhere

root@wambe:/home/nardu14/Bureau/PERSONAL PROJECT/sdk-master# make -j
make all-recursive
make[1]: entrant dans le répertoire « /home/nardu14/Bureau/PERSONAL PROJECT/sdk-master »
Making all in include
make[2]: entrant dans le répertoire « /home/nardu14/Bureau/PERSONAL PROJECT/sdk-master/include »
make[2]: Rien à faire pour « all ».
make[2]: quittant le répertoire « /home/nardu14/Bureau/PERSONAL PROJECT/sdk-master/include »
make[2]: entrant dans le répertoire « /home/nardu14/Bureau/PERSONAL PROJECT/sdk-master »
CXX src/src_libmega_la-megaclient.lo
CXX src/src_libmega_la-attrmap.lo
CXX src/src_libmega_la-backofftimer.lo
CXX src/src_libmega_la-base64.lo
CXX src/src_libmega_la-command.lo
CXX src/src_libmega_la-commands.lo
CXX src/src_libmega_la-db.lo
CXX src/src_libmega_la-fileattributefetch.lo
CXX src/src_libmega_la-file.lo
CXX src/src_libmega_la-filefingerprint.lo
CXX src/src_libmega_la-gfx.lo
CXX src/src_libmega_la-http.lo
CXX src/src_libmega_la-json.lo
CXX src/src_libmega_la-filesystem.lo
CXX src/src_libmega_la-node.lo
CXX src/src_libmega_la-pubkeyaction.lo
CXX src/src_libmega_la-request.lo
CXX src/src_libmega_la-serialize64.lo
CXX src/src_libmega_la-share.lo
CXX src/src_libmega_la-sharenodekeys.lo
CXX src/src_libmega_la-sync.lo
CXX src/src_libmega_la-transfer.lo
CXX src/src_libmega_la-transferslot.lo
CXX src/src_libmega_la-treeproc.lo
CXX src/src_libmega_la-user.lo
CXX src/src_libmega_la-utils.lo
CXX src/src_libmega_la-logging.lo
CXX src/src_libmega_la-waiterbase.lo
CXX src/src_libmega_la-proxy.lo
CXX src/crypto/src_libmega_la-cryptopp.lo
CXX src/db/src_libmega_la-sqlite.lo
CXX src/gfx/src_libmega_la-external.lo
CXX src/src_libmega_la-megaapi_impl.lo
CXX src/src_libmega_la-megaapi.lo
CXX src/gfx/src_libmega_la-freeimage.lo
CXX src/posix/src_libmega_la-fs.lo
CXX src/posix/src_libmega_la-console.lo
CXX src/posix/src_libmega_la-net.lo
CXX src/posix/src_libmega_la-waiter.lo
CXX src/posix/src_libmega_la-consolewaiter.lo
CXX bindings/python/bindings_python__mega_la-megaapi_wrap.lo
CXX src/thread/src_libmega_la-posixthread.lo
CXX examples/examples_megacli-megacli.o
CXX examples/examples_megasimplesync-megasimplesync.o
src/megaapi_impl.cpp:42:0: warning: "_LARGEFILE64_SOURCE" redefined [enabled by default]
#define _LARGEFILE64_SOURCE
^
In file included from /usr/include/inttypes.h:25:0,
from ./include/megaapi_impl.h:25,
from src/megaapi_impl.cpp:32:
/usr/include/features.h:166:0: note: this is the location of the previous definition

define _LARGEFILE64_SOURCE 1

^
^C^C^Z
^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^Z^Z^Z^C^C^C[1]+ Stopped make -j

Compiling error on Mingw

Previously, I can compile the sdk fine. But with latest git, I get these errors

src/http.cpp: In member function 'void mega::HttpIO::getMEGADNSservers(std::__cxx11::string*, bool)':
src/http.cpp:108:26: error: 'AI_V4MAPPED' was not declared in this scope
         hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
                          ^
src/http.cpp:108:40: error: 'AI_ADDRCONFIG' was not declared in this scope
         hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
                                        ^
src/http.cpp:121:86: error: 'inet_ntop' was not declared in this scope
                     inet_ntop(hp->ai_family, &addr->sin_addr, straddr, hp->ai_addrlen);
                                                                                      ^
src/http.cpp:126:87: error: 'inet_ntop' was not declared in this scope
                     inet_ntop(hp->ai_family, &addr->sin6_addr, straddr, hp->ai_addrlen);
                                                                                       ^
Makefile:1930: recipe for target 'src/src_libmega_la-http.lo' failed

Saving MS Office document could cause a sync loop.

Hitting MS Office document "save" button several times during a short period of time could cause an infinite sync loop.

Steps to reproduce:

  • Start 2x megacli application, sync two local folders to the same remote folder.
  • Start MS Office, create a document, save it in the local synced folder.
  • Wait for a full sync in both megacli.
  • Now type something quickly and press "CTRL +S" to save the changes.
  • Repeat previous step 4-5 times.
  • both megacli get into infinite sync loop.
Sending:
2 files added or updated
1 user received or updated
Sync - state change of node test.docx to Syncing
Sync - state change of node  to Syncing
Sync - state change of node test.docx to Synced
Sync - state change of node  to Synced
Sync - state change of node test.docx to Pending
Sync - state change of node  to Pending
Sync - creating remote file test.docx by copying existing remote file
Sync - state change of node test.docx to Syncing
Sync - state change of node  to Syncing
POST target URL: https://g.api.mega.co.nz/cs?id=nldxyghcjb&sid=y6kHA6CM5mAz7Bn4vhhH8nN3TmpUZmQ0Nld
Sending: [{"a":"p","i":"hbmnohybow","t":"5VcRmRiT","n":[{"h":"lZtViBRJ","t":0,"a":"3eoKLmTAkSblRG-
hvuCZxAIAz01drvYyQE","ts":1400965249}]},{"a":"m","i":"hbmnohybow","n":"IdMxRYKA","t":"JRkmyBKJ"}]
MEGA> Received: [{"f":[{"h":"wRdnxBAA","t":0,"a":"3eoKLmTAkSblRG-Xk5mpUrltuExonDzB6VnUsfyNqeZ5zhQG
"ts":1400965249,"p":"5VcRmRiT","u":"swNjTfd46WQ","s":11262}]},0]
Sync - state change of node test.docx to Synced
Sync - state change of node  to Synced
2 files added or updated
MEGA> Received: {"a":[{"a":"t","i":"hbmnohybow","t":{"f":[{"h":"wRdnxBAA","t":0,"a":"3eoKLmTAkSblR
580ryU2oJXtu4uhvuCZxAIAz01drvYyQE","ts":1400965249,"p":"5VcRmRiT","u":"swNjTfd46WQ","s":11262}]},"
ow","t":{"f":[{"h":"IdMxRYKA","p":"JRkmyBKJ","u":"swNjTfd46WQ","t":0,"a":"ssSqO-Xs6ldJTBYLnSDWwxmq
ZvtUYw7LUOlomZmhByYyfU","s":11412,"ts":1400965729,"tdm":-447}],"u":[{"u":"swNjTfd46WQ","m":"spoh21
O-Xs6ldJTBYLnSDWwxmqtZNSUqUeflbOg3p5hl7hDLxLhKEuhd0OcSTCrwFaI6WEKQiyUSu4szL7Ete19Q","k":"swNjTfd46
1412}]},"ou":"swNjTfd46WQ"},{"a":"d","i":"dgvgahiblt","n":"wRdnxBAA","ou":"swNjTfd46WQ"},{"a":"t",
Xk5mpUrltuExonDzB6VnUsfyNqeZ5zhQGKuxm8nPAkf7k23-n4_UbK2RZ83fgv7x8TvpSEg","k":"swNjTfd46WQ:64rw2rZ3
":"[email protected]"}]},"ou":"swNjTfd46WQ"}],"sn":"yKmp_K_FTiw"}
POST target URL: https://g.api.mega.co.nz/sc?sn=yKmp_K_FTiw&sid=y6kHA6CM5mAz7Bn4vhhH8nN3TmpUZmQ0Nl
Sending:
2 files added or updated
1 user received or updated
Sync - state change of node test.docx to Syncing
Sync - state change of node  to Syncing
Sync - state change of node test.docx to Synced
Sync - state change of node  to Synced
Sync - state change of node test.docx to Pending
Sync - state change of node  to Pending
Sync - creating remote file test.docx by copying existing remote file
Sync - state change of node test.docx to Syncing
Sync - state change of node  to Syncing
POST target URL: https://g.api.mega.co.nz/cs?id=nldxyghcjc&sid=y6kHA6CM5mAz7Bn4vhhH8nN3TmpUZmQ0Nld
Sending: [{"a":"p","i":"hbmnohybow","t":"5VcRmRiT","n":[{"h":"lZtViBRJ","t":0,"a":"3eoKLmTAkSblRG-
hvuCZxAIAz01drvYyQE","ts":1400965249}]},{"a":"m","i":"hbmnohybow","n":"cNcGCJYA","t":"JRkmyBKJ"}]
MEGA> Received: [{"f":[{"h":"lRcS2RjQ","t":0,"a":"3eoKLmTAkSblRG-Xk5mpUrltuExonDzB6VnUsfyNqeZ5zhQG
"ts":1400965249,"p":"5VcRmRiT","u":"swNjTfd46WQ","s":11262}]},0]
Sync - state change of node test.docx to Synced
Sync - state change of node  to Synced

As well reproduced issue #26 (haven't seen this issue on Windows for a long time!). Remote folder had 4x test.docs files.

temp download

Is there a way to implement an option download mega files from my MEGA account but have them deleted after or have them streamed some how?

Looking to have a way to access them from the command line (Linux terminal) but not have them downloaded.

Looking to have say 50 GB's MEGA data on a say 20 GB's computer

MegaNode set attributes

Dear All,

I'm looking for method to save some extra information along with remote file.
e.g. FileDescription, Memo

are there such features in MegaApi?

thanks,

./configure on OSX Yosemite with MacPorts and cryptopp

I'd managed to install the libcryptopp and cryptopp with ports install..
However, cryptopp is in /opt/local/include/cryptopp, which i'd set via --with-cryptopp, but the ./configure command stills fail with:
configure: error: Could not find libcryptopp
Tried " --with-libcryptopp=/opt/local/lib/", but no success :)

double filenames in MEGA, upload

Dear All,
is there way to upload above existing file and replace its content without deleting the file?
MEGA allows to have double filenames, so when I upload above existing file, the double files are created.

thanks,

Rust binding?

Is it possible to has rust binding for this library?

python bindings: Logout MegaRequest

Hello I try to learn mega at this moment
so I did a little prog:

 #-*- encoding: utf-8 -*-

import sys
import os
import cmd
import time

_wrapper_dir = os.getcwd()
_libs_dir = os.path.join(_wrapper_dir, '.libs')
_shared_lib = os.path.join(_libs_dir, '_mega.so')
if os.path.isdir(_wrapper_dir) and os.path.isfile(_shared_lib):
    sys.path.insert(0, _wrapper_dir)  # mega.py
    sys.path.insert(0, _libs_dir)     # _mega.so

from mega import *

class Listner(MegaListener):

      def __init__(self, v, api):
          self.v = v
          super(Listner, self).__init__()

      def onRequestStart(self, *args):
          print "request: {}".format(args[1])

      def onRequestFinish(self, *args):
          api, req, err = args[:3]
          cod = err.getErrorCode()
          print "request {} finished".format(req.toString())
          print cod == MegaRequest.TYPE_LOGIN
          if cod == MegaError.API_OK:      
             if cod == MegaRequest.TYPE_LOGIN:
                print "ama"
                api.logout()
          if cod != MegaError.API_OK or req.getType == MegaRequest.TYPE_LOGOUT:
             print "an error occurs: {}".format(err.tostring())
             print "ici"
             self.v[0] = 0



if __name__ == "__main__":
   v = [1]
   api = MegaApi("myappkey")
   li = Listner(v, api)
   api.addListener(li)
   api.login("myemail", "mypassword") 
   while v[0]:
         time.sleep(0.5)
         print v[0]
   print "ended"

but I have noticed that "print cod == MegaRequest.TYPE_LOGIN" return true
when sending a "logout" command I think it should be MegaRequest.TYPE_LOGOUT no "MegaRequest.TYPE_LOGIN"

cryptopp not usable on Lubuntu 14.04

Here are the last few lines of the output of ./configure:

checking for GNU libc compatible malloc... yes
checking if building for Win32 platform... no
checking for pthread_create in -lpthread... yes
checking for libcryptopp... --with-cryptopp not specified
checking cryptopp/cryptlib.h usability... no
checking cryptopp/cryptlib.h presence... no
checking for cryptopp/cryptlib.h... no

Running make results in:
kj@otto:/development/mega/sdk$ make -j
make: *** No targets specified and no makefile found. Stop.
kj@otto:
/development/mega/sdk$

This is the system I am running on:
kj@otto:~/development/mega/sdk$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

I have libcrypto++9 version 5.6.1-6+deb8u1build0.14.04.1 installed.

Is this sufficient information to let you track down the problem?

Rubbish Bin autopurging

for the past few weeks I've been running large number of tests, which basically do the following: create ~1000 files, perform several actions and then delete these files. So now my remote "Rubbish bin" is full of deleted objects (on web site it says that Rubbish bin contains ~40 00 files).
Now everytime I launch megacli or MEGASync I have to wait up to ~5min, while the initial JSON package is being prepared on the server side (I guess it's a big load on DB to prepare that huge JSON response), sent to my client and finally parse it on client side.

Would be nice to implement some sort of "Rubbish Bin autopurging".

Segfault in mega::LocalNode::getlocalpath

Was running my normal (non-Unicode) tests and got the following megacli segfault:

(gdb) bt
#0  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:36
#1  0x00007f98cebebb0b in std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007f98ceeb6aae in insert (__n=<optimized out>, __pos2=<optimized out>, __str=..., __pos1=<optimized out>, this=<optimized out>) at /usr/include/c++/4.8/bits/basic_string.h:1259
#3  insert (__str=..., __pos1=<optimized out>, this=<optimized out>) at /usr/include/c++/4.8/bits/basic_string.h:1234
#4  mega::LocalNode::getlocalpath (this=this@entry=0x2975e80, path=path@entry=0x7fffd8eaa760, sdisable=<optimized out>, sdisable@entry=false) at src/node.cpp:1036
#5  0x00007f98ceebc7ff in mega::Sync::checkpath (this=this@entry=0x23e1ab0, l=0x2975e80, localpath=0x2bfc730, localname=localname@entry=0x0) at src/sync.cpp:447
#6  0x00007f98ceebd2f3 in mega::Sync::procscanq (this=this@entry=0x23e1ab0, q=q@entry=0) at src/sync.cpp:778
#7  0x00007f98cee9b6fb in mega::MegaClient::exec (this=0xc2ddf0) at src/megaclient.cpp:965
#8  0x0000000000416790 in megacli () at examples/megacli.cpp:3487
#9  0x000000000040e569 in main () at examples/megacli.cpp:3514
(gdb) frame 4
(gdb) print *path
$1 = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7f98c4651028 "X\331\031\002"}}
(gdb) print l->localname
$2 = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x2955af8 "X\331\031\002"}}
(gdb) frame 5
#5  0x00007f98ceebc7ff in mega::Sync::checkpath (this=this@entry=0x23e1ab0, l=0x2975e80, localpath=0x2bfc730, localname=localname@entry=0x0) at src/sync.cpp:447
447             l->getlocalpath(&tmppath);
(gdb) print *localpath
$10 = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x2b9f3b8 "zSchq9c8Iksfmr2"}}

The last megacli console output:

Sync - local folder deletion detected: zUq59, local data in this sync: 0 byte(s) in 2 file(s) and 4 folder(s)
Sync - local folder deletion detected: zizUOOL8wfR3, local data in this sync: 0 byte(s) in 2 file(s) and 3 folder(s)
Sync - local folder deletion detected: znJdLOB5wtm6, local data in this sync: 0 byte(s) in 2 file(s) and 2 folder(s)
Segmentation fault (core dumped)

Streaming download fails with "Invalid argument" for public node

Download to a file works correctly, but a streaming download fails with "Invalid argument".

% ./mega-streaming-test   
[00:58:13][info] Request (GET_PUBLIC_NODE) starting
[00:58:16][info] Request (GET_PUBLIC_NODE) finished
node size: 1790981
---- Normal download:
[00:58:17][info] Transfer (DOWNLOAD) starting. File: test
onTransferUpdate: buf 0 size 0
onTransferUpdate: buf 0 size 2416
onTransferUpdate: buf 0 size 25368
onTransferUpdate: buf 0 size 288712
onTransferUpdate: buf 0 size 324352
onTransferUpdate: buf 0 size 408312
onTransferUpdate: buf 0 size 344280
onTransferUpdate: buf 0 size 257936
[00:58:17][info] Transfer (DOWNLOAD) finished. File: test
onTransferFinish: No error

---- Streaming download:
[00:58:18][warn] Transfer (DOWNLOAD) finished with error: Invalid argument File: (NULL)
onTransferFinish: Invalid argument

https://gist.github.com/vozhyk-/800b1591dea1a6f60804#file-main-cpp

On iOS, crash when dealloc the MegaSDK instance

When deallocation MegaSDK instance, a DELETE request is started but it crashes in posixthread.cpp

PosixMutex::~PosixMutex() <- EXC_BAD_ACCESS (code = 1, address = 0x0)
{
    delete mutex;
    pthread_mutexattr_destroy(attr);
    delete attr;
}

Image of crash

Downsync issue caused by Unicode filenames

steps to reproduce:

  • start 2x megacli, synchronize two local folders with the same remote folder
  • create several files using Unicode encoding in the first synced local folder
  • the second megacli starts looping:
...
Sync - local file change detected: work/sync_out/OH6SIX71PM/IHƸoᵷO8sͫY^@Ꙍ٩󹞧LD%3e
Sync - requesting file work/sync_out/OH6SIX71PM/IHƸoᵷO8sͫY^@Ꙍ٩󹞧LD%3e
Sync - state change of node OH6SIX71PM to Synced
Sync - state change of node  to Synced
Sync - state change of node OH6SIX71PM to Syncing
Sync - state change of node  to Syncing
POST target URL: https://g.api.mega.co.nz/cs?id=toeyhxdhyz&sid=p4LO1TB8scjGZev--uRo13N3TmpUZmQ0NldRXDNhWU-BycJL8NuE9GIAgg&ak=megasync
Sending: [{"a":"g","n":"ABUhxT7L","g":1}]
CURLMSG_DONE with HTTP status: 200
Received: [{"s":66,"at":"V8iPxzXDObONRsWiEd_wUeD-A0c7xhZlRH-3gS0oCQvNwJOpFk6az3dbDzt-jWb0rjTg7BW0IvqVrCYc3yNhElOAW9EqISLn_yBBBA3v_iQ","g":"http://gfs270n077.userstorage.mega.co.nz/dl/C4wYPygu3ERMhQJDCBbB9td6cwZht3BbSNh9Y705uF-WiGf9Go-RP6ipixS46u1OVcZdfu2wLu_L87SulGjwhQfcPUPFhLwkx7VIrPz5nUxUcHJSUw","pfa":1}]
POST target URL: http://gfs270n077.userstorage.mega.co.nz/dl/C4wYPygu3ERMhQJDCBbB9td6cwZht3BbSNh9Y705uF-WiGf9Go-RP6ipixS46u1OVcZdfu2wLu_L87SulGjwhQfcPUPFhLwkx7VIrPz5nUxUcHJSUw/0-65
[sending 0 bytes of raw data]
CURLMSG_DONE with HTTP status: 200
[received 0 bytes of raw data]
...

affected OS: Linux

Segmentation fault on logout using Python bindings

A recent commit appears to have broken logging out in the Python bindings. Prior to updating today, I was on commit bea10a7 and this did not happen. I have reproduced this with Python 2.7.6 and 3.4.0 on Linux Mint 17.1 and with Python 2.6.6 on CentOS 6.6.

Steps to reproduce:

$ cd examples/python
$ gdb python
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...(no debugging symbols found)...done.
(gdb) r megacli.py 
Starting program: /usr/bin/python megacli.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee084700 (LWP 30970)]
Mega sample app. Type help or ? to list commands.

(MEGA) login EMAIL PASSWORD
INFO: Request start ( LOGIN )
(MEGA) (MEGA) INFO: Request finished ( LOGIN )   Result: No error
(MEGA) INFO: Request start ( FETCH_NODES )
(MEGA) INFO: Request finished ( FETCH_NODES )   Result: No error
(MEGA) INFO: Users updated ( 1 )
(MEGA) logout
(MEGA) INFO: Request start ( LOGOUT )
(MEGA) 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee084700 (LWP 30970)]
0x00007ffff5e51a5d in mega::CommandLogout::procresult (this=0x7fffe8c81a50)
    at src/commands.cpp:1058
1058            client->sctable->remove();
(gdb) bt
#0  0x00007ffff5e51a5d in mega::CommandLogout::procresult (this=0x7fffe8c81a50)
    at src/commands.cpp:1058
#1  0x00007ffff5e737c4 in mega::Request::procresult (this=0xac7e90, 
    client=0xac78f0) at src/request.cpp:73
#2  0x00007ffff5e11fee in mega::MegaClient::exec (this=0xac78f0)
    at src/megaclient.cpp:725
#3  0x00007ffff5e96004 in mega::MegaApiImpl::loop (this=0xaab9d0)
    at src/megaapi_impl.cpp:2299
#4  0x00007ffff5e938d0 in mega::MegaApiImpl::threadEntryPoint (param=0xaab9d0)
    at src/megaapi_impl.cpp:1784
#5  0x00007ffff7bc4182 in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff78f100d in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb)

To rule out an issue with the python CLI code, this also fails:

import sys
import os
import time

# Assumes we're in examples/python.
libsdir = os.getcwd() + '/../../bindings/python'
if os.path.isdir(libsdir) and os.path.isfile(libsdir + '/.libs/_mega.so'):
    sys.path.insert(0, libsdir) # mega.py
    sys.path.insert(0, libsdir + '/.libs') # _mega.so

from mega import *

def wait(arg, t=0.5):
    while not arg():
        time.sleep(t)

def main():
    api = MegaApi('APIKEY', None, None)
    api.login('EMAIL', 'PASSWORD')
    wait(api.isLoggedIn)
    api.logout()
    wait(lambda: not api.isLoggedIn())

if __name__ == '__main__':
    main()

New TREESTATE for filesystem objects outside synced folders

the states of local nodes:

  • if I'm trying to get the state of a filesystem object which is not in the synced folder: TREESTATE_NONE is received
  • if I'm trying to get the state of a filesytem object which is located within one of the local synced folders but for some reason not synchronized (for example .debris folder): TREESTATE_NONE is received.

Could we add an additional state to distinguish these two cases?

Segfault in mega::JSON::storeobject when processing Unicode filenames

Launched megasync and got crash as soon as login JSON message was received.
Remotely in Rubbish Bin I had several Unicode files / folders.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  mega::JSON::storeobject (this=this@entry=0x7fff8ad54b80, s=s@entry=0x2917508) at src/json.cpp:59
59              while (*ptr != '"' || ptr[-1] == '\\')
(gdb) bt
#0  mega::JSON::storeobject (this=this@entry=0x7fff8ad54b80, s=s@entry=0x2917508) at src/json.cpp:59
#1  0x00007f3dc78865f9 in mega::Node::setattr (this=this@entry=0x24d5d40) at src/node.cpp:468
#2  0x00007f3dc7886669 in mega::Node::setkey (this=this@entry=0x24d5d40, newkey=newkey@entry=0x7fff8ad54bf0 "C\345\371\a\347\070\277@\245~Y\310\376`\245\217T^\314Զz9|\376\206\034ſ\335G\033\001")
    at src/node.cpp:635
#3  0x00007f3dc788680b in mega::Node::applykey (this=0x24d5d40) at src/node.cpp:620
#4  0x00007f3dc785f049 in mega::MegaClient::applykeys (this=0x24c7fc0) at src/megaclient.cpp:3539
#5  0x00007f3dc7876e38 in mega::CommandFetchNodes::procresult (this=0x25fc7d0) at src/commands.cpp:2243
#6  0x00007f3dc78884ec in mega::Request::procresult (this=0x24c84f0, client=client@entry=0x24c7fc0) at src/request.cpp:63
#7  0x00007f3dc786a54a in mega::MegaClient::exec (this=0x24c7fc0) at src/megaclient.cpp:644
#8  0x00000000004021c4 in main (argc=<optimized out>, argv=<optimized out>) at examples/megasync.cpp:557
(gdb) print pos
$3 = 0x293336c "\"ۭ7ܱz|ܴ\327\254ö]۟ljD\\\\\"}"
(gdb) print *pos
$4 = 34 '"'
(gdb) print ptr
$7 = 0x2954000 <error: Cannot access memory at address 0x2954000>

Debris folder upsynced to remote folder

During my tests sometimes (still not sure what actually causes that) local ".debris" folder with all its content is upsynced to remote folder.
Most likely the issue happens when I sync a local folder, which already contains .debris folder (but it isn't reproduced every time I run megacli).

Sync - local folder addition detected: work/sync_in/.debris
Sync - state change of node .debris to Synced
Sync - state change of node  to Synced
Sync - state change of node .debris to Pending
Sync - state change of node  to Pending
Sync - state change of node .debris to Syncing
Sync - state change of node  to Syncing

python Cannot import name MegaApi

i have build the sdk. but when i try to run megacli.py, there occur import error.

rice@rice-virtual-machine:~/megasdk/sdk-master/sdk-master/examples/python$ python megacli.py
Traceback (most recent call last):
File "megacli.py", line 28, in
from mega import (MegaApi, MegaListener, MegaError, MegaRequest,
ImportError: cannot import name MegaApi

Compiling fails on Ubuntu 12.04.5 with gcc version 4.6.3

gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

sh autogen.sh

autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --install --copy --force libtoolize: putting auxiliary files in.'.
libtoolize: copying file ./config.guess' libtoolize: copying file./config.sub'
libtoolize: copying file ./install-sh' libtoolize: copying file./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. libtoolize: copying filem4/libtool.m4'
libtoolize: copying file m4/ltoptions.m4' libtoolize: copying filem4/ltsugar.m4'
libtoolize: copying file m4/ltversion.m4' libtoolize: copying filem4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'


./configure

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether make supports nested variables... (cached) yes
checking for size_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for pid_t... yes
checking for off_t... yes
checking for ssize_t... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether build environment is sane... yes
checking for cppcheck... no
checking for ANSI C header files... (cached) yes
checking for ANSI C header files... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for off_t... (cached) yes
checking size of uint64_t... 8
checking whether struct tm is in sys/time.h or time.h... time.h
checking for off_t... (cached) yes
checking for size_t... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking htonl usability... no
checking htonl presence... no
checking for htonl... no
checking whether C++ compiler accepts -fPIC... yes
checking whether the linker accepts -fPIC... yes
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking mcheck.h usability... yes
checking mcheck.h presence... yes
checking for mcheck.h... yes
checking for inotify_init1... yes
checking for fdopendir... yes
checking for select... yes
checking for sendfile in -lsendfile... no
checking for socket in -lsocket... no
checking for clock_gettime in -lrt... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking if building for Win32 platform... no
checking for pthread_create in -lpthread... yes
checking for libcryptopp... --with-cryptopp not specified
checking cryptopp/cryptlib.h usability... yes
checking cryptopp/cryptlib.h presence... yes
checking for cryptopp/cryptlib.h... yes
checking for main in -lcryptopp... yes
checking for libsodium... --with-sodium not specified
checking sodium/core.h usability... no
checking sodium/core.h presence... no
checking for sodium/core.h... no
configure: sodium/core.h header not found or not usable
checking for sodium_init in -lsodium... no
configure: Could not find libsodium
checking for zlib... --with-zlib not specified
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for main in -lz... yes
checking for SQLite... --with-sqlite not specified
checking for Berkeley DB... --with-db not specified
configure: Using SQLite3 as the default DB access layer.
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking for sqlite3_open in -lsqlite3... yes
checking for OpenSSL... --with-openssl not specified
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for SSL_new in -lssl... yes
checking for c-ares... --with-cares not specified
checking ares.h usability... yes
checking ares.h presence... yes
checking for ares.h... yes
checking for ares_library_init in -lcares... yes
checking curl/curl.h usability... yes
checking curl/curl.h presence... yes
checking for curl/curl.h... yes
checking for main in -lcurl... yes
checking whether cURL is built with OpenSSL support... yes
checking if building example applications... yes
checking for FreeImage... --with-freeimage not specified
checking FreeImage.h usability... yes
checking FreeImage.h presence... yes
checking for FreeImage.h... yes
checking for main in -lfreeimage... yes
checking for termcap... --with-termcap not specified
checking for tputs in -ltermcap... yes
checking for Readline... --with-readline not specified
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for rl_save_prompt in -lreadline... yes
checking if building tests... no
checking for doxygen... no
configure: WARNING: doxygen not found - will not generate any doxygen documentation
checking for perl... /usr/bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating libmega.pc
config.status: creating include/mega/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build Mega SDK:

SDK version: 2.5.0
Host setup: i686-pc-linux-gnu
Install prefix: /usr/local
Compiler: g++
CXXFLAGS: -g -O2 -fPIC
gcc hardening: no
debug: no
static: no
sync subsystem yes
MEGA API yes
example apps: yes

inotify: yes
posix threads: yes

OpenSSL: -lssl
Crypto++: -lcryptopp
Sodium:
Zlib: -lz
SQLite3: -lsqlite3
c-ares: -lcares
cURL: -lcurl
FreeeImage: -lfreeimage
Readline: -lreadline
Termcap: -ltermcap


make -j

make all-recursive
make[1]: Entering directory /root/GIT/mega-sdk' Making all in include make[2]: Entering directory/root/GIT/mega-sdk/include'
make[2]: Nothing to be done for all'. make[2]: Leaving directory/root/GIT/mega-sdk/include'
make[2]: Entering directory /root/GIT/mega-sdk' CXX src/src_libmega_la-megaapi_impl.lo CXX src/src_libmega_la-megaapi.lo CXX src/gfx/src_libmega_la-freeimage.lo CXX src/src_libmega_la-megaclient.lo CXX src/src_libmega_la-attrmap.lo CXX src/src_libmega_la-backofftimer.lo CXX src/src_libmega_la-base64.lo CXX src/src_libmega_la-command.lo CXX src/src_libmega_la-commands.lo CXX src/src_libmega_la-db.lo CXX src/src_libmega_la-fileattributefetch.lo CXX src/src_libmega_la-file.lo CXX src/src_libmega_la-filefingerprint.lo CXX src/src_libmega_la-filesystem.lo CXX src/src_libmega_la-gfx.lo CXX src/src_libmega_la-http.lo CXX src/src_libmega_la-json.lo CXX src/src_libmega_la-node.lo CXX src/src_libmega_la-pubkeyaction.lo CXX src/src_libmega_la-request.lo CXX src/src_libmega_la-serialize64.lo CXX src/src_libmega_la-share.lo CXX src/src_libmega_la-sharenodekeys.lo CXX src/src_libmega_la-sync.lo CXX src/src_libmega_la-transfer.lo CXX src/src_libmega_la-transferslot.lo CXX src/src_libmega_la-treeproc.lo CXX src/src_libmega_la-user.lo CXX src/src_libmega_la-utils.lo CXX src/src_libmega_la-logging.lo CXX src/src_libmega_la-waiterbase.lo CXX src/src_libmega_la-proxy.lo CXX src/crypto/src_libmega_la-cryptopp.lo CXX src/db/src_libmega_la-sqlite.lo CXX third_party/utf8proc/src_libmega_la-utf8proc.lo CXX src/gfx/src_libmega_la-external.lo CXX src/posix/src_libmega_la-fs.lo CXX src/posix/src_libmega_la-console.lo CXX src/posix/src_libmega_la-net.lo CXX src/posix/src_libmega_la-waiter.lo CXX src/posix/src_libmega_la-consolewaiter.lo CXX src/thread/src_libmega_la-posixthread.lo CXX examples/examples_megacli-megacli.o CXX examples/examples_megasimplesync-megasimplesync.o src/megaapi_impl.cpp:39:0: warning: "_LARGEFILE64_SOURCE" redefined [enabled by default] /usr/include/features.h:170:0: note: this is the location of the previous definition g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-megaapi_impl.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-megaapi.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/gfx/src_libmega_la-freeimage.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-megaclient.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-command.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-commands.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-fileattributefetch.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-file.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-gfx.lo] Error 1 g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. make[2]: *** [src/src_libmega_la-node.lo] Error 1 src/posix/waiter.cpp: In member function ‘void mega::PosixWaiter::notify()’: src/posix/waiter.cpp:141:29: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] make[2]: Leaving directory/root/GIT/mega-sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/GIT/mega-sdk'
make: *** [all] Error 2

Error with build_sdk.sh under cygwin

Hi...I tried compiling sdk with the script, but I'm not sure with this error I got. This was compiled with cygwin..libreadline-devel , readline already installed but still got this error. Hope you can help

checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for rl_save_prompt in -lreadline... no
configure: error: readline library is required for the sample client.

Python MegaRequestListener Implement?

I try to get the file public key with below code revised from crud_example2.py

def upload(local_path, remote_path='/'):
    path_node = api.getNodeByPath(remote_path, cwd)
    if path_node:
        executor.do(api.startUpload, (local_path, path_node))
        filename = local_path.split('/')[-1]

        export_node = api.getNodeByPath(filename, path_node)
        export_listener = ExportListener()

        executor.do(api.exportNode, (export_node, export_listener))
        return export_listener.link
    else:
        return None

class ExportListener(MegaRequestListener):
    def onRequestFinish(self, api, request,error):
        self.link = request.getLink()
        if not self.link:
            print error

and i run with the error message

  File "/home/rice/mods/pymega.py", line 44, in upload
    return export_listener.link
  File "/usr/local/lib/python2.7/dist-packages/mega/mega.py", line 605, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, MegaRequestListener, name)
  File "/usr/local/lib/python2.7/dist-packages/mega/mega.py", line 57, in _swig_getattr
    raise AttributeError(name)
  AttributeError: link

Native thread exited without calling DetachCurrentThread

I'm always getting a segfault when GC tries to free JNI binding objects. Here is the backtrace:

W/art﹕ Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[38,tid=25318,Native,Thread*=0xa186e000,peer=0x130832e0,"Thread-875"]
A/art﹕ art/runtime/thread.cc:1057] Native thread exited without calling DetachCurrentThread: Thread[38,tid=25318,Native,Thread*=0xa186e000,peer=0x130832e0,"Thread-875"]
I/art﹕ Explicit concurrent mark sweep GC freed 28108(1388KB) AllocSpace objects, 48(2MB) LOS objects, 32% free, 32MB/48MB, paused 1.177ms total 85.271ms
A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc8 in tid 25318 (Thread-875)
I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG﹕ Build fingerprint: 'google/hammerhead/hammerhead:5.1/LMY47I/1767468:user/release-keys'
I/DEBUG﹕ Revision: '11'
I/DEBUG﹕ ABI: 'arm'
I/DEBUG﹕ pid: 23772, tid: 25318, name: Thread-875  >>> pl.solidexplorer2 <<<
I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc8
I/DEBUG﹕ Abort message: 'art/runtime/thread.cc:1057] Native thread exited without calling DetachCurrentThread: Thread[38,tid=25318,Native,Thread*=0xa186e000,peer=0x130832e0,"Thread-875"]'
I/DEBUG﹕ r0 00000000  r1 99ecedb0  r2 fffffa94  r3 0000000c
I/DEBUG﹕ r4 7092c1f8  r5 8788afce  r6 b47fd000  r7 fffffa98
I/DEBUG﹕ r8 aeec8840  r9 00000000  sl 00000013  fp 7092c20c
I/DEBUG﹕ ip b47faa88  sp 99ece800  lr b475a91d  pc b475a806  cpsr 80070030
I/DEBUG﹕ backtrace:
I/DEBUG﹕ #00 pc 00265806  /system/lib/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc(art::mirror::ArtMethod*, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >*)+53)
I/DEBUG﹕ #01 pc 001f79cb  /system/lib/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+250)
I/DEBUG﹕ #02 pc 00236a2f  /system/lib/libart.so (art::StackDumpVisitor::VisitFrame()+374)
I/DEBUG﹕ #03 pc 00231959  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+276)
I/DEBUG﹕ #04 pc 0023791b  /system/lib/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+182)
I/DEBUG﹕ #05 pc 00238fef  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+166)
I/DEBUG﹕ #06 pc 00242695  /system/lib/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+120)
I/DEBUG﹕ #07 pc 00228a35  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+272)
I/DEBUG﹕ #08 pc 00228c7f  /system/lib/libart.so (art::Runtime::Abort()+82)
I/DEBUG﹕ #09 pc 000a7371  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
I/DEBUG﹕ #10 pc 0023680f  /system/lib/libart.so (art::Thread::ThreadExitCallback(void*)+186)
I/DEBUG﹕ #11 pc 00017221  /system/lib/libc.so (pthread_key_clean_all()+80)
I/DEBUG﹕ #12 pc 00016e9f  /system/lib/libc.so (pthread_exit+30)
I/DEBUG﹕ #13 pc 00016bb1  /system/lib/libc.so (__pthread_start(void*)+32)
I/DEBUG﹕ #14 pc 00014af3  /system/lib/libc.so (__start_thread+6)

Create Folder

Dear All,

are there any examples how to create folder using megaapi?

thanks,

Mega iOS Sdk not working for ios9

Whenever user tries to login, it does call requestStart but the control never transfers to onRequestFailed or onRequestFinish.

Its happening in ios9

Old gcc fails to compile SDK due initialization of class member in sodium.h

Hello,

some old gcc version (4.6.3v which ships with Ubuntu 12.04) fails to compile SDK with the following error:

sdk/sdk/include/mega/crypto/sodium.h:40:30: error: ISO C++ forbids initialization of member 'keySeed' [-fpermissive]
sdk/sdk/include/mega/crypto/sodium.h:40:30: error: making 'keySeed' static [-fpermissive]
sdk/sdk/include/mega/crypto/sodium.h:40:30: error: invalid in-class initialization of static data member of non-integral type 'unsigned char*'

Unable to compile megafuse in example/linux/

I followed the instructions, which told me to include --enable-fuse in ./configure.
But it seems that it couldn't recognize it, giving me this error:

configure: WARNING: unrecognized options: --enable-fuse

Any help?

Please share megacli and megasimplesync for Windows

Hello, I'm not good at coding and can't build sdk in Windows, could you please share built version include megacli.exe and megasimplesync.exe? It's easier to use command line than official sync app.
Thank you very much!

Segmentation fault getNodeByPath

I have successfully built a project that uses the mega SDK/API to get a list of folders. I used the code that can be found in the examples (for FUSE). As soon a I call getNodeByPath I get a segmentation fault on line [email protected].

The last console messages I get are:

[12:58:49][info] MEGA initialization complete!
...
[12:59:26][debug] Getting attributes:
[12:59:26][debug] /

What could cause a segmentation fault in the SDK/API?

MALFORMED_ATTRIBUTES remote file when creating Unicode filename

For several cases I managed to get MALFORMED_ATTRIBUTES as a filename on Web interface, when created local file using Unicode encoding for filename.

Examples of such Unicode filenames:

\u29be\u09e2\u2168\u1d35\uc404\u1c24\uebe7\ua023\u4a5c\u75c9\u90a1\u9302\udc75
\u5a00\uf8b6\u6162\u3844\u4f54\ua4fb\u2193\uc037\ud5f2\u477c\ud992

Steps to reproduce:

  • start megacli, sync local and remote folder
  • in local synced folder execute the following Python script:
s = u"\u29be\u09e2\u2168\u1d35\uc404\u1c24\uebe7\ua023\u4a5c\u75c9\u90a1\u9302\udc75"
open(s, "a").close()
  • on Web interface such file will have MALFORMED_ATTRIBUTES as a filename

Remote file duplication

Rempte file duplicates, when simultaneously altering the same remote file from local synced folders, steps to reproduce:

  • start two megacli instances, sync the same remote folder to two local folders
  • in each local synced folder simultaneously write to the same file
  • remotely two files appear with the same name

MegaTransferListener.onTransferFinish

Dear All,

what is guaranteed way to determine UploadListener that transfer is finished
or startUpload transfer finished?

the reason I'm asking, regardless onTransferFinish is implemented in my UploadListener,
this event sometimes does not happen.

thanks in advance,

Segmentation fault while executing lt-megasimplesync

While executing...

./lt-megasimplesync /home/user1/MEGAsync /MEGAsync --lt-debug

as normal user, a "Segmentation fault" occurs.

Same as "root" user (with a little bit more information...):

megasimplesync:examples/megasimplesync:93: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
megasimplesync:examples/megasimplesync:114: newargv[0]: /root/GIT/mega-sdk/examples/.libs/lt-megasimplesync
megasimplesync:examples/megasimplesync:104: newargv[1]: /home/user1/MEGAsync
megasimplesync:examples/megasimplesync:104: newargv[2]: /MEGAsync
Segmentation fault

STRACE:
[...]
munmap(0xb75f2000, 4096) = 0
clock_gettime(CLOCK_MONOTONIC, {4842599, 463314166}) = 0
send(6, "K\365\1\0\0\1\0\0\0\0\0\0\1g\3api\4mega\2co\2nz\0\0\1"..., 34, MSG_NOSIGNAL) = 34
clock_gettime(CLOCK_MONOTONIC, {4842599, 463420915}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

EDIT:
By the way... megacli is running fine

iOS stream for MPVideoPlayer

Is it possible to use the mega api to stream to a format to play in MPMoviePlayer?

Like the actual mega app does on the App Store.

I see from the mega app's syslog output that it creates a local url to http://127.0.0.1:52079/123...456.mp4

Just wondering on the best way to achieve video playback from video stored on mega.

problem sdk with php

Hi,
i have download your sdk from github
I launch
./configure --prefix=/opt/mega --enable-php
for use your php library but,
when launch make
i get a error
c++ -noruntime -php -I./include -o bindings/php/megaapi_wrap.cpp bindings/megaapi.i
c++: error: unrecognized command line option ‘-noruntime’
c++: error: unrecognized command line option ‘-php’
make[2]: [bindings/php/megaapi_wrap.cpp] Error 1 (ignored)
CXX bindings/php/bindings_php_libmegaphp_la-megaapi_wrap.lo
g++: error: ./bindings/php/megaapi_wrap.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
make[2]: *** [bindings/php/bindings_php_libmegaphp_la-megaapi_wrap.lo] Error 1
make[2]: Leaving directory /tmp/sdk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/tmp/sdk'
make: *** [all] Error 2

In fact, the file megaapi_wrap.cpp does not exist

Why

Regards Alberto

Provide binary releases

I am a Java dev and need a DLL in order to use JNA to call it's methods (SWIG is just an overkill for simple tasks).
I am not up to the task to build the source code and all it's dependencies with c++, so I kindly request binary releases as well.

[Android/Java] Overload the startUpload method with InputStream parameter

Hi,
Is it possible to add a variant of the startUpload() method which would take an InputStream as a parameter? Currently it's only possible with a local path and I have to download the file to a temporary copy, which is a nonsense. Streams are much better for data transfers and make the API more universal.
Thanks!

fetchNodes() reads the whole file system tree

I'm having problems using the fetchNodes() method, when connecting to accounts having many files. For example, fetching an account with over 1TB of files takes over 3 minutes.

I would gladly skip calling it, but it's necessary to make other methods work, like getNodeByPath(). Why does it work like that?

The best solution imo would be to allow calling getNodeByPath() and other similar methods without a need to call the fetchNodes() first. Can it be achieved?

MEGA glitches today

I uploaded files with MEGA SDK.

they appeared on remote.

after some minutes on remote, all files are dissapear as well as directories.( in web interface too )

this problem happens all over again.

Nodejs?

Is there is any way to use it with Nodejs, any module?

megasimplesync does not follow symlinks

megasimplesync does not follow symlinks and there is no command line parameter available.
worth adding a command line switch to enable symlinks transversal.

megacli: Problem with put command

try running this command, the file cannot be upload:
put "/home/abc/[ab].sh" /

but this work:
put "/home/abc/[] a b.sh" /

Did I missed something?

sh autogen.sh fails on Kubuntu 14.04 64bit

I am compiling on Kubuntu 14.04 64bit. Running autogen.sh gives the following:

$ sh autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:108: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Java SDK Compiling

Hello guys,

I'm trying to compile the new java sdk but I get this error:
configure: error: could not find jni.h, please specify JAVA include directory using --with-java-include-dir option.
And when I will add this option:
Command: ./configure --enable-java --with-java-include-dir /usr/lib/jvm/java-7-openjdk-amd64/
Error: checking build system type... Invalid configuration /usr/lib/jvm/java-7-openjdk-amd64/': machine/usr/lib/jvm/java-7-openjdk' not recognized
configure: error: /bin/bash ./config.sub /usr/lib/jvm/java-7-openjdk-amd64/ failed
How can I fix my problem?

Regards
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.