If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

random() and srandom() unresolved links

Hi all
I'm writing a software to be compiled and run on C++ BuilderX. I'm using the standard random generators functions random() and srandom() in my program.here is how I declare these using precompiler directives to support cross-platform behavior:

Well, we can't guess what's going on in lines 216 and 379 without seeing them...
Anyway, try to see if there's a macro masking problem which causes these functions to be replaced by macros. You want to re-read my first post. It explains this potentail problem clealry. Also, make sure that your files have the right extension .

I will note here that i had the same problem when i first compiled for the Borland win32 compiler tools ...I adjusted an option about files extensions (i'm using .cc) and it worked...
I guess that my problem with Min GNU compiler is also about file extensions; but i can't find any option about this under MINGNU compiler options !
do u have any experience about settin these options for borland c++ builderx?

File -> New File then in the Create New File Menu choose the .c extension.

Also make sure that the "Perform C++ compilation regardless of file extension" option is disabled. (It is by default). It's located at:

Project-> Build Options Explorer Options -> Compile Mode

there is no "compile Mode" option for Minimalist GNU compiler toolset !
borland win32 compiler toolset does have this option !
I can't figure out the real cause of my problem...what i know is that MINGW compiler is unable to preprocess even the first header file included in my program : "stdio.h" ...
another question : do i have to install Mingw or is it shiped and installed with CBX distribution?
any ideas?
thanks

and btw, it isn't "stdio.h" but <stdio.h>. There is a difference between the two with respect to the default search path. Also, as jonnin said, try <csdtio> instead, unless this is a strictly C program, with the proper file extensions.
I believe you have to install the MINGW compiler engine. C++ BuilderX supports additional compilers but it doesn't install them for you (which I found very annoying when I reveiwed this product a while ago here on DevX).

and btw, it isn't "stdio.h" but <stdio.h>. There is a difference between the two with respect to the default search path. Also, as jonnin said, try <csdtio> instead, unless this is a strictly C program, with the proper file extensions.
I believe you have to install the MINGW compiler engine. C++ BuilderX supports additional compilers but it doesn't install them for you (which I found very annoying when I reveiwed this product a while ago here on DevX).

I tried what u suggested but without success :-(
when i tried mingw compiler toolset with a simple program it worked ; but it doesn't work for my quit large c++ library !
this stuff is driving me crazzy !