f



creation of .lib from C or C++ code

Hi,

I want to create lib file from my C / C++ code independent of compiler and
uC platform. 

My aim is to create lib files for easy usuability by others without giving
my code to them

Can anyone help on this?


0
pdesai (3)
4/16/2009 11:48:46 AM
comp.arch.embedded 20047 articles. 1 followers. Post Follow

11 Replies
387 Views

Similar Articles

[PageSpeed] 29

pritiselec wrote:
> I want to create lib file from my C / C++ code independent of compiler and
> uC platform. 

Dream on.  There's no such thing.
0
HBBroeker (925)
4/16/2009 9:36:32 PM
On Thu, 16 Apr 2009, Hans-Bernhard Br?ker wrote:
> pritiselec wrote:
>> I want to create lib file from my C / C++ code independent of compiler and
>> uC platform. 
>
> Dream on.  There's no such thing.
>

Actually,

Once upon a time, there was the Architecturally Neutral Distribution 
Format (ANDF) ...

 	http://www.info.uni-karlsruhe.de/~andf/index.htm
 	http://en.wikipedia.org/wiki/Architecture_Neutral_Distribution_Format

But that was never designed for SoC's .... (nor did it find a commercial 
footing). Still, something like the old p-System interpreter, or the 
USCD-Pascal interpreter ... I suppose taken to its logical conclusion, 
might be Java/.jar -- still, not for SoC's.

I suppose the OP could simply write in Forth, and then not worry about 
giving away the source, since it comes pre-obfuscated (or so I've heard 
8-).

Cheers,
Rob.
0
Spam159 (460)
4/16/2009 10:01:34 PM
On 2009-04-16, pritiselec <pdesai@selec.com> wrote:

> I want to create lib file from my C / C++ code independent of
> compiler and uC platform. 

No such thing.

> My aim is to create lib files for easy usuability by others
> without giving my code to them

No such thing.

This may sound a bit blunt, but if you're asking questions like
this then I doubt your code will be of use to anybody.

-- 
Grant Edwards                   grante             Yow! I'll eat ANYTHING
                                  at               that's BRIGHT BLUE!!
                               visi.com            
0
grante (5416)
4/16/2009 10:03:09 PM
>On 2009-04-16, pritiselec <pdesai@selec.com> wrote:
>
>> I want to create lib file from my C / C++ code independent of
>> compiler and uC platform. 
>
>No such thing.
>
>> My aim is to create lib files for easy usuability by others
>> without giving my code to them
>
>No such thing.
>
>This may sound a bit blunt, but if you're asking questions like
>this then I doubt your code will be of use to anybody.
>
>-- 
>Grant Edwards                   grante             Yow! I'll eat
ANYTHING
>                                  at               that's BRIGHT BLUE!!
>                               visi.com            
>

Dear Mr.Edwards,

I believe this can be possible to have - if we can have standard library
functions for C or C++ functions which can be used for any targets - I
should be able to create for others too. One should not reinvent the
software once it is done by one person already.

Regards,
Priti
0
pdesai (3)
4/17/2009 11:44:26 AM
pritiselec schrieb:

> I believe this can be possible to have - if we can have standard library
> functions for C or C++ functions which can be used for any targets - I
> should be able to create for others too. One should not reinvent the
> software once it is done by one person already.

All libraries (even the stdlib) are highly target and compiler 
dependant. C is not Java. Use Java, and you have what you want - at the 
price of using a virtual machine environment.

-- 
Mit freundlichen Gr��en

Frank-Christian Kr�gel
0
dontmailme2 (165)
4/17/2009 12:05:12 PM
In article <G6CdndW1tOMH9nXUnZ2dnUVZ_jGdnZ2d@giganews.com>, 
pdesai@selec.com says...
> >On 2009-04-16, pritiselec <pdesai@selec.com> wrote:
> >
> >> I want to create lib file from my C / C++ code independent of
> >> compiler and uC platform. 
> >
> >No such thing.
> >
> >> My aim is to create lib files for easy usuability by others
> >> without giving my code to them
> >
> >No such thing.
> >
> >This may sound a bit blunt, but if you're asking questions like
> >this then I doubt your code will be of use to anybody.
> >
> >-- 
> >Grant Edwards                   grante             Yow! I'll eat
> ANYTHING
> >                                  at               that's BRIGHT BLUE!!
> >                               visi.com            
> >
> 
> Dear Mr.Edwards,
> 
> I believe this can be possible to have - if we can have standard library
> functions for C or C++ functions which can be used for any targets

As SOURCE code within some constraints yes. 

As Source code for ANY compiler/linker, ANY host platform, ANY target - 
NO!

You HAVE to provide the source to be ported to the host/compiler/target 
implementation.

> - I
> should be able to create for others too. One should not reinvent the
> software once it is done by one person already.

Sorry NOBODY supplies a compiled library that is byte by byte identical 
for ANY complier/linker (different library formats, byte order, etc..),
any host (file formats etc..), or ANY target (different instruction codes
widths and lengths..).

You do not understand what you are trying to achieve.
 
> Regards,
> Priti

-- 
Paul Carpenter          | paul@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/>    PC Services
<http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
<http://www.gnuh8.org.uk/>  GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
<http://www.badweb.org.uk/> For those web sites you hate
0
paul1079 (318)
4/17/2009 12:23:53 PM
On 2009-04-17, pritiselec <pdesai@selec.com> wrote:

> I believe this can be possible to have - if we can have
> standard library functions for C or C++ functions which can be
> used for any targets - I should be able to create for others
> too.

Then go ahead and do it.  Prove me wrong.

> One should not reinvent the software once it is done by one
> person already.

Huh?

You don't seem to understand that:

 * Different processors use different, incompatible
   instruction sets.

 * Different processors use different, incompatible data
   representations.    

 * Different toolchains use different, incompatible APIs.

 * Different toolchains use different, incompatible object file
   formats.

Creating a single object library that can be used across
incompatible ISAs and data representations, across different,
incompatible toolchains is simply not possible.
 
-- 
Grant Edwards                   grante             Yow! HUGH BEAUMONT died
                                  at               in 1982!!
                               visi.com            
0
grante (5416)
4/17/2009 12:29:35 PM
pritiselec wrote:
>> On 2009-04-16, pritiselec <pdesai@selec.com> wrote:
>>
>>> I want to create lib file from my C / C++ code independent of
>>> compiler and uC platform. 
>> No such thing.
>>
>>> My aim is to create lib files for easy usuability by others
>>> without giving my code to them
>> No such thing.
>>
>> This may sound a bit blunt, but if you're asking questions like
>> this then I doubt your code will be of use to anybody.
>>
>> -- 
>> Grant Edwards                   grante             Yow! I'll eat
> ANYTHING
>>                                  at               that's BRIGHT BLUE!!
>>                               visi.com            
>>
> 
> Dear Mr.Edwards,
> 
> I believe this can be possible to have - if we can have standard library
> functions for C or C++ functions which can be used for any targets - I
> should be able to create for others too. One should not reinvent the
> software once it is done by one person already.
> 
> Regards,
> Priti
It may be called the Standard Library, but but the code to achieve it is 
   compiled (or assembled) custom for toolset.
0
NeilKurzm (321)
4/18/2009 5:49:32 PM
On Thu, 16 Apr 2009 06:48:46 -0500, "pritiselec" <pdesai@selec.com>
wrote:

>Hi,
>
>I want to create lib file from my C / C++ code independent of compiler and
>uC platform. 

This is certainly possible, if you deliver the libraries as C source
files and your program startup routine contains a C-interpreter to
execute the functions. 

However, the users might not like the program startup delay :-).
  
>My aim is to create lib files for easy usuability by others without giving
>my code to them

This is definitively the hardest part, since you would have to include
the compiler/interpreter in your program distribution and some
disassembly would easily reveal the encryption (if any) used.

Paul

0
keinanen (1068)
4/18/2009 6:07:56 PM
On Apr 18, 11:07=A0am, Paul Keinanen <keina...@sci.fi> wrote:
> On Thu, 16 Apr 2009 06:48:46 -0500, "pritiselec" <pde...@selec.com>
> wrote:
>
> >Hi,
>
> >I want to create lib file from my C / C++ code independent of compiler a=
nd
> >uC platform.

To assure quality, you have to test your code in every hardware
platform for every micro.

>
> This is certainly possible, if you deliver the libraries as C source
> files and your program startup routine contains a C-interpreter to
> execute the functions.

That would defeat the OP's purpose of closing the "open source".

>
> However, the users might not like the program startup delay :-).
>
> >My aim is to create lib files for easy usuability by others without givi=
ng
> >my code to them
>
> This is definitively the hardest part, since you would have to include
> the compiler/interpreter in your program distribution and some
> disassembly would easily reveal the encryption (if any) used.

The hardest part is to get anyone to trust and use his code.
0
me5463 (1321)
4/18/2009 7:43:22 PM
On Thu, 16 Apr 2009 06:48:46 -0500, pritiselec wrote:

> Hi,
> 
> I want to create lib file from my C / C++ code independent of compiler
> and uC platform.
> 
> My aim is to create lib files for easy usuability by others without
> giving my code to them

This reminds me of a lady that looked at a well-toned young woman and
said: "I would do anything to have a body like that. Except diet and
exercise".

Yes, you can create code libraries that are easy and useful to others,
independent of the architecture/OS/compiler/etc, if you will publish 
the source code. Note that if you are truly the original author, you
can put any copyright on them, including restrictive, commercial licensing
requiring payments to you.




-- 
		Przemek Klosowski, Ph.D. <przemek.klosowski at gmail>
0
4/19/2009 10:52:26 PM
Reply:

Similar Artilces:

convert c# code to c++/c
hi people, Im stuck with a problem. I want to convert the following C# code to c++/c im trying to convert it line by line by myself. but still cant do away with some errors.. kindly help here is my code.. Imports System.Net Imports System.Net.Sockets Imports System.IO Public Class Form1 Private Client As New UdpClient(4370) 'Local machine uses UDP and port 4370 Private ZkDevice As New IPEndPoint(IPAddress.Parse("192.168.1.201"), 4370) 'Address of Device and port Private SessionID As UInt16 'ID of session. Each session have a unique ID ...

jython and C-c C-c
How do I get C-c C-c to work with jython? I have the jpython command set to jython, and I can start the interpreter with C-C ! and then use C-c C-c, but this is rather frustrating. If I try to use C-c C-c without first starting the interpreter in another window I get wrong type argument: sequencep, jpython Thanks, Dave Cook ...

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta >...

AVI Creation C/C++ code
Hi all, I am looking for a Sample code in C/C++ for Creating .AVI file using Series of Bitmaps and PCM audio Samples. The code should be platform Independent and should not use libraries like VFW etc and can be easily ported across multiple platforms. Please suggest. Thanks in Advance rashmipandit@sify.com wrote: > Hi all, > > I am looking for a Sample code in C/C++ for Creating .AVI file using > Series of Bitmaps and PCM audio Samples. The code should be platform > Independent and should not use libraries like VFW etc and can be > easily ported across multiple platforms....

including c libs in c++ code?
Hi I am trying to compile a cpp ap that runs on the system tray and checks recently open files with clamav. i am getting a whole bunch of undefined erros. can i link this library to a cpp program? do i need any special confiure options?. i tried removing pthread and other libraries and the results are similar. or should i write a small lib that checks buffers and just use my lib with extern? thanks for the advice. the code looks like this extern "C" { #include "clamav.h" int cl_loaddbdir(const char *dirname, struct cl_node **root, int *virnum); } compiled with redi...

C++ implementation for C API ---- converting legacy C code to C++
[My apologies if this LONG posting is off-topic] In this day and age, you never say no to any work that is thrown at you ---- so when I was offered this short-term contract to convert legacy C code to C++, I did not say no. Personally I believed that it was a somewhat futile exercise since one of the main requirements was for the existing API (a functional interface written in C) to remain the same. I would have much rathered that the mandate be ab-initio, but that was not the case here. My client had a bad experience with OO, and they wanted to re-tread this path very very carefully. The...

C++ code with C-style interface for a library to be used in C++ and C?
Hi! I have a question about building and then using libraries containing C++ code. Let's say I have some C++ code and a .cpp file with 1 function that uses some other C++ code / classes etc... Also, any possible exception is handled within the function itself. In code: MyModule.h ---------- #ifndef MYMODULE_H #define MYMODULE_H extern int Test(float inParam1,float inParam2,float* outResult); #endif // #ifndef MYMODULE_H MyModule.cpp ------------ #include "MyModule.h" #include "MyClasses.h" // contains MyClassA and MyClassB int Test(float inParam1,float inParam2,...

embedding assembly code in c/c++ project
Hello everyone, I'm trying to put in some watchdog code in my application and I'm having trouble embedding the assembly into the code. The sample code that came with the single board computer is written for the Borland C++ compiler. Does anyone have any sample code, or a link to some sample code that shows the syntax for embedding assembly code into the QNX compiler. Thanks in advance, Phil Why bother with assembly? Should be fairly simple to rewrite in C. "Phil" <felipe.marcelino@sippican.com> wrote in message news:celr53$sco$1@inn.qnx.co...

How to do this in C++ (C code)
in C, I have this : #define doStuff(var) func(var##_1, var##_2) void func(int v, int v2) { printf("%d, %d\n", v, v2); } int main() { int myvar_1 = 1; int myvar_2 = 2; doStuff(myvar); // ... } I want to do a class to encapsulate the func, but how can I do the same thing with a class ? I would like to do something like this : int myvar_1 = 1; int myvar_2 = 2; CMyClass c; c.doStuff(myvar); How can I do that ? Thanks for your help, S. timor.super@gmail.com wrote: > in C, I have this : > > #define doStuff(var) func(var##_1, var##_2) > > void func(int v, int...

Any C code are valid C++ code?
Since C is a subset of C++, so any C code or C libraries (printf(), scanf(), etc...) are valid C++ code. Is that correct? so even though the whole program is written in C, but with .cpp extension, we still consider as C++ program? Please advise. Thanks jrefactors@hotmail.com wrote: > Since C is a subset of C++ [...] Wrong premise. Wrong conclusion. The answer to your subj is "no". jrefactors@hotmail.com wrote: > Since C is a subset of C++ C is not a subset of C++. C++ has some incompatible changes from C. However, they are compatible enough that a lot of code runs in ...

c------->c++ and c++------>c
We can write c program in turbo c++ editor.But reverse is not true why? i.e The program will not compile if u write c++ program in turbo c editor vim wrote: > We can write c program in turbo c++ editor.But reverse is not true why? > i.e The program will not compile if u write c++ program in turbo c > editor This isn't about C; this is about some editor. Why the fircone should /we/ know? Ask in a relevant group. [And /why/, in an editor specialised to some specific programming languages, would you expect it to compile a /different/ one? Would you expect turbo perl to compi...

slime C-c C-c annoyance
Does anyone have a good workaround for this problem other than: just be careful! When I've compiled a large package and slime has given me a *slime-compilation* buffer, I like to work through this buffer issue by issue, fixing the errors, warnings, etc. But If I ever press C-c C-c in the editor window while fixing an error, slime destroys the *(slime-compilation* buffer with the compilation output of C-c C-c. Jim Newton <jimka.issy@gmail.com> writes: > Does anyone have a good workaround for this problem other than: just be careful! > > When I've compiled a ...

C/C++ in MATALB or MATLAB in C/C++?
Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

C as a Subset of C++ (or C++ as a superset of C)
Isn't it a lame use of human time and effort to maintain completely separate C and C++ standards? As in the words of Betty White about Facebook: "It seems like an incredible waste of time". Why don't the two standards groups get together and agree on a common specification for the ground which both standards cover? There would still be two separate standards, but they'd both be exactly the same for the common ground. The common ground document could be referred to by both standards instead of being maintained by both groups in individual efforts resulting in...

Web resources about - creation of .lib from C or C++ code - comp.arch.embedded

Institute for Creation Research - Wikipedia, the free encyclopedia
The Institute for Creation Research (ICR) is a Christian apologetics institute in Dallas , Texas that specializes in education, research, and ...

Curtin University meteorite discovery could hold clues to solar system creation
It doesn't look like much, but a 1.7 kilogram rock discovered by a team from Curtin University on New Year's Eve could help solve the mystery ...

Patrice Washington on bankruptcy, finance and wealth creation
PATRICE Washington found herself $US2million ($A2.74 million) in debt in 2007 as the American subprime mortgage market started to crumble.

Adobe Voice Video Creation App Launches on iPhone
Following its release on iPad in 2014, Adobe has launched its Adobe Voice app on iPhone. The app allows users to create animated videos by recording ...

D&D 5e opens up, lets adventurers sell creations in print and online
... time building adventures and characters for the fifth edition of Dungeons & Dragons , you might be able to make a little money from your creations ...

10 cities winning and losing with job creation
When it comes to adding employment, some metro areas are feeling the stronger economy, while others are missing it

Gigafactory Ahead Of Schedule, Behind On Job Creation? Spoiler: Nope!
... as a surprise to many, as one of the consistent themes with Tesla is a tendency to [&hellip Gigafactory Ahead Of Schedule, Behind On Job Creation? ...

WHOA! Job creation surges in December
The U.S. economy closed out 2015 with a huge round of job creation.

How Apple's New Music Memos App, GarageBand Updates Aid Song Creation
Music Memos lets songwriters quickly capture their latest song ideas, while GarageBand provides a virtual drummer, instrument loops and more. ...

How Nexo Knights Became Lego's Latest Blockbuster Original Creation
Take a look behind the brand's new future tech-meets-Medieval Times toys, cartoon, and digital app. Our story begins in the Kingdom of Knighton ...

Resources last updated: 2/6/2016 10:57:03 PM