Discussion:
Multiple source files in LCC-win
Add Reply
Peabody
2017-04-07 13:45:39 UTC
Reply
Permalink
Raw Message
I'm new to this, and have written exactly one C program that does something
useful. I use LCC. I have the source code for a TI program called BSLDEMO2
that's used to flash firmware to their MSP430 chips, and I need to modify it
to invert the polarity of the serial DTR line. I suspect this will require
changing one statement.

The source was written for Visual Studio, and consists of four .C files and
five .H files. The problem is - I don't know how to compile multiple source
files into an executable in LCC. I know this should be simple and obvious,
but I can't find it.

Can someone point me to a tutorial that explains in detail how to do this?

Thanks very much for any help.

By the way, I assume that code written for Visual Studio may not compile on
LCC, but I need to know about multiple source files anyway.
jacobnavia
2017-04-07 13:57:36 UTC
Reply
Permalink
Raw Message
Post by Peabody
I'm new to this, and have written exactly one C program that does something
useful. I use LCC. I have the source code for a TI program called BSLDEMO2
that's used to flash firmware to their MSP430 chips, and I need to modify it
to invert the polarity of the serial DTR line. I suspect this will require
changing one statement.
The source was written for Visual Studio, and consists of four .C files and
five .H files. The problem is - I don't know how to compile multiple source
files into an executable in LCC. I know this should be simple and obvious,
but I can't find it.
Can someone point me to a tutorial that explains in detail how to do this?
Thanks very much for any help.
By the way, I assume that code written for Visual Studio may not compile on
LCC, but I need to know about multiple source files anyway.
In lcc win create a new project and add the files to your project. Leave
all the default options as they are.

When the editor asks You want the wizard? answer no.

You can also add files in the wedit IDE by using the project§>add/delete
files in the menu.

From the command line just do

lc64 *.c
or
lc64 file1.c file2.c file3.c file4.c

if you want 64 bit executables.

For 32 bit executables use lc instead of lc64
Peabody
2017-04-07 21:22:21 UTC
Reply
Permalink
Raw Message
jacobnavia says...
Post by jacobnavia
In lcc win create a new project and add the files to
your project. Leave all the default options as they are.
I'm using LCC-Win32. When you say "add the files to your
project" is that in the creation process under the Link tab
where it says additional files to be added to the link?
Also, do I just add the C files, or the H files too? The H
files all appear to be in #includes in the C files. And in
fact one C file #includes another C file as well.
Post by jacobnavia
You can also add files in the wedit IDE by using the
project§>add/delete files in the menu.
This would be after the project has been created? And
again, just the C files or all of them?

Thanks very much for your help.

Oh, and what do I click on to compile into an exe? For one
C file I just clicked on Make. Is that the same for
multiple C's, or is it more complicated?
Peabody
2017-04-08 12:10:16 UTC
Reply
Permalink
Raw Message
Peabody says...
Post by Peabody
jacobnavia says...
Post by jacobnavia
In lcc win create a new project and add the files to
your project. Leave all the default options as they are.
I'm using LCC-Win32. When you say "add the files to your
project" is that in the creation process under the Link tab
where it says additional files to be added to the link?
Also, do I just add the C files, or the H files too? The H
files all appear to be in #includes in the C files. And in
fact one C file #includes another C file as well.
Post by jacobnavia
You can also add files in the wedit IDE by using the
project§>add/delete files in the menu.
This would be after the project has been created? And
again, just the C files or all of them?
Thanks very much for your help.
Oh, and what do I click on to compile into an exe? For one
C file I just clicked on Make. Is that the same for
multiple C's, or is it more complicated?
OK, I figured it out. In add/delete files under Project I added only C files
not otherwise #included, and then just clicked on Make and it seemed to find
everything. I have one error that I'll ask about in another thread.

Thanks again for your help.

Loading...