會員登陸
帳號:

密碼:

記住我



忘記密碼?

現在註冊!
網站導航
最新下載
訪問統計 (自2012/5/3)


正在流覽:   1 名訪客





請問C如何轉成Library保護原始碼?
高級會員
註冊日期:
2012/07/05 18:22
所屬群組:
註冊會員
文章: 118
等級: 9; EXP: 89
HP : 0 / 222
MP : 39 / 3445
離線
您好!
請問C程式中我們有個檔案會呼叫Table表,裡面有重要的參數,我們不想讓客戶端知道,我所知道有個方式可以轉成P1及lpp方式,不過我是初學者使用MPLAB X開發環境還不熟,教學方法那邊可以找的到?

1月13日 11:00:20
_________________
專職:馬達自動控制.雜訊對策與解析
Skype:buymoney
轉換PDF檔 列印


Re: 請問C如何轉成Library保護原始碼?
版主
註冊日期:
2004/04/30 10:53
來自 CAE, Microchip
所屬群組:
站務管理者
註冊會員
MICROCHIP
文章: 14128
等級: 72; EXP: 47
HP : 1072 / 1786
MP : 4709 / 70405
離線
所提及的是 XC8 的轉法。我比較熟悉且使用的是 C18 的方法,在教材 "TLS2118T v2.0 Getting Started with MPLAB C18 " 裡的第二章裡有詳細的範例。

相信 XC8 也會有提供此功能,我找一下 XC8 的使用手冊,再回覆。

1月13日 11:17:33
轉換PDF檔 列印


Re: 請問C如何轉成Library保護原始碼?
版主
註冊日期:
2004/04/30 10:53
來自 CAE, Microchip
所屬群組:
站務管理者
註冊會員
MICROCHIP
文章: 14128
等級: 72; EXP: 47
HP : 1072 / 1786
MP : 4709 / 70405
離線
XC8 使用手冊:

3.3.6 How
Do I Build Libraries?
Note that XC8 uses a different code generation framework (OCG) that uses additional
library files to those used by traditional compilers
(including XC16 and XC32). See
Section 4.3.1 “The Compiler Applications”
, for general information on the library types
available
and how they fit into the compilation process.
When you have functions and data that are commonly used in applications, you can
either make all the C source
and header files available so that other developers can
copy these into their projects
. Alternatively you can bundle these source files up into a
library which
, along with the accompanying header files, can be linked into a project.
Libraries are more convenient because there are fewer files to deal with. Compiling
code from a library can also be fractionally faster
. However, libraries do need to be
maintained
. XC8 must use LPP libraries for library routines written in C; the old-style
LIB libraries are used
for library routines written in assembly source. It is recommended
that even these libraries be rebuilt
if your project is moving to a new compiler version.
Using the compiler driver, libraries can be built by listing all of the files that are to be
included into the library on the command line
. None of these files should contain a
main
() function, nor settings for Configuration bits or any other such data. Use the
--OUTPUT=lpp option; see Section 4.8.48 “--OUTPUT= type: Specify Output File
Type”
, to indicate that a library file is required. For example:
XC8 --chip=16f877a --output=lpp lcd.c utils.c io.c
creates a library file called lcd
.lpp. You can specify another name using the -O
option
; see Section 4.8.9 “-O: Specify Output File”, or just rename the file.



3.6.18 How
Do I Use Library Files in My Project?
See Section 3.3.6 “How Do I Build Libraries?for information on how you build your
own library files
. The compiler will automatically include any applicable standard library
into the build process when you compile
, so you never need to control these files.
To use one or more library files that were built by yourself or a colleague, include them
in the
list of files being compiled on the command line. The library files can be specified
in any position in the file
list relative to the source files, but if there is more than one
library file
, they will be searched in the order specified in the command line. The LPP
libraries
do not need to be specified if you are compiling to an intermediate file, i.e.,
using the --PASS1 option (see Section 4.8.50 “--PASS1: Compile to P-code”). For
example:
xc8 --chip=16f1937 main.c int.c lcd.lpp
If you are using MPLAB X IDE to build a project, add the library file(s) to the Libraries
folder that will shown in your project
, in the order in which they should be searched. The
IDE will ensure that they are passed to the compiler at the appropriate point in the build
sequence
.


方法如上,需以命列列方式。我沒試過不知行不行。

1月13日 11:27:21
轉換PDF檔 列印






無法在此發表文章
可以在此觀看文章
無法回覆文章
無法編輯自己的文章
無法刪除自己的文章
無法發起投票調查
無法在此投票
無法上傳附加檔案
無法不經審核直接發表文章

[進階搜尋]


搜尋
線上教學影片
網頁捷徑
2017 Summer Elite 報名
教育訓練
其它網站連結
電話: 02-25000405
產品技術問題產品技術支援專線:0800-717718 台北02-25088600 新竹03-5778366 Ext. 8600 高雄07-2137830 MicrochipDIRECT 專線: 07-2137830
Powered by XOOPS © 2001-2012 The XOOPS Project