zoukankan      html  css  js  c++  java
  • cocos2dx添加新的类后出现错误undefined reference to的解决办法

    使用cocos compile -p android编译cocos2dx项目的时候出现如下错误(新建了TestScene.h,TestScene.cpp):

    jni/../../Classes/AppDelegate.cpp:79: error: undefined reference to 'TestScene::createScene()'
    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
    make.exe: *** [obj/local/armeabi/libMyGame.so] Error 1
    make.exe: Leaving directory `D:/projects/HelloWorldCpp/proj.android'
    执行命令出错,返回值:2

    编辑proj.android/jni/目录下的Android.mk文件,在

    LOCAL_SRC_FILES := hellocpp/main.cpp 
                       ../../Classes/AppDelegate.cpp 
                       ../../Classes/HelloWorldScene.cpp

    处追加上你所有新建的文件(我这里是TestScene.cpp),重新编译,通过。

  • 相关阅读:
    HDU5120
    POJ 1062
    POJ 1086
    BestCoder 1st Anniversary (HDU 5311)
    HDU 5284
    Dylans loves sequence(hdu5273)
    day65 作业
    第三次小组分享 猴子补丁
    day59 csrf auth
    day58 cookie session 中间件
  • 原文地址:https://www.cnblogs.com/moonlightpoet/p/5752655.html
Copyright © 2011-2022 走看看