Closed JeremyGiner closed 5 years ago
Hmm, what version of haxe, hxcpp, wx? Also, can you zip up the test app? Does this work with VC++? (ive never tried with gcc on windows but worked on OSX / linux)
haxe 3.4.0 hxcpp (Haxe C++ Runtime Support) (4.0.4) wxWidgets 3.1.1
Main.hx :
package;
import hx.widgets.*;
class Main {
public static function main() {
var app = new App();
app.init();
var frame:Frame = new Frame(null, "hxWidgets");
var taskBarIcon = new TaskBarIcon();
taskBarIcon.setBitmap(Bitmap.fromHaxeResource("haxe-logo-tiny.png"), "Some tooltip");
var platform:PlatformInfo = new PlatformInfo();
if (platform.isWindows) {
frame.backgroundColour = 0xFFFFFF;
}
//frame.menuBar = buildMenu();
frame.sizer = new BoxSizer(Orientation.VERTICAL);
frame.resize(800, 600);
var imageList:ImageList = new ImageList(16, 16);
imageList.add(Bitmap.fromHaxeResource("ui-check-boxes-series.png"));
imageList.add(Bitmap.fromHaxeResource("layer-shape-line.png"));
imageList.add(Bitmap.fromHaxeResource("ui-scroll-pane-list.png"));
imageList.add(Bitmap.fromHaxeResource("information-button.png"));
imageList.add(Bitmap.fromHaxeResource("application-dialog.png"));
imageList.add(Bitmap.fromHaxeResource("globe-green.png"));
var tabs:Notebook = new Notebook(frame);
if (platform.isMac) {
tabs.allowIcons = false;
}
if (platform.isWindows) {
tabs.padding = new Size(6, 6);
}
tabs.imageList = imageList;
frame.sizer.add(tabs, 3, Stretch.EXPAND | Direction.ALL, 10);
frame.sizer.addSpacer(5);
frame.layout();
frame.show();
app.run();
app.exit();
}
}
Build.hxml :
_______________________________________________________________________________
# Test compilation
#-lib openfl
#-lib lime
-lib hxWidgets
#-lib haxeui-hxwidget
#-lib haxeui-core
# Select directory
-cp src
# java target
#-java build_java
-cpp build_cpp
#-D no-compilation
-D cygwin
-D windows
-D HXCPP_VERBOSE=1
-D HXCPP_M64
-D WXWIN=C:\cygwin64\lib\gcc720_dll
-main Main
I don't know about VC++
My .hxcpp_config is quite wierd, i kind of copy-pasted bits of code from everywhere trying to fix some other errors i was having. I assume that if the error come from somewhere it might come from this config.
.hxcpp_config :
<xml>
<!-- This section is parses at the beginning of the build .... -->
<section id="vars">
<set name="toolchain" value="cygwin"/>
<set name="HXCPP_M64" value="1"/>
<set name="SDK_ROOT" value="c:\SDKs\" unless="SDK_ROOT" if="windows" />
<set name="SDK_ROOT" value="${HOME}/SDKs/" unless="SDK_ROOT" />
<set name="ANDROID_NDK_DIR" value="${SDK_ROOT}" unless="ANDROID_NDK_DIR" />
<set name="ANT_HOME" value="${SDK_ROOT}/ant" unless="ANT_HOME" />
<set name="ANDROID_SDK" value="${SDK_ROOT}/android-sdk" unless="ANDROID_SDK" />
<set name="JAVA_HOME" value="${SDK_ROOT}/java_jdk" unless="JAVA_HOME" />
</section>
<!-- Use this section to add flags to the compilers and linkers -->
<section id="exes">
<compiler id="cygwin" exe="env g++" if="windows">
<flag value="-c"/>
<flag value="-DwxUSE_LIBMSPACK"/><!-- wxWidget stuff -->
<cppflag value="-frtti"/>
<flag value="-g" if="debug"/>
<flag value="-O2" unless="debug"/>
<flag value="-DHX_LINUX"/>
<flag value="-DHXCPP_BIG_ENDIAN" if="HXCPP_BIG_ENDIAN"/>
<include name="toolchain/common-defines.xml" />
<flag value="-m32" unless="HXCPP_M64"/>
<flag value="-m64" if="HXCPP_M64"/>
<flag value="-I${HXCPP}/include"/>
<objdir value="obj/cygwin${OBJEXT}/"/>
<outflag value="-o"/>
<ext value=".o"/>
</compiler>
<linker id="dll" exe="env g++" if="windows">
<flag value="-shared"/>
<flag value="-m32" unless="HXCPP_M64"/>
<flag value="-m64" if="HXCPP_M64"/>
<flag value="-W,l--unresolved-symbols=report-all"/>
<flag value="-Xlinker"/>
<flag value="--no-undefined"/>
<flag value="-debug" if="debug"/>
<lib name="-ldl"/>
<ext value=".dso"/>
<outflag value="-o "/>
</linker>
<linker id="exe" exe="env g++" if="windows">
<flag value="-debug" if="debug"/>
<flag value="-m32" unless="HXCPP_M64"/>
<flag value="-m64" if="HXCPP_M64"/>
<flag value="-mwindows" if="SUBSYSTEMWINDOWS" />
<lib name="-ldl"/>
<ext value=".exe"/>
<outflag value="-o "/>
</linker>
</section>
</xml>
have you tried to compile this: https://github.com/haxeui/hxWidgets/tree/master/samples/00-Showcase
IIRC correct this compiles fine via the .hxml files on all OS's i tested.
Try to compile the project as is, it gave me the "no compiler define for target" which i fixed by adding my usual flag : -D cygwin -D windows -D HXCPP_VERBOSE=1 -D HXCPP_M64 -D WXWIN=C:\cygwin64\lib\gcc720_dll
And then it asked for a missing wx/setup.h file, which apparently a "master" copy exist in include/wx/msw/wx/setup.h so i just copied the file to include/wx. And now i have the error : #error "This file should only be included when using Microsoft Visual C++"
I'm just going to give up this is not worth the effort. My config of hxcpp is most likely the source of all that, so i'm just going to close the issue, thank for your help anyway.
How come you dont want to use MSVC on windows? Also, how did you install haxe under cygwin? I presume you are using the cygwin terminal? Have you tried http://tdm-gcc.tdragon.net/ (ie, just gcc withut the cygwin env)?
Main problem is its hard to know how your system(s) are setup so hard to reproduce.
Ian
I'm trying to compile a simple test program using dlls with cygwin and gcc and i get the following error :