473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Mix different C source files into a single one

Hi,

I have a C program split into different source files. I am trying a
new compiler and for some reason it only accepts a single source file.
So I need to "mix" all my different C source files into a single one.

Do you know about some program able to do this kind of task ?

Thanks
Dec 29 '07 #1
5 1442

"Horacius ReX" <ho**********@gmail.comwrote in message
I have a C program split into different source files. I am trying a
new compiler and for some reason it only accepts a single source file.
So I need to "mix" all my different C source files into a single one.

Do you know about some program able to do this kind of task ?
I do not believe this for one minute. Try compiling to object files and then
linking by hand.

However, on the offchance that you are correct, set up a file named main.c
which consists of

#include "file1.c"
#include "file2.c"
#include "file3.c"

and invoke the compiler on it. You might have to resolve some static
namespace clashes.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 29 '07 #2
On Dec 29, 10:03 am, Horacius ReX <horacius....@gmail.comwrote:
Hi,

I have a C program split into different source files. I am trying a
new compiler and for some reason it only accepts a single source file.
So I need to "mix" all my different C source files into a single one.

Do you know about some program able to do this kind of task ?

Thanks
Which compiler? Which platform?

Regards,
Ivan Novick
http://www.0x4849.net
Dec 29 '07 #3
Horacius ReX wrote:
>
I have a C program split into different source files. I am trying a
new compiler and for some reason it only accepts a single source file.
So I need to "mix" all my different C source files into a single one.

Do you know about some program able to do this kind of task ?
I think you should dump that 'new compiler' very quickly. If it
can't handle a #include statement, it does not come anywhere near
meeting any standard. I shudder to think what else is missing.

--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee, Frohe Weihnachten
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Dec 30 '07 #4

"CBFalconer" <cb********@yahoo.comwrote in message
I think you should dump that 'new compiler' very quickly. If it
can't handle a #include statement, it does not come anywhere near
meeting any standard. I shudder to think what else is missing.
Sometimes the compiler is split from the preprocessor. This is permitted,
though a preprocessor should exist.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 30 '07 #5
Horacius ReX wrote:
I have a C program split into different source files. I am trying a
new compiler and for some reason it only accepts a single source file.
So I need to "mix" all my different C source files into a single one.

Do you know about some program able to do this kind of task ?
Are you using the CCS compiler for PIC microcontrollers? That does indeed
want everything compiled together. You can do this by having a main file
#include other code modules.

Note that CCS is pretty far from Standard C. You _can_ mostly program in a
subset of C, but beware the non-standard features of the compiler.

--
Thad
Dec 30 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Edvard Majakari | last post by:
Hi all ya unit-testing experts there :) Code I'm working on has to parse large and complex files and detect equally complex and large amount of errors before the contents of the file is fed to...
7
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file...
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
11
by: Roy | last post by:
Hi , could you please list the reasons why we different C files for writing code . We use header files to logically group functionality that is related . Is there any other reason why we need...
2
by: dolphin | last post by:
What is the different between c++ call convention and c call convention?Can some give some examples?
0
by: tomPee | last post by:
Hi, I have no idea if this is the right section to post this in. But i thought it maybe belonged here most. The problem i having is actually, most likely really simple. But here i am running...
4
by: Horacius ReX | last post by:
Hi, I have a C program split into different source files. I am trying a new compiler and for some reason it only accepts a single source file. So I need to "mix" all my different C source files...
0
by: Sells, Fred | last post by:
the short answer is a file is a module; therefore to 'include' access to 'myclass' in file xyz.py from another file called 'abc.py' you would put this in abc.py import xyz #note no '.py' x =...
7
by: JoeC | last post by:
I am trying to create a windows program that reads binary graphics as a resource. This has nothing to do with win32 but conversion of data with memcpy. graphic::graphic(UINT uiResID, HINSTANCE...
5
by: Christopher Brewster | last post by:
I am running the same script on the same data on two different machines (the folder is synchronised with Dropbox). I get two different results. All the script does is count words in different...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.