Author Topic: Trying to figure out limits of global variables  (Read 3954 times)

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Trying to figure out limits of global variables
« on: September 09, 2007, 08:19:58 pm »
I was asked by a friend to set up a  C::B  project file for a network redirection program of his.  On his home computer he has everything in very unconventional locations (among other issues).  When initially compiling his program it stops at the first file with the warning:
Quote
mysql/mysql.h: no such file or directory
and this is in reference to a basic include directive:

#include <mysql/mysql.h>

My first instinct was since my installation location for mysql is likely different than his id set up a 'mysql' global variable to point to

C:\Dev\mySQL\mysql-5.0.45-win32\include

which is the location of the include folder on my system.  I put that path as the 'base' field and compile again to recieve the same error.  When compiling C::B itself the only value i had to set in the 'wx' global variable was the base field being assigned to:

C:\Dev\wxWidgets\wxWidgets-2.8.4

and that doesnt even point directly to the header files.  It points to the precompiled headers.  And using

#include <wx/blah.h>

works perfectly.  So im confused as to why the same concept isnt working with regards to mysql.  Can someone tell me what im doing wrong ?


Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Trying to figure out limits of global variables
« Reply #1 on: September 09, 2007, 08:32:56 pm »
You still need a reference to the global variable in your project search paths. If the global variable's base path is what you indicated (C:\Dev\mySQL\mysql-5.0.45-win32\include), you would just add "$(#mysql)", sans quotes. Standard practice would be to have the base set as "C:\Dev\mySQL\mysql-5.0.45-win32", and add "$(#mysql.include)".
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Trying to figure out limits of global variables
« Reply #2 on: September 09, 2007, 09:23:08 pm »
Thanks for the clarification.  I was thinking that the global variables were also being handled as a preprocessor replacement so that

#include <wx/blah.h>

resolved to

#include <$(wx)/blah.h>

When in fact i failed to notice that there is a nested  'wx'  directory inside the widgets directory tree.  Basically the variable name matching a directory name got my train of thought derailed in how the global variables were handled.  They ONLY effect project settings, not src code.
« Last Edit: September 09, 2007, 09:27:51 pm by Seronis »