Thread: help with macro

  1. #1
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391

    help with macro

    I'd like to set up some macros that will do the following:

    scan 2 different directories (scanning each differently):

    1. the local directory where main is for "wgnuplot.exe"

    and

    2. the /bin or /usr/share or /usr/bin directory for "gnuplot" (i'm on a windows computer right now, I'm not sure where its located)

    Once I've used the above test to basically define the type of OS, I can run my other macros containing different system() calls to wgnuplot.exe or gnuplot respectively.

    I know, I know, trying to figure out what OS is being used is pointless, but this program will only be ran right after either I compile it or my teacher compiles it. This isn't going out to the masses or anything.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    That sounds more like a job for a makefile, which can then define the appropriate OS (-DWIN32 or -DLINUX...)

  3. #3
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    yea thanks, I think in a similar prior post of mine that was your suggestion, but will that work if i know that my teacher will compile within Dev C++?

    I know Dev will generate an automake file of sorts, does it by default compile with -D?
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by dudeomanodude View Post
    yea thanks, I think in a similar prior post of mine that was your suggestion, but will that work if i know that my teacher will compile within Dev C++?

    I know Dev will generate an automake file of sorts, does it by default compile with -D?
    I've never used Dev C++, but if it uses makefiles I don't see why it wouldn't work. Every compiler I've seen use -D to define macros.

    (Hampton, VA eh? I lived in Newport Snooze for 5 years. )

  5. #5
    Use this: dudeomanodude's Avatar
    Join Date
    Jan 2008
    Location
    Hampton, VA
    Posts
    391
    Quote Originally Posted by cpjust View Post
    (Hampton, VA eh? I lived in Newport Snooze for 5 years. )
    been here for 8 years now, it's not too bad, but I really miss Germany, that's where I'm from.
    Ubuntu Desktop
    GCC/G++
    Geany (for quick projects)
    Anjuta (for larger things)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. Macro Program
    By daspope in forum Windows Programming
    Replies: 5
    Last Post: 04-25-2004, 04:02 AM
  5. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM