Thread: g++ arguments

  1. #1
    Registered User Stonehambey's Avatar
    Join Date
    Jan 2008
    Location
    Kent, UK
    Posts
    118

    g++ arguments

    Hi,

    This might seem like a really dumb question, but after installing and building wxWidgets I simply cannot get even a simple application to compile using g++, I had the best luck with

    Code:
    g++ -I<path to wxwidgets>/include -L:<path to wxwidgets> /lib <src files>
    and managed to compile a simple console application that way. But when I tried to create a GUI application I got a whole load of errors.

    I think I may have to add a -l flag, but I'll admit I don't know exactly what's needed there. On linux the `wx-config --cxxflags` `wx-config --libs` does the trick, but on windows it's being a right pain.

    Any help would be much appreciated.

    Cheers

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Code:
    -L:<path to wxwidgets>
    I don't think you should have a : in there.

  3. #3
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    I think I may have to add a -l flag
    Probably, if the errors you're getting are something along the lines of "undefined reference".

    I'd say for the time being, you can check the output of wx-config. It should print out a bunch of -l flags, just use those in windows g++ (assuming you have the -L path correct). Same with --cxxflags while you're at it.
    Consider this post signed

  4. #4
    Registered User Stonehambey's Avatar
    Join Date
    Jan 2008
    Location
    Kent, UK
    Posts
    118
    Yeah, they're all undefined references. Is there any way to check if my -L path is correct?

    Google isn't really a huge help to someone who has no idea what they should be linking to etc, and there's literally too many library files to link to them all, you'd think there'd be an idiots guide out there (maybe I missed it). At the moment I'm just being frightened by all the nasty looking makefiles!

    It can't be this hard surely, can it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  3. command line arguments
    By vurentjie in forum C Programming
    Replies: 3
    Last Post: 06-22-2008, 06:46 AM
  4. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 10:48 AM
  5. registry, services & command line arguments.. ?
    By BrianK in forum Windows Programming
    Replies: 3
    Last Post: 03-04-2003, 02:11 PM