473,466 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GCC (Port from Linux to Win32)

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!

Jan 5 '06 #1
9 1751
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

Jan 5 '06 #2
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.com, 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/>
Jan 5 '06 #3
ÓÚ 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();
Jan 5 '06 #4
"Chuck F. " <cb********@yahoo.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_Keith) 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.
Jan 5 '06 #5
Keith Thompson wrote:
"Chuck F. " <cb********@yahoo.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.com, 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/>
Jan 5 '06 #6
"Chuck F. " <cb********@yahoo.com> writes:
Keith Thompson wrote:
"Chuck F. " <cb********@yahoo.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_Keith) 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.
Jan 5 '06 #7
On 4 Jan 2006 21:53:14 -0800, in comp.lang.c , "eeh"
<ee********@yahoo.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 =----
Jan 5 '06 #8
Keith Thompson wrote:
"Chuck F. " <cbfalco...@yahoo.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

30484098515719505171054845301083113645927310171646 573304967293037699688391982
Jan 23 '06 #9
Steve Summit wrote:
Keith Thompson wrote:
"Chuck F. " <cbfalco...@yahoo.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.com, 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/>
Jan 23 '06 #10

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

Similar topics

4
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...
1
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...
13
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...
21
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...
8
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...
1
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
6
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...
12
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...
0
saranjegan
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
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...
0
tracyyun
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.