Error compiling cocos2d-x: cannot find -lc-newlib

Hi.

I’ve downloaded Bada SDK 2.0.4 and cocos2d-x v1.0.1-x-0.11.0 and followed tutorial How to run HelloWorld and tests of cocos2d-x on bada

The following projects compile successfully:
* Box2D
* chipmink
* libjpeg
* png
* zlib

The following projects don’t compile:
* CocosDenshion

**** Build of configuration Target-Debug for project CocosDenshion ****

cs-make all 
Building target: libCocosDenshion.so
Invoking: bada C++ Linker
ldflags: -nostdlib -lc-newlib -lm-newlib -L"C:/bada/2.0.4/Model/WaveHVGA/Target" -L"C:/soft/sdk/cocos2d-1.0.1-x-0.11.0/CocosDenshion/proj.bada/sdk2.0/lib" -shared -o"libCocosDenshion.so" ./bada/vorbis/analysis.o ./bada/vorbis/bitrate.o ./bada/vorbis/block.o ./bada/vorbis/codebook.o ./bada/vorbis/envelope.o ./bada/vorbis/floor0.o ./bada/vorbis/floor1.o ./bada/vorbis/info.o ./bada/vorbis/lookup.o ./bada/vorbis/lpc.o ./bada/vorbis/lsp.o ./bada/vorbis/mapping0.o ./bada/vorbis/mdct.o ./bada/vorbis/psy.o ./bada/vorbis/registry.o ./bada/vorbis/res0.o ./bada/vorbis/sharedbook.o ./bada/vorbis/smallft.o ./bada/vorbis/sort.o ./bada/vorbis/synthesis.o ./bada/vorbis/vorbisenc.o ./bada/vorbis/vorbisfile.o ./bada/vorbis/window.o ./bada/ogg/bitwise.o ./bada/ogg/framing.o ./bada/CCAudioOut.o ./bada/SimpleAudioEngine.o 
c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lc-newlib
c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lm-newlib
arm-samsung-nucleuseabi-g++ @ldflags @ldobjs  C:/bada/2.0.4/Model/WaveHVGA/Target/osp_rt0.a C:/bada/2.0.4/Model/WaveHVGA/Target/FOsp.so C:/bada/2.0.4/Model/WaveHVGA/Target/StubDynCast.so  -lstdc++ -lgcc_s
collect2: ld returned 1 exit status
cs-make: *** [libCocosDenshion.so] Error 1

* cocos2dx

**** Build of configuration Target-Debug for project cocos2dx ****

cs-make all 
Building target: libcocos2dx.so
Invoking: bada C++ Linker
ldflags: -nostdlib -lc-newlib -lm-newlib -L"C:/bada/2.0.4/Model/WaveHVGA/Target" -L"C:/soft/sdk/cocos2d-1.0.1-x-0.11.0/cocos2dx/proj.bada/sdk2.0/lib" -shared -o"libcocos2dx.so" ./touch_dispatcher/CCTouchDispatcher.o ./touch_dispatcher/CCTouchHandler.o ./tileMap_parallax_nodes/CCParallaxNode.o ./tileMap_parallax_nodes/CCTMXLayer.o ./tileMap_parallax_nodes/CCTMXObjectGroup.o ./tileMap_parallax_nodes/CCTMXTiledMap.o ./tileMap_parallax_nodes/CCTMXXMLParser.o ./tileMap_parallax_nodes/CCTileMapAtlas.o ./textures/CCTexture2D.o ./textures/CCTextureAtlas.o ./textures/CCTextureCache.o ./textures/CCTexturePVR.o ./text_input_node/CCIMEDispatcher.o ./text_input_node/CCTextFieldTTF.o ./support/zip_support/ZipUtils.o ./support/zip_support/ioapi.o ./support/zip_support/unzip.o ./support/image_support/TGAlib.o ./support/CCArray.o ./support/CCPointExtension.o ./support/CCProfiling.o ./support/CCUserDefault.o ./support/TransformUtils.o ./support/base64.o ./support/ccUtils.o ./sprite_nodes/CCAnimation.o ./sprite_nodes/CCAnimationCache.o ./sprite_nodes/CCSprite.o ./sprite_nodes/CCSpriteBatchNode.o ./sprite_nodes/CCSpriteFrame.o ./sprite_nodes/CCSpriteFrameCache.o ./script_support/CCScriptSupport.o ./platform/CCCommon.o ./platform/CCFileUtils.o ./platform/CCGL.o ./platform/CCImage.o ./platform/CCSAXParser.o ./platform/CCStdC.o ./platform/CCThread.o ./platform/platform.o ./platform/bada/CCAccelerometer_bada.o ./platform/bada/CCApplication_bada.o ./platform/bada/CCEGLView_bada.o ./platform/bada/CCPlatformFunc_bada.o ./platform/bada/pthread.o ./platform/bada/semaphore.o ./particle_nodes/CCParticleExamples.o ./particle_nodes/CCParticleSystem.o ./particle_nodes/CCParticleSystemPoint.o ./particle_nodes/CCParticleSystemQuad.o ./misc_nodes/CCMotionStreak.o ./misc_nodes/CCProgressTimer.o ./misc_nodes/CCRenderTexture.o ./misc_nodes/CCRibbon.o ./menu_nodes/CCMenu.o ./menu_nodes/CCMenuItem.o ./layers_scenes_transitions_nodes/CCLayer.o ./layers_scenes_transitions_nodes/CCScene.o ./layers_scenes_transitions_nodes/CCTransition.o ./layers_scenes_transitions_nodes/CCTransitionPageTurn.o ./layers_scenes_transitions_nodes/CCTransitionRadial.o ./label_nodes/CCLabelAtlas.o ./label_nodes/CCLabelBMFont.o ./label_nodes/CCLabelTTF.o ./keypad_dispatcher/CCKeypadDelegate.o ./keypad_dispatcher/CCKeypadDispatcher.o ./effects/CCGrabber.o ./effects/CCGrid.o ./CCCamera.o ./CCConfiguration.o ./CCDirector.o ./CCDrawingPrimitives.o ./CCScheduler.o ./cocos2d.o ./cocoa/CCAffineTransform.o ./cocoa/CCAutoreleasePool.o ./cocoa/CCData.o ./cocoa/CCGeometry.o ./cocoa/CCNS.o ./cocoa/CCObject.o ./cocoa/CCSet.o ./cocoa/CCZone.o ./base_nodes/CCAtlasNode.o ./base_nodes/CCNode.o ./actions/CCAction.o ./actions/CCActionCamera.o ./actions/CCActionEase.o ./actions/CCActionGrid.o ./actions/CCActionGrid3D.o ./actions/CCActionInstant.o ./actions/CCActionInterval.o ./actions/CCActionManager.o ./actions/CCActionPageTurn3D.o ./actions/CCActionProgressTimer.o ./actions/CCActionTiledGrid.o 
arm-samsung-nucleuseabi-g++ @ldflags @ldobjs  C:/bada/2.0.4/Model/WaveHVGA/Target/osp_rt0.a ../../../platform/third_party/bada/src/libjpeg/sdk2.0/.Target-Debug/libjpeg.a ../../../platform/third_party/bada/src/png/sdk2.0/.Target-Debug/libpng.a ../../../platform/third_party/bada/src/zlib/sdk2.0/.Target-Debug/libzlib.a C:/bada/2.0.4/Model/WaveHVGA/Target/pthread.so C:/bada/2.0.4/Model/WaveHVGA/Target/FOsp.so C:/bada/2.0.4/Model/WaveHVGA/Target/FGraphicsOpengl.so C:/bada/2.0.4/Model/WaveHVGA/Target/FGraphicsEgl.so C:/bada/2.0.4/Model/WaveHVGA/Target/StubDynCast.so  -lstdc++ -lgcc_s
c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lc-newlib
c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lm-newlib
collect2: ld returned 1 exit status
cs-make: *** [libcocos2dx.so] Error 1

Both projects seem to be the same cause to fail during compilation process:

c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lc-newlib
c:/bada/2.0.4/tools/toolchains/arm/bin/../lib/gcc/arm-bada-eabi/4.5.3/../../../../arm-bada-eabi/bin/ld.exe: cannot find -lm-newlib

I added path to libc-newlib.so.0 and libm-newlib.so.0

C:\bada\2.0.4\Tools\Toolchains\ARM\arm-bada-eabi\lib\

in the

project configuration -> C/C++ General -> Library Paths

but it remains the same.

My environment:

MS Windows 7 sp1 32 bits.
Bada SDK 2.0.4 (C:.0.4).
cocos2d-x version 1.0.1-x-0.11.0.

PATH:

C:\bada\2.0.4\Tools\Toolchains\ARM\bin;C:/bada/2.0.4/IDE/jre/bin/client;C:/bada/2.0.4/IDE/jre/bin;C:/bada/2.0.4/IDE/jre/lib/i386;C:\soft\android\google\android-ndk-r7;C:\soft\c\MinGW\bin;C:\soft\c\MinGW\msys\1.0\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\OpenVPN\bin

Any clue?

Regards.


Please,

Hi.

Based on post Removing XMSoft image from top-left corner of application (Bada OS) I’ve advanced a bit.

My error now is regarding VFP (Vector Floating Point).

Bellow are some of the error messages:

error: libcocos2dx.so uses VFP register arguments, ../../../platform/third_party/bada/src/libjpeg/sdk2.0/.Target-Debug/libjpeg.a(jutils.o) does not
error: libcocos2dx.so uses VFP register arguments, ../../../platform/third_party/bada/src/png/sdk2.0/.Target-Debug/libpng.a(png.o) does not
error: libCocosDenshion.so uses VFP register arguments, ./bada/CCAudioOut.o does not

Any help is too much appreciated.

Regards.


Please,

All previous problems happened compiling projects for Bada SDK 2.0.

I imported cocos2d-x projects for Bada SDK 1.0 and I got the same errors as the previous one.

I’m pretty sure I’m missing something but I’m not seem what is it.

No one came across with these problems?

Regards.


Please,

Hi, have you read the http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_HelloWorld_and_tests_of_cocos2d-x_on_bada clearly?

3. Build Wave M libraries, run helloworld and tests
If you want to build libraries for bada 2.0 device, you should switch each project to HVGA modal, then put the attachment files to ‘C:.0.2\Model\WaveHVGA\Target’ folder. Now, build and run your project as above step!

Hi, James.

Thank you a lot for replying.

Yes, I’ve read and I’ve copied libc-newlib.so and libm-newlib.so into C:.0.4\Model\WaveHVGA\Target and set each project to WaveHVGA (this procedure is the same explained on post Removing XMSoft image from top-left corner of application).

After this procedure errors changed to

error: libcocos2dx.so uses VFP register arguments, ../../../platform/third_party/bada/src/libjpeg/sdk2.0/.Target-Debug/libjpeg.a(jutils.o) does not
error: libcocos2dx.so uses VFP register arguments, ../../../platform/third_party/bada/src/png/sdk2.0/.Target-Debug/libpng.a(png.o) does not
error: libCocosDenshion.so uses VFP register arguments, ./bada/CCAudioOut.o does not

Regards.


Please,

It seems that some files were compiled with VFP while others don’t. Ok. But why? I still didn’t figured it out.

Regards.


Please,

Hi, try to clean all projects first, then rebuild your projects.