Hi,
I am extremely new to write C programs by GCC. I need to port a C
program from GCC(Linux) to GCC(Win32). However, the following errors
during compilation:
powerSwitch.c `random' undeclared (first use this function)
Besides, I cannot find the online library help of GCC for WIN32? Could
anyone give me a web link?
Thanks! 9 1778
eeh wrote: Hi,
I am extremely new to write C programs by GCC. I need to port a C program from GCC(Linux) to GCC(Win32). However, the following errors during compilation:
powerSwitch.c `random' undeclared (first use this function)
random is not a Standard C function, it is a BSD extension and
therefore likely to not exist in the same form on Windows. You may
want to consider using the Standard rand function instead.
Besides, I cannot find the online library help of GCC for WIN32? Could anyone give me a web link?
I see you are posting via Google Groups, I think they Google has some
sort of web search thingy too, might want to try that out.
Robert Gamble
eeh wrote: I am extremely new to write C programs by GCC. I need to port a C program from GCC(Linux) to GCC(Win32). However, the following errors during compilation:
powerSwitch.c `random' undeclared (first use this function)
If you have to specify a compiler and system you are off-topic
here, where we deal with the portable C language as defined by the
appropriate standards.
Your problem is that you are using a non-standard function. There
is no 'random' in C. However, 'rand' does exist.
For a way to simulate the usual functioning of random, see the
C-FAQ at <http://www.eskimo.com/~scs/C-faq/top.html> You should
have read this prior to posting here at any rate.
--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
ÓÚ Wed, 04 Jan 2006 21:53:14 -0800£¬eehдµ½£º Hi,
I am extremely new to write C programs by GCC. I need to port a C program from GCC(Linux) to GCC(Win32). However, the following errors during compilation:
powerSwitch.c `random' undeclared (first use this function)
Besides, I cannot find the online library help of GCC for WIN32? Could anyone give me a web link?
Thanks!
int rand();
"Chuck F. " <cb********@yah oo.com> writes:
[...] For a way to simulate the usual functioning of random, see the C-FAQ at <http://www.eskimo.com/~scs/C-faq/top.html> You should have read this prior to posting here at any rate.
The C FAQ's new home is <http://c-faq.com>. It's also been
significantly updated recently (a Christmas present from Steve
Summit).
--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Keith Thompson wrote: "Chuck F. " <cb********@yah oo.com> writes:
[...] For a way to simulate the usual functioning of random, see the C-FAQ at <http://www.eskimo.com/~scs/C-faq/top.html> You should have read this prior to posting here at any rate.
The C FAQ's new home is <http://c-faq.com>. It's also been significantly updated recently (a Christmas present from Steve Summit).
The copy I have here is marked last modified July 3, 2004. When
there were some announcements around Christmas I went and looked,
and I thought I found that the new version had the same date, so I
didn't download it. I guess I should look again.
--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
"Chuck F. " <cb********@yah oo.com> writes: Keith Thompson wrote: "Chuck F. " <cb********@yah oo.com> writes: [...] For a way to simulate the usual functioning of random, see the C-FAQ at <http://www.eskimo.com/~scs/C-faq/top.html> You should have read this prior to posting here at any rate. The C FAQ's new home is <http://c-faq.com>. It's also been significantly updated recently (a Christmas present from Steve Summit).
The copy I have here is marked last modified July 3, 2004. When there were some announcements around Christmas I went and looked, and I thought I found that the new version had the same date, so I didn't download it. I guess I should look again.
Before December 25, the web version of the FAQ hadn't been updated in
several years. It now appears to be up to date (and reformatted). I
haven't (yet) looked at the other versions, such as the text version.
--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
On 4 Jan 2006 21:53:14 -0800, in comp.lang.c , "eeh"
<ee********@yah oo.com.hk> wrote: powerSwitch. c `random' undeclared (first use this function)
this is a nonstandard function, you should find it in one of the gcc
libs. "man random" may help.
Besides, I cannot find the online library help of GCC for WIN32? Could anyone give me a web link?
gcc is multiplatform, if you have a win32 implementation with full
libs (such as the Cygwin one) you can simply rebuild and it'll work,
provided it doesn't use anything heavily dependent on the unix
filesystem or security model.
For further info, try a gcc group.
Mark McIntyre
--
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Keith Thompson wrote: "Chuck F. " <cbfalco...@yah oo.com> writes: Keith Thompson wrote: The C FAQ's new home is <http://c-faq.com>. It's also been significantly updated recently (a Christmas present from Steve Summit).
The copy I have here is marked last modified July 3, 2004. When there were some announcements around Christmas I went and looked, and I thought I found that the new version had the same date, so I didn't download it. I guess I should look again.
Before December 25, the web version of the FAQ hadn't been updated in several years. It now appears to be up to date (and reformatted).
Here's the scoop:
Back when I did the book version, I expanded the base of material
about threefold. Some of the new book material also went back into
the plain-text Usenet version. Also, that was the birth of the
webified HTML version, which contained more or less the same text
as the Usenet version, with a few additions.
Since then, I've made various levels of corrections and additions
and improvements, although until recently I didn't manage to,
like, actually publicly *post* much of the new material or
anything. The Usenet version saw a few, sporadic, significant
improvements, but except for a couple of patches the web version
remained mired in its nineteen-ninety-I'm-embarrassed-to-say
state.
But, finally, as of July 2004 the Usenet version is up-to-date
with all the corrections and samples of new material I felt it
needed, and as of Christmas, the web version is up-to-date with
*everything*. (Well, everything contentwise, anyway; the HTML
formatting unfortunately still needs some work.) In particular,
the web version at http://c-faq.com now contains all the text
from the book, plus new material that doesn't even appear in the
book. So anywhere it still says "the book version contains 2-3
times as much material as the on-line versions" is now wrong.
Unfortunately, generating any of these versions from the master
manuscripts is never as trivial and automatic as it's supposed
to be. I need to run off a new version of the plain-text,
posted-to-Usenet version again, although the changes since
July '04 that would affect it are (so far) still slight.
Steve Summit sc*@eskimo.com
304840985157195 051710548453010 831136459273101 716465733049672 930376996883919 82
Steve Summit wrote: Keith Thompson wrote: "Chuck F. " <cbfalco...@yah oo.com> writes: Keith Thompson wrote: The C FAQ's new home is <http://c-faq.com>. It's also been significantly updated recently (a Christmas present from Steve Summit).
The copy I have here is marked last modified July 3, 2004. When there were some announcements around Christmas I went and looked, and I thought I found that the new version had the same date, so I didn't download it. I guess I should look again. Before December 25, the web version of the FAQ hadn't been updated in several years. It now appears to be up to date (and reformatted).
Here's the scoop:
.... snip ... Unfortunately, generating any of these versions from the master manuscripts is never as trivial and automatic as it's supposed to be. I need to run off a new version of the plain-text, posted-to-Usenet version again, although the changes since July '04 that would affect it are (so far) still slight.
I keep the text version here for quick and easy offline access, so
all I am really interested in is when that is updated, and where is
it. It is actually fairly awkward to find from c-faq.com.
--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jhuola Hoptire |
last post by:
Just installed J2RE 1.4.2 on a Linux server. I am very
knew to the POSIX world.
I couldn't dig-up much in the docs or via google about
the following:
1 - Is there a standard way to make sure users (all, or
some) can "reach" java? eg one could presumably create
a java.sh or aliases ... Where is the standard Linux
directory to put such a script (and why)?
|
by: Vio |
last post by:
My story: I played with a little embedded python
piece of code (python interpreter embedded in wxWidgets app),
and used SWIG to extend this embedded py interpreter.
I did it in Linux, after some ironing all builds and runs as expected.
On a particularily lazy day, I pasted these same wrapper sources to
Win32 (cygnus). After fiddling with the Makefile to point in the right
directions, compilation seems to go ok (give or take a couple of...
|
by: Adam |
last post by:
Hi! I'm trying to write a small application for an online gaming site
(flight sims), where people can add their local server to a list.
Basically, I just need to be able to loop/ping each respective server
- via a specific port (2934 or 2935) to see whether the server is
still "live", so the hosters don't have to manually update their
status on the site.
Everything I've seen seems overly complex. Efforts so far have
returned info via...
|
by: The Man With The Harmonica |
last post by:
Hi All,
What kind of commands can I use to control the serial and parallel port of
my pc. I want to use my laptop instead of microcontrollers and write my
software in ANSI C to be used for control purposes of sensors and other
electronic devices.
I haven't done any C for a while now so I would assume my knowledge is that
of a beginner now.
|
by: nobody |
last post by:
To begin with I am not sure this is a correct place to post this, if not
please let me know.
The PostgreSQL traditionally refuses to run under root account on Unix (for
security reasons). On win32 the situation is the same (it will not run if
run under user belonging to administrator group).
In my opinion this should not be the case on win32 as developers are likely
to belong to the administrators group and might like to run the database...
| |
by: Yannick Warnier |
last post by:
Hi,
I thought I read somewhere there was now a native port for Windows for
PostgreSQL...
Am I wrong? If not, where may I find it to download right away?
Thanks,
Yannick
|
by: Casey Bralla |
last post by:
I'd like to read ASCII data from a serial port, but (once again) I'm having
trouble getting started. (Can't seem to find the basic level of docs to
get going <sigh>)
I'd like to use only standard "built-in" modules if possible.
Could somebody offer a simple code-snippet to get me started reading from a
serial port?
Thanks!
|
by: david.brown.0 |
last post by:
I'm trying to make a Java program access a parallel port. Java's comm
API does not provide me with the control I need. I need to be able to
write to the data and control pins and read the status pins. Any Java
people know a good solution? I'm trying to use JNI and create my own
library, but building the library gives me these errors:
ld: warning: cannot find entry symbol _start; defaulting to
0000000008048094
ParallelPort.o: In...
|
by: saranjegan |
last post by:
Hello,
Am using win32::serial port module to communicate with my serial port, from
CPAN
i found that communication is done through file handle by tie with configuration file, i need to know about configuration file , how to use it ? it will be great if you give a clear explanation about it , thanks for your time
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |