Skip to content

building error in branch wxwidges310 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dingmingxin opened this issue Jul 14, 2017 · 9 comments
Closed

building error in branch wxwidges310 #2

dingmingxin opened this issue Jul 14, 2017 · 9 comments
Assignees

Comments

@dingmingxin
Copy link

[ 27%] Built target wxLuaLib
[ 27%] Building CXX object modules/wxbind/CMakeFiles/wxLuaBindLib.dir/src/wxgl_bind.cpp.o
/somepath/wxlua/wxLua/modules/wxbind/src/wxgl_bind.cpp:80:22: error: too few arguments to function call, single argument 'context' was not
      specified
    self->SetCurrent();
    ~~~~~~~~~~~~~~~~ ^
/somepath/wxWidgets/3.1/include/wx-3.1/wx/glcanvas.h:219:5: note: 'SetCurrent' declared here
    bool SetCurrent(const wxGLContext& context) const;
    ^
1 error generated.
make[2]: *** [modules/wxbind/CMakeFiles/wxLuaBindLib.dir/src/wxgl_bind.cpp.o] Error 1
make[1]: *** [modules/wxbind/CMakeFiles/wxLuaBindLib.dir/all] Error 2
make: *** [all] Error 2

How to fix this?
Is the binding code writed manually or generated by program ?

@pkulchenko
Copy link
Owner

The bindings are generated from .i interface files, which are used to be written manually, but now can be generated using the script any-bind-sync.lua, but that script hasn't yet been updated to cover wxGL.

This is still strange as I've compiled wxlua library for ZeroBrane Studio with wxGL support and without any issues.

Are you trying to compile it on MacOS? Here is how the definition looks in the interface file:

    %mac void SetCurrent( );
    %wxchkver_2_8&!%mac void SetCurrent(const wxGLContext& RC) const;

So, it looks like it explicitly uses SetCurrent() on MacOS, but I'm not sure whether it's correct or not. It seems like this fragment hasn't had any changes since 2012.

@pkulchenko pkulchenko self-assigned this Jul 16, 2017
@pkulchenko
Copy link
Owner

@dingmingxin, can you also try building using wxwidgets311 branch? wxwidgets310 was a temporary branch I've been working on and wxwidgets311 should also support earlier versions (like wxwidgets 3.0 and wxwidgets 3.1), just not all methods may be available.

@dingmingxin
Copy link
Author

My environment is macos 10.12.5.
I will try branch wxwidges311 later.

@pkulchenko
Copy link
Owner

ok; update the ticket with the results when you get a chance.

@dingmingxin
Copy link
Author

In branch wxwidgets311, the same error occurs.

@dingmingxin
Copy link
Author

dingmingxin commented Jul 19, 2017

After I comment the lines which cause the error above, and continue to compile, I got this:

[ 33%] Building CXX object modules/wxbind/CMakeFiles/wxLuaBindLib.dir/src/wxadv_bind.cpp.o
/Users/dmx/Documents/wxwidgets/wxlua/wxLua/modules/wxbind/src/wxadv_bind.cpp:16296:50: error: use of undeclared identifier 'wxGRIDTABLE_REQUEST_VIEW_GET_VALUES'
        { "wxGRIDTABLE_REQUEST_VIEW_GET_VALUES", wxGRIDTABLE_REQUEST_VIEW_GET_VALUES },
                                                 ^
/Users/dmx/Documents/wxwidgets/wxlua/wxLua/modules/wxbind/src/wxadv_bind.cpp:16297:51: error: use of undeclared identifier 'wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES'
        { "wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES", wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES },
                                                  ^
/Users/dmx/Documents/wxwidgets/wxlua/wxLua/modules/wxbind/src/wxadv_bind.cpp:16367:19: error: invalid application of 'sizeof' to an incomplete type
      'wxLuaBindNumber []'
    count = sizeof(numberList)/sizeof(wxLuaBindNumber) - 1;
                  ^~~~~~~~~~~~
3 errors generated.
make[2]: *** [modules/wxbind/CMakeFiles/wxLuaBindLib.dir/src/wxadv_bind.cpp.o] Error 1
make[1]: *** [modules/wxbind/CMakeFiles/wxLuaBindLib.dir/all] Error 2
make: *** [all] Error 2

It seems like that using sizeof on a static array is illegal when crossing compile with c and c++.
I try test the sizeof behavior on a static array in a function in pure c code, it is ok, no error occured.
Are there any compiling options that can avoid this error ?

@pkulchenko
Copy link
Owner

@dingmingxin, that's interesting. I wonder what compiler (and version) you are using.

I've compiled with the following configure command for wxwidgets:

  ./configure --prefix="$INSTALL_DIR" $WXWIDGETSDEBUG --disable-shared --enable-unicode \
    --enable-compat28 \
    --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=no --with-expat=no \
    --with-zlib=builtin --disable-richtext \
    --enable-macosx_arch=$MACOSX_ARCH --with-macosx-version-min=$MACOSX_VERSION $MINSDK \
    --with-osx_cocoa CFLAGS="-Os" CXXFLAGS="-Os"

and the following cmake command for wxlua:

  cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_BUILD_TYPE=$WXLUABUILD -DBUILD_SHARED_LIBS=FALSE \
    -DCMAKE_OSX_ARCHITECTURES=$MACOSX_ARCH -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_VERSION $MINSDK \
    -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DwxWidgets_CONFIG_EXECUTABLE="$INSTALL_DIR/bin/wx-config" \
    -DwxWidgets_COMPONENTS="stc;gl;html;aui;adv;core;net;base" \
    -DwxLuaBind_COMPONENTS="stc;gl;html;aui;adv;core;net;base" -DwxLua_LUA_LIBRARY_USE_BUILTIN=FALSE \
    -DwxLua_LUA_INCLUDE_DIR="$INSTALL_DIR/include" -DwxLua_LUA_LIBRARY="$INSTALL_DIR/lib/liblua.dylib" .

@pkulchenko
Copy link
Owner

@dingmingxin, do you still have the issue with the commands I shown earlier?

@pkulchenko
Copy link
Owner

@dingmingxin, closing for now; feel free to reopen if you have additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants