deejross
November 14th, 2008, 02:50 AM
I am JUST learning C++ because I need to write a cross-platform application. I decided to go with the wxWidgets library and am trying to get a very simple program to compile. I come from C#, so #include and all that other C++ stuff scares me. I am very new so I will need some hand-holding :)
This is the application I have so far:
#include "wx/wx.h"
int main(int argc, char **argv)
{
wxPuts(wxT("A console application"));
}
I have build-essential, libwxbase2.8-0, libwxbase2.8-dev, wx-common, wx2.8-headers, libwxgtk2.8-0, libwxgtk2.8-dev installed but I'm getting the following error:
g++ console.cpp -o console
console.cpp:1:19: error: wx/wx.h: No such file or directory
console.cpp: In function ‘int main(int, char**)’:
console.cpp:5: error: ‘wxT’ was not declared in this scope
console.cpp:5: error: ‘wxPuts’ was not declared in this scope
I don't really know how to use g++, I was using Code:Blocks (because I thought it would help me to learn since I'm used to IDE's) and it was having the same issue, so I've been trying a few commands I found after Googling the problem.
I tried this command I found from an earlier post Here (http://ubuntuforums.org/showthread.php?t=145417&page=2):
g++ console.cpp 'wx-config --libs' 'wx-config --cxxflags' -o console
And no luck. I also tried copying everything from /usr/include/wx-2.8/wx into it's own wx folder in the same folder as the cpp file. I also tried using #include <wx2.8/wx/wx.h> instead, but then all of it's #includes give me "No such file or directory" errors.
Remember, I have no idea what I'm doing when it comes to C++...so if you have any tips for someone trying to learn C++ I would appreciate that as well. Thanks for any help you can give me.
This is the application I have so far:
#include "wx/wx.h"
int main(int argc, char **argv)
{
wxPuts(wxT("A console application"));
}
I have build-essential, libwxbase2.8-0, libwxbase2.8-dev, wx-common, wx2.8-headers, libwxgtk2.8-0, libwxgtk2.8-dev installed but I'm getting the following error:
g++ console.cpp -o console
console.cpp:1:19: error: wx/wx.h: No such file or directory
console.cpp: In function ‘int main(int, char**)’:
console.cpp:5: error: ‘wxT’ was not declared in this scope
console.cpp:5: error: ‘wxPuts’ was not declared in this scope
I don't really know how to use g++, I was using Code:Blocks (because I thought it would help me to learn since I'm used to IDE's) and it was having the same issue, so I've been trying a few commands I found after Googling the problem.
I tried this command I found from an earlier post Here (http://ubuntuforums.org/showthread.php?t=145417&page=2):
g++ console.cpp 'wx-config --libs' 'wx-config --cxxflags' -o console
And no luck. I also tried copying everything from /usr/include/wx-2.8/wx into it's own wx folder in the same folder as the cpp file. I also tried using #include <wx2.8/wx/wx.h> instead, but then all of it's #includes give me "No such file or directory" errors.
Remember, I have no idea what I'm doing when it comes to C++...so if you have any tips for someone trying to learn C++ I would appreciate that as well. Thanks for any help you can give me.