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

fixed compile error. #7526

Merged
merged 2 commits into from Jul 21, 2014

Conversation

Projects
None yet
3 participants
@chenguangqi
Contributor

chenguangqi commented Jul 19, 2014

# compile for android.
$ ./build_native.py

Error message as follow:

ssize_tjni/../../cocos2d/cocos/./3d/CCBundleReader.cpp:94:23: error: return type of out-of-line
      definition of 'cocos2d::BundleReader::tell' differs from that in the declaration
ssize_t BundleReader::tell()
                      ^
jni/../../cocos2d/cocos/./3d/CCBundleReader.h:90:14: note: previous declaration is here
    long int tell();
             ^
1 error generated.

chenguangqi added some commits Jul 19, 2014

fixed compile error.
```bash
# compile for android.
$ ./build_native.py
```

Error message as follow:

```
ssize_tjni/../../cocos2d/cocos/./3d/CCBundleReader.cpp:94:23: error: return type of out-of-line
      definition of 'cocos2d::BundleReader::tell' differs from that in the declaration
ssize_t BundleReader::tell()
                      ^
jni/../../cocos2d/cocos/./3d/CCBundleReader.h:90:14: note: previous declaration is here
    long int tell();
             ^
1 error generated.
```
fixed error for importing android project to Eclipse
```
The import org.cocos2dx.lib cannot be resolved ...
```
@minggo

This comment has been minimized.

Show comment
Hide comment
@minggo

minggo Jul 20, 2014

Contributor

Thanks.
How to reproduce it?

And please just do one think in a commit.
You can use different branches to do different things.

Thanks.

Contributor

minggo commented Jul 20, 2014

Thanks.
How to reproduce it?

And please just do one think in a commit.
You can use different branches to do different things.

Thanks.

@chenguangqi

This comment has been minimized.

Show comment
Hide comment
@chenguangqi

chenguangqi Jul 21, 2014

Contributor

reproduce on environment as follow.

My OS(x86_64)


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:        14.04
Codename:       trusty

$ uname -a
Linux vb 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Contributor

chenguangqi commented Jul 21, 2014

reproduce on environment as follow.

My OS(x86_64)


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:        14.04
Codename:       trusty

$ uname -a
Linux vb 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
@chenguangqi

This comment has been minimized.

Show comment
Hide comment
@chenguangqi

chenguangqi Jul 21, 2014

Contributor

Additional information:

NDK:android-ndk-r10(64-bit)

The Selected NDK toolchain version was 4.8 !

Contributor

chenguangqi commented Jul 21, 2014

Additional information:

NDK:android-ndk-r10(64-bit)

The Selected NDK toolchain version was 4.8 !

minggo added a commit that referenced this pull request Jul 21, 2014

@minggo minggo merged commit 7ba4f2e into cocos2d:v3 Jul 21, 2014

@minggo

This comment has been minimized.

Show comment
Hide comment
@minggo

minggo Jul 21, 2014

Contributor

Thanks.

Contributor

minggo commented Jul 21, 2014

Thanks.

cocos-travis-mac added a commit to cocos-travis-mac/cocos2d-x that referenced this pull request Jul 21, 2014

@minggo

This comment has been minimized.

Show comment
Hide comment
@minggo

minggo Jul 22, 2014

Contributor

Why your selected toolchain is 4.8?
We have changed to use clang.

Contributor

minggo commented Jul 22, 2014

Why your selected toolchain is 4.8?
We have changed to use clang.

@chenguangqi

This comment has been minimized.

Show comment
Hide comment
@chenguangqi

chenguangqi Jul 23, 2014

Contributor

I think it's is a bug. see alse method build_native.py in build_native.py
value of NDK_TOOLCHAIN_VERSION is not clang,but 4.7 , 4.8 when NDK is nkd-r10.

Paths of build_native.py:
cocos2d-x/tools/cocos2d-console/plugins/build_native.py
cocos2d-x/templates/cpp-template-default/proj.android/build_native.py

Contributor

chenguangqi commented Jul 23, 2014

I think it's is a bug. see alse method build_native.py in build_native.py
value of NDK_TOOLCHAIN_VERSION is not clang,but 4.7 , 4.8 when NDK is nkd-r10.

Paths of build_native.py:
cocos2d-x/tools/cocos2d-console/plugins/build_native.py
cocos2d-x/templates/cpp-template-default/proj.android/build_native.py

@minggo

This comment has been minimized.

Show comment
Hide comment
@minggo

minggo Jul 23, 2014

Contributor

I know the issue. It is because it selects gcc version as previous. But the value will be replaced by the setting in Application.mk. So the final selected compiler is clang.

Contributor

minggo commented Jul 23, 2014

I know the issue. It is because it selects gcc version as previous. But the value will be replaced by the setting in Application.mk. So the final selected compiler is clang.

@minggo

This comment has been minimized.

Show comment
Hide comment
@minggo

minggo Jul 23, 2014

Contributor

The output is generated in build_native.py.

Contributor

minggo commented Jul 23, 2014

The output is generated in build_native.py.

@tianqibucuohao

This comment has been minimized.

Show comment
Hide comment
@tianqibucuohao

tianqibucuohao Jul 26, 2014

User ndk r9d, compiled error whether existed???

tianqibucuohao commented Jul 26, 2014

User ndk r9d, compiled error whether existed???

echorebel added a commit to projmary/stachenblochen that referenced this pull request Feb 15, 2015

@echorebel echorebel referenced this pull request Feb 15, 2015

Closed

android.proj broken #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment