Page 1 of 1

compile error

Posted: Thu Jun 12, 2008 1:29 am
by kevin_fly
I use wxWidgets to write a simple dll project(only export a UI) in MAC+Xcode, but when I compile the project, many error as below:

../include/wx/buffer.h:96: error: parse error before "wxCharBuffer"

../include/wx/buffer.h:96: error: syntax error before '{' token

../include/wx/buffer.h:96: error: parse error before ':' token



Could you give me some information about these error
thank you

Posted: Thu Jun 12, 2008 7:38 pm
by Auria
can you show some code? How did you build and install wxWidgets? Do wx samples build? How did you build your project/makefile?

Posted: Fri Jun 13, 2008 2:05 am
by kevin_fly
can you show some code?
----------------------------------------------------------
export.h

int FunTest(int a, int b);
void OpenWnd();

export.cpp

#include <wx/wx.h>
#define EXPORT __attribute__((visibility("default")))
int EXPORT FunTest(int a, int b)
{
return a+b;
}

void EXPORT OpenWnd()
{
wxFrame* pFrame = new wxFrame(...);
pFrame->Show(...);
}
if i only export the FunTest(...), i call it by another application, and it's ok, but when i export OpenWnd(), there will appere many errors.

my code is a simple sample to export a UI for other application, but when comple first line(wx/wx.h),there will apper a lot of error,and by now, the compiler can't comile my any one line code still.

How did you build and install wxWidgets?
I didn't install wxWidgets, but i download it's code and compile successfull

Do wx samples build?
yes, the sample "minimal" comiled and run OK

How did you build your project/makefile?
my project creted by xcode, it is a dynamic link library.

Posted: Fri Jun 13, 2008 11:20 pm
by Auria
I didn't install wxWidgets, but i download it's code and compile successfull
Well then how did you build it
my project creted by xcode, it is a dynamic link library.
How did you build your xcode project? I suspect you didn't build it properly. try e.g. building your library with a makefile + wx-config, if it works you know your project is incorrect

Posted: Tue Jul 01, 2008 5:18 am
by kevin_fly
i create another dynamic project and build successfull, i don't know why? no time to find the answer.