Hi3861开发板 code 2.0 canary编译hello world报错

txwtech
发布于 2021-7-29 10:00
浏览
0收藏

/*
 * Copyright (c) 2020 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "ohos_init.h"
#include "demosdk.h"

void DemoSdkMain(void)
{
    DemoSdkEntry();
}

SYS_RUN(DemoSdkMain);

 

解决方法:

helloworld.c:(.text.DemoSdkMain+0x10): undefined reference to `DemoSdkEntry'这个错误有几个原因能造成:一个是没有包含这个头文件,还有就是在BUILD.gn或者.gni文件中没有将这个函数的源文件的路径添加进去。需要在.gni文件中把这个函数的源文件路径包含进去

 

https://developer.huawei.com/consumer/cn/forum/topic/0202626127513420182?fid=0101587865002800104

 

标签
收藏
回复
举报
回复
    相关推荐