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

fixed compile error. #7526

Merged
merged 2 commits into from
Jul 21, 2014
Merged

fixed compile error. #7526

merged 2 commits into from
Jul 21, 2014

Conversation

chenguangqi
Copy link
Contributor

# 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.

```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.
```
```
The import org.cocos2dx.lib cannot be resolved ...
```
@minggo
Copy link
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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

minggo commented Jul 21, 2014

Thanks.

cocos-travis-mac pushed a commit to cocos-travis-mac/cocos2d-x that referenced this pull request Jul 21, 2014
@minggo
Copy link
Contributor

minggo commented Jul 22, 2014

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

@chenguangqi
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor

minggo commented Jul 23, 2014

The output is generated in build_native.py.

@tianqibucuohao
Copy link

User ndk r9d, compiled error whether existed???

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

Successfully merging this pull request may close these issues.

3 participants