1. 程式人生 > >CCS3.3:error: symbol referencing errors

CCS3.3:error: symbol referencing errors

CCS v3.3開發環境 Step by step (1)

Step 1: 建立一個工程,同時增加一個c檔案,消除所有的編譯、連結錯誤和警告。

1、建立一個專案工程:
通過選單:Project>New, 然後在Project Creation對話方塊中輸入:
Project Name: hello
Location: C:\test\hello\
Project Type: Executable (.out)
Target: TMS320C55XX
點選Finish完成工程建立。
這時在C:\test\hello\ 目錄下得到二個基本的檔案:
hello.pjt - 工程檔案
hello.sbl

hello.pjt檔案的內容如下:
; Code Composer Project File, Version 2.0 (do not modify or remove this line)
=》檔案頭,用於CCS識別檔案版本等資訊,注意不能被手工修改!!!
[Project Settings] =》 專案資訊
ProjectDir="C:\test\hello\" =》指向專案檔案的絕對路徑。而專案檔案中的相對路徑都是基於該路徑而然
ProjectType=Executable =》專案型別,指專案工程用於生成一個可執行的檔案還是庫檔案
CPUFamily=TMS320C55XX =》 CPU家族
Tool="Compiler"
Tool="CustomBuilder"
Tool="DspBiosBuilder"
Tool="Linker"
Config="Debug"
Config="Release"

["Compiler" Settings: "Debug"] =》 編譯器選項
Options=-g -fr"$(Proj_dir)\Debug" -d"_DEBUG"

["Compiler" Settings: "Release"]
Options=-o2 -fr"$(Proj_dir)\Release"

["Linker" Settings: "Debug"] =》 連結器選項
Options=-c -m".\Debug\hello.map" -o".\Debug\hello.out" -w -x

["Linker" Settings: "Release"]
Options=-c -m".\Release\hello.map" -o".\Release\hello.out" -w -x

2、增加檔案

滑鼠右鍵,點選“Add Files to Project...”,增加一個hello.c檔案到專案工程中
hello.c檔案內容如下:
#include <stdio.h>

void main(void)
{
printf("Hello word!\n");
}

3、編譯、修改錯誤
編譯得到錯誤資訊如下(這些也可以直接從檔案cc_build_Debug.log中得到):
----------------------------- hello.pjt - Debug -----------------------------
[hello.c] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" -g -fr"C:/test/hello/Debug" -d"_DEBUG"
[email protected]
"Debug.lkf" "hello.c"

Warning: The project has no cmd file while the Text Linker is selected
[Linking...] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" [email protected]"Debug.lkf"
<Linking>
>> warning: creating output section .const without SECTIONS specification
>> warning: entry point symbol _c_int00 undefined

undefined first referenced
symbol in file
--------- ----------------
_printf C:\\test\\hello\\Debug\\hello.obj
>> error: symbol referencing errors - './Debug/hello.out' not built

>> Compilation failure

Build Complete,
2 Errors, 4 Warnings, 0 Remarks.

這是沒有為工程指定選用具體的rts庫檔案所致;兩種方法可以用來進行修正,
方案一、直接將所需要的庫檔案加到專案工程中,譬如:滑鼠右鍵,點選“Add Files to Project...”,選中:C:\CCStudio_v3.3\C5500\cgtools\lib\rts2800.lib;
方案二、修改連結器的連結引數即可;譬如:滑鼠右鍵,點選“Build Options...”,選Linker Tab, Category中選Libraries, 設定Inc. Libraries (-l): 為 rts2800.lib;

一般來說,方案二為推薦使用,便於專案工程檔案的移動、拷貝,特別組內多人開發使用!!


重新編譯,其結果如下:
----------------------------- hello.pjt - Debug -----------------------------
[hello.c] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" -g -fr"C:/test/hello/Debug" -d"_DEBUG" [email protected]"Debug.lkf" "hello.c"

Warning: The project has no cmd file while the Text Linker is selected
[Linking...] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" [email protected]"Debug.lkf"
<Linking>
>> warning: creating output section vectors without SECTIONS specification
>> warning: creating output section .const without SECTIONS specification
>> warning: creating output section .cio without SECTIONS specification
>> warning: creating .stack section with default size of 500 words.
Use
-stack option to change the default size.
>> warning: creating .sysstack section with default size of 500 words.
Use
-sysstack option to change the default size.
>> warning: creating .sysmem section with default size of 1000 words.
Use
-heap option to change the default size.

Build Complete,
0 Errors, 7 Warnings, 0 Remarks.

Ok, 成功,消除了所有的編譯錯誤,但還是有一些Warning;怎麼辦?
呵呵,咱們接著看

4、消除編譯警告
增加一個.cmd 配置檔案
將C:\CCStudio_v3.3\C5500\cgtools\lib\lnk.cmd 檔案拷貝到c:\test\hello\hello.cmd
同時將hello.cmd檔案加入到專案工程當中即可。
----------------------------- hello.pjt - Debug -----------------------------
[hello.c] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" -g -fr"C:/test/hello/Debug" -d"_DEBUG" [email protected]"Debug.lkf" "hello.c"

[Linking...] "C:\CCStudio_v3.3\C5500\cgtools\bin\cl55" [email protected]"Debug.lkf"
<Linking>

Build Complete,
0 Errors, 0 Warnings, 0 Remarks.

非常幸運,搞定一個基本的工程以及所有相關的編譯錯誤和告警。

5、小結
這些檔案需要做備份、保留:
hello.pjt
hello.cmd
hello.c

另外還有臨時檔案:
hello.sbl => 動態生成的二進位制專案工程
Debug.lkf => 連結器選項引數
cc_build_Debug.log => 編譯連結的Log檔案
臨時目錄:
Debug => 生成的輸出檔案和臨時Object file.
hello.CS_

相關推薦

CCS3.3error: symbol referencing errors

CCS v3.3開發環境 Step by step (1)Step 1: 建立一個工程,同時增加一個c檔案,消除所有的編譯、連結錯誤和警告。1、建立一個專案工程: 通過選單:Project>New, 然後在Project Creation對話方塊中輸入: Project Name: hello Loca

solaris10g++編譯程式連結時候報錯symbol referencing errors

ld: warning: symbol 'typeinfo for std::basic_iostream<char, std::char_traits<char> >' has differing sizes:         (file ../.

python setup.py install 報錯error: [WinError 3] 系統找不到指定的路徑。: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib

Outline 在通過 setup.py 安裝python模組時,遇到了以下報錯: # 執行 python setup.py install # 報錯: error: [WinError 3] 系統找不到指定的路徑。: 'C:\\Program Files (x86)\\Microsof

Redis第一次啟動,SHUTDOWN時提示 (error) ERR Errors trying to SHUTDOWN. Check logs.

今天我也是第一次玩redis,從下載到安裝到HelloWorld一切順風順水,誰知在最後關閉redis時,出現了(error) ERR Errors trying to SHUTDOWN. Check logs.錯誤。下面貼出我的解決過程(可能有點繁瑣):

Swift 3必看Error與NSError的關係

在學習Swift 3的過程中整理了一些筆記,如果想看其他相關文章可前往《Swift 3必看》系列目錄 在之前的版本中,Swift中Error與OC中NSError的關係就像上海的南京路與南京的上海路關係一樣,那就是沒有關係。 我們先來看兩者的區別。 Error是一個實現Erro

Androidstudio重啟後錯誤Error:Unexpected lock protocol found in lock file. Expected 3, found 0.

Error:Unexpected lock protocol found in lock file. Expected 3, found 0.這個錯誤我遇到好多次了。因為本人筆記本在把I5升級到I

Python openCVerror:(-215)scn == 3 || scn ==4 in function cv::cvtColor

在使用以下程式碼讀取圖片並將圖片轉換為灰度: imageA = cv2.imread("D:/111test/111.png",0) grayA = cv2.cvtColor(imageA,cv2.COLOR_BGR2GRAY) 出現錯誤:error:(-2

OpenCV編譯錯誤/usr/local/lib/opencv_core.so.3.1:error adding symols: DSO missing from command line

今天編譯一個c++檔案 用到opencv,編譯出錯,通過百度 解決了, 錯誤程式碼: ------------------------ root@caffe:~/thrid_week# g++ -o

靈異事件之Android Studio 3.4提示Error running app: Default Activity Not Found

方法 什麽是 ons tro app nac 開啟 ins XML 靈異事件之:Android Studio 3.4提示:Error running app: Default Activity Not Found 本次事件尚未解決,如果有手法獨特的大神,請在

MSP430WARE++的使用3modbus模塊的調用方法

tails 更改 protocol usr 調用 gb2 targe 文件組 splay MSP430WARE++的使用3:modbus模塊的調用方法 MSP430WARE是一套基於C++語言的開源的MSP430層次化軟件架構,支持多種外設。本文將介紹mo

增強學習Reinforcement Learning經典算法梳理3TD方法

經典算法 get tail info detail 地址 category details 方法 轉自:http://blog.csdn.net/songrotek/article/details/51382759 博客地址:http://blog.csdn.net/s

修復mysql[ERROR] Native table ‘performance_schema’

data- 驗證 eve nbsp mar usr rwlock wait 地址 轉: http://www.amznz.com/error-native-table-performance_schema/ mysql數據庫出現如下錯誤,主要是因為升級了mysql軟件包

C++筆記(3)運算符重載

存在 新的 邏輯運算符 int() 取地址 參數 spl this 函數的重載                     運算符重載 1.運算符重載基礎 2.運算符重載的規則 3.重載雙目運算符 4.重載單目運算符 5.重載流插入和提取運算符 6.類型轉換 7.定義自己的st

PostgreSQL copy 時提示ERROR: invalid byte sequence for encoding "UTF8": 0xb3

color 方式 clas lena 三種 rep schema error val 測試時使用三種文件格式: ISO-8859 Netpbm PBM image ASCII if [ $(file $filename|grep -c "ISO-8859") -gt 0

開發人員學Linux(3)CentOS7中安裝JDK8和Tomcat8

java tomcat jdk service centos 題外話:直到今天開始寫本系列的第三篇時本人才想好為這個系列取一個名字,本系列不是為Linux運維人員準備的,而是主要為開發人員準備的,包括但不限於:希望了解Linux的開發人員;需要在Linux上部署一些組件的開發人員,如Mem

WAS集群系列(5)集群搭建步驟3安裝IHS軟件

line col jsb eight none data 相關 blog mil 選擇“安裝IBM HTTPServer”選項,點擊“安裝向導”。例如以下圖提示: 安裝提示,逐步點擊“下一步”,當中偶有幾處細節註意就可以。列舉例如以下: (1)、產品安裝路徑與先

Python學習筆記3簡單文件操作

name n) popu 元素 close nes pla () eof # -*- coding: cp936 -*- # 1 打開文件 # open(fileName, mode) # 參數:fileName文件名稱 # mode打開方式 # w

第十六周項目3max帶來的沖突

clu 文件 沖突 include 實例化 post 本地 日期 空間 問題及代碼: /* *Copyright (c)2015,煙臺大學計算機與控制工程學院 *All rights reserved. *文件名:project.cpp *作 者:陳文青 *完畢日

機器學習(3)信息論

clas spa strong nbsp 信息熵 機器 ont 應用 信息 1.信息熵 2.相對熵 3.互信息 4.交叉熵及深度學習的應用 機器學習(3):信息論

解決error: Cannot find libmysqlclient_r under /usr/local/mysql.

support cif cnblogs 處理程序 undle cat note title led 轉 解決:error: Cannot find libmysqlclient_r under /usr/local/mysql. 配置php的時候出現以下問題解決方案 c