thia
December 22, 2008, 7:35am
1
hi,
We want to write a random function in C++ language and put into a header file . But the copiler don’t recoginize the C++ language and show us error . I want to know if it eclipse support the C++ language ?
#ifndef AD_ADCHANDLER_H_
#define AD_ADCHANDLER_H_
#include <iostream>
#include <cstdlib>
ascii word[100];
void main(){
srand((unsigned)time(/0));
int random_integer;
random_integer = (rand()%10)+1;
switch(random_integer)
{
case 0 :word[100]="+ADC: 4145,1393,1376\nOK";
break;
case 1 :word[100]="+ADC: 4140,1390,1375\nOK";
break;
case 2 :word[100]="+ADC: 4141,1395,1378\nOK";
break;
case 3 :word[100]="+ADC: 4146,1399,1372\nOK";
break;
case 4 :word[100]="+ADC: 4145,1393,1375\nOK";
break;
case 5 :word[100]="+ADC: 4142,1394,1376\nOK";
break;
case 6 :word[100]="+ADC: 4140,1393,1375\nOK";
break;
case 7 :word[100]="+ADC: 4145,1393,1378\nOK";
break;
case 8 :word[100]="+ADC: 4143,1399,1374\nOK";
break;
case 9 :word[100]="+ADC: 4145,1396,1378\nOK";
break;
}
}
#endif /*AD_ADCHANDLER_H_*/
Is there any document we can get to be a reference for us?
Best Regards,
thia
awneil
December 22, 2008, 7:55am
2
The Open-AT SDK is specifically described and configured as an ANSI ‘C’ environment - not C++
There are plenty of threads on adapting Open-AT for C++ if you want to do it…
Eclipse is a general IDE - it can be configured for many different languages…
But why do you say you need C++
I don’t think there was anything in the code you posted that requires C++ rather than just ANSI ‘C’ - is there?
awneil
December 22, 2008, 8:00am
3
That is impossible.
You cannot write a truly random function in any programming language!
A programming language is a deterministic list of instructions - so it can never give a truly random output!
The best you can get is a pseudo -random output.
awneil
December 22, 2008, 8:59am
4
No, you should certainly not put the function itself into a header file!
Doing that is a sure way to get lots of Linker errors - complaining about multiple definitions of your function(s) for every file that includes your header!
Only the function prototype should go in the header - the function itself should be in a separate source file and/or a library file
See: c-faq.com/decl/decldef.html
awneil
December 23, 2008, 9:49am
5
I’ve just received this in an email newsletter:
12-22-08: THE FUTURE OF ECLIPSE IN EMBEDDED DESIGN
Ten years ago IBM released the Eclipse IDE software framework into the open source domain, but it is only now in a position to become a major player in the embedded software market. Initially introduced as a development framework for traditional IT software development, it is benefiting from a move in the embedded-tool industry from proprietary to open-source architectures, accelerated by the current state of the economy.
Express Logic has joined Wind River, QNX, Enea and others in abandoning the proprietary approach to embedded software development and is moving to Eclipse. Express Logic’s VP of Marketing John Carbone is the author of my Editor’s Best Pick Product How-To article on “Doing embedded design with an Eclipse-based IDE.”
As it slowly gains attention among embedded software developers, the Eclipse IDE is showing up as the design environment in a wide range of applications; virtual prototyping, Java development on mobile devices, software debug, multiprocessor software development, and C/C++ development.
At ESD Digital Edition Promo Box - Embedded.com we are tracking Eclipse’s move into embedded design with design articles on such topics as merging embedded development and system modeling into the same framework, AADL development, Eclipse Europa, extending the CDT managing build system, how to use Eclipse’s Mylar for multitasking, and target management.
Given that Eclipse is a “free” open source environment, its move into the embedded space is likely to accelerate, given the tight economy, and we are planning additional coverage on this topic next year. What kind of articles would you like to see? What articles would you like to write? Tell us about your experiences, pro and con, and how and where you are using it.
(SITE EDITOR BERNARD COLE, ESD MAGAZINE ARTICLES EDITOR, bccole@acm.org )
So, If you want to learn about Eclipse, why not take a look at some of these articles:
–Eclipse: It’s not just for Linux–
You might be surprised how many developers are using Eclipse for OSes other than Linux.
newsletter.embedded.com/cgi-bin4 … rY0G5nQ0E3
–Eclipse framework overshadowing proprietary embedded tools-- The Eclipse Framework is spilling over from its IT origins to become a dominant factor in the embedded space, overshadowing proprietary tool chains.
newsletter.embedded.com/cgi-bin4 … rY0G5nR0E4
–Eclipse extending into embedded, device software – The Eclipse Foundation, as open source community, announced new project initiatives and releases for its Device Software Development Platform and C/C++ Development Tools projects.
newsletter.embedded.com/cgi-bin4 … rY0G5nS0E5
–Closed for business: how open is Eclipse open source?-- The rise of Eclipse has brought questions about its true nature. Is it a savior or a Trojan Horse? A skeptical engineer looks deeply into Eclipse and concludes: buyer beware.
newsletter.embedded.com/cgi-bin4 … rY0G5nT0E6
EDITOR’S TOP PICK by Bernard Cole, Site Editor --PRODUCT HOW-TO: Doing embedded design with an Eclipse-based IDE-- Step-by-step, Express Logic’s John Carbone describes how to use the Ecipse-based BenchX Integrated Development Environment to do embedded systems design.
newsletter.embedded.com/cgi-bin4 … rY0G5aB0Ea
DESIGN ARTICLES: The Eclipse IDE Framework
–Eclipse: Under The hood–
Robert Day of LynxWorks provides an overview of the Eclipse open-source IDE framework that is integral to many embedded systems development tools, roll-your-own, open source, and proprietary.
newsletter.embedded.com/cgi-bin4 … rY0G5nU0E7
–How to use Eclipse for C and C++ development-- Mike McCullough reviews briefly on the history of the Eclipse framework and provides details and perspective on new additions to the Web-based IDE, such as Eclipse Plugin Central (EPIC), Callisto, BIRT, and CDT
newsletter.embedded.com/cgi-bin4 … rY0G5nV0E8
–Eclipse unites the embedded and enterprise environments-- Operating in a “standard” environment lets tool developers support a common set of users and vice-versa.
newsletter.embedded.com/cgi-bin4 … rY0G5nW0EA
–Eclipse Europa: An implementation guide for embedded geeks-- Kim Rowe talks about his experiences doing development with the open source Eclipse platform and how for him the new Europa release resolves a number of issues.
newsletter.embedded.com/cgi-bin4 … rY0G5nc0EM
–Extending the Eclipse CDT Managed Build System-- Eclipse’s managed build system enhances the usability and extensibility for C/C++ developers.
newsletter.embedded.com/cgi-bin4 … rY0G5ne0EO
–Eclipse Mylar: Eclipsing Information Overload-- Mik Kersten examines the problems of software complexity and multitasking and how they lead to information overload for developers–and how Eclipse’s Mylar project tackles these problems.
newsletter.embedded.com/cgi-bin4 … rY0G5nf0EP
–The Eclipse Device Development Platform: Target Management-- Doug Gaff of Wind River reports on the Eclipse Device Software Development Platform Target Management subproject on multiple platforms, multiple targets, multiple processors and multiple cores and threads.
newsletter.embedded.com/cgi-bin4 … rY0G5ng0EQ
–The Eclipse Device Development Platform: Device Debug-- Doug Gaff of Wind River reports on the activities of the Eclipse Device Software Development Platform effort as well as the activities of the subproject on Device Debugging (DD).
newsletter.embedded.com/cgi-bin4 … rY0G5nh0ER
–The Eclipse Device Development Platform: Mobile Java-- Doug Gaff of Wind River reports on the Eclipse.org Device Software Development platform subprojects on Mobile Tools for the Java Platform
(MTJ) and Native GUI Application Builder (NAB).
newsletter.embedded.com/cgi-bin4 … rY0G5ni0ES