Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Hi, and thanks in advance for any assistance.
I have built the both the DLL and Static Unicode release versions of wxPropertyGrid (1492) and can compile and run the sample application using the static library, but if I build it with the DLL version it crashes on the first attempt to instantiate any wxpropertygrid object.
I tried using it in my own application by simply copying minimal.cpp, adding it to my project, and calling DisplayMinimalFrame in response to a menu selection. As soon as I do the program crashes (when built with the DLL library). If I try to build my app with the static lib I get this
--------- Build: Release in SceneBuilder ----------
Precompiling header: wx_pch.h
C:\Projects\STEVE\IrrlichtProjects\SceneBuilder\CSplitWindow.cpp: In member function `void CSplitWindow::OnPositionChanged(wxSplitterEvent&)':
C:\Projects\STEVE\IrrlichtProjects\SceneBuilder\CSplitWindow.cpp:29: warning: unused variable 'pos'
Linking executable: SceneBuilder.exe
objs\minimal.o:minimal.cpp:(.text+0x45b): undefined reference to `__imp__wxPropertyGridNameStr'
objs\minimal.o:minimal.cpp:(.text+0x49f): undefined reference to `__imp___ZN14wxPropertyGridC1EP8wxWindowiRK7wxPointRK6wxSizelPKw'
objs\minimal.o:minimal.cpp:(.text+0xd6b): undefined reference to `__imp__wxPropertyGridNameStr'
objs\minimal.o:minimal.cpp:(.text+0xda8): undefined reference to `__imp___ZN14wxPropertyGridC1EP8wxWindowiRK7wxPointRK6wxSizelPKw'
objs\minimal.o:minimal.cpp:(.text+0x11eb): undefined reference to `__imp___ZNK12wxPGProperty7GetNameEv'
objs\minimal.o:minimal.cpp:(.text+0x12e8): undefined reference to `__imp___ZNK12wxPGProperty7GetNameEv'
objs\minimal.o:minimal.cpp:(.text+0x13d8): undefined reference to `__imp__wxEVT_PG_CHANGED'
objs\minimal.o:minimal.cpp:(.text+0x13fe): undefined reference to `__imp__wxEVT_PG_CHANGING'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 32 seconds)
8 errors, 1 warnings
I'm using wxWidgets 2.8, Code::Blocks, and Mingw on Windows XP. I've experimented with library order in the linker properties, tried linking to the wxPropertyGrid library twice, once at the beginning, and again at the end of the list, and always the same result.
Does the Code::Blocks system use makefile.gcc or configure && make? Also, can you produce a stack trace of the crash?
From those __imp__ prefixes it sure looks like the app still thinks it is linking against propgrid DLL. Could be a mismatch in WXDLLIMPEXP_PG definition.
Hi, and thanks for the quick reply. Here's my answers:
> Does the Code::Blocks system use
> makefile.gcc or configure && make?
I'm not really sure. I believe it simply generates the required command lines for the tools. I could turn on verbose output and send you that.
> Also, can you produce a stack trace of
> the crash?
I could, but I don't know how.
> From those imp prefixes it sure looks
> like the app still thinks it is
> linking against propgrid DLL. Could be
> a mismatch in WXDLLIMPEXP_PG
Huh? Is there something I can do about that? Other than linking to the library I want to use is there anything else I need to set at compile time to tell wxPropgrid what I'm using? If it matters, what I'm doing is linking wxWidgets dynamically, but wxPropertyGrid statically.
If you are linking wxPG statically and wxWidgets as DLL, then you need to manually define WXMAKINGLIB_PROPGRID. Otherwise incorrect import/export declaration is used.
Also, you can usually produce stack trace (back trace, or whatever, it goes by many names) with a debugger. If Code::Blocks doesn't have one, maybe MingW project has finally ported gdb for Windows.
I'm just an experienced beginner at this stage, so one more question: At what point do I need to manually define that - when I'm building the wxPropertyGrid library, in my app units that use wxPropgrid, at link time on my app, etc?
I'll see what I can do about a stack trace on the dll build.
You should define it at least for all code that uses the static wxPG library. However, also defining it when building the static wxPG library should not do any harm.
I added WXMAKINGLIB_PROPGRID to the projects compile options and rebuilt, but now I'm getting unresolved references to ImageList.
I'm giving up for now. I've been trying to get this to work for five days now and need to just drop it for a while and get back to my main project. I'll tackle it again with a fresh outlook in a few days and get back to you.
Thanks for all your assistance, and for making this library available. It's exactly what I need, and I know I'll get it sorted out eventually. Even with a few "startup" problems it's a lot quicker than writing my own from scratch.