Creating dll in .c project

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Creating dll in .c project

跳至解决方案
3,005 次查看
admin
Specialist II

Hi,

 

    i've done an ansi c project with codewarrior for powerpc( release 9.2)  that runs on a MPC5200.

My project is diveded in a main.c and several .h and .c.; Now I'd like to create a .dll  or a library to hide some .c of my project.

 

Is there anybody who may give me some hints?

 

 

mario

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,779 次查看
admin
Specialist II

perfect, i removed  the dots and now everything is perfect!

 

thanks CrasyCat

在原帖中查看解决方案

0 项奖励
回复
8 回复数
1,779 次查看
CrasyCat
Specialist III

Hello

 

You need to change the "Project Type" inside of the EPPC Target panel to Library instead of Application.

 

I would also recommend changing the file extension to .a or .lib at that point.

 

CodeWarrior will then create a static library for the project.

 

CrasyCat

0 项奖励
回复
1,779 次查看
admin
Specialist II

Thanks,

 

    but it's not so simple.. i tried to create a new empty project with some  *.c and *.h  files, then i get a   *.a   output file. I put library as output type and i tried to put the right  target settings (the same of my main project).

 

At this point i don't know how to use it in my main project... a simple "add project file" or  "include" doesn't work

0 项奖励
回复
1,779 次查看
CrasyCat
Specialist III

Did you try to add the .a file to your project?

 

This should work.

 

If this is not working can you explain what is the problem.

 

CrasyCat

0 项奖励
回复
1,779 次查看
admin
Specialist II

i' ll try explaining  better:  i've done a project for MPC5200 with  MPC5200quickstart ( a short wizard that allows making application without operative system on this target), then i've done an empty project with a *.c and a *.h. that creates a *.a file as output.

On quickstart project i add the *.a file and everything is builded with no errors. But execution is wrong infact when i call functions inside *.a file i see assembly lines but no effect on the whole application ( as if  a problem of linker settings or memory addressing); the strange is that if instead of using the *.a file i include the *.c file (that will be transfomed into *.a by codewarrior) in quickstart project everithing works perfect.

 

As to me there shold be some settings (linker or others) that could solve the problem...

0 项奖励
回复
1,779 次查看
admin
Specialist II

hi,

 

    i've done progresses, by increasing "small data" field in EPPC Target dialog settings now my library seems to work.

Still one things is missing: i've problem in aritmetical primitive functions, for example "fabs" does not work correctly in my library but it works well in my application. And in my library if i include <stdio.h >  or <math.h> i get a lot of errors while compiling....

 

Any ideas?

 

An idea could be that i created my library by an empty project and not by a template as i made by my application and so i could create a library with the same template used in my application....

0 项奖励
回复
1,779 次查看
admin
Specialist II

Other progresses,

 

    my idea of using the same template i 'used for main application solved everything!

to be sincere one thing still is missing.. When i debug main application debugger try to target to the path where i put my library project ( a dialog rise up). If i press cancel, no problem i see assembly  code and everithing is ok. Only i'd like avoid this path dialog request during debug. Any suggestion?

 

 

0 项奖励
回复
1,779 次查看
CrasyCat
Specialist III

Hello

 

Are you talking about the dialog which asks you for the path to the library source files?

You can define a Source Folder Mapping where you define a correspondence between

Build and debug directory..

 

Look at Debugger -> Source Folder Mapping panel in your project settings dialog..

 

If you do not want to see source code for the library just build them without debug information.

In this purpose in your library .mcp file, make sure there are no dots in the column headed with the green bug,

 

If you have dots there, click on them to remove debug info.

 

CrasyCat

0 项奖励
回复
1,780 次查看
admin
Specialist II

perfect, i removed  the dots and now everything is perfect!

 

thanks CrasyCat

0 项奖励
回复