haxeui / hxWidgets

Haxe externs (and wrappers) for wxWidgets
MIT License
77 stars 22 forks source link

Error: ./src/hx/widgets/HardBreakWrapper.cpp:6:10: fatal error: custom/hardbreakwrapper.h: No such file or directory & Sizer.hx too many arguments #56

Closed Osndok closed 5 years ago

Osndok commented 5 years ago

Hi!

When trying to build my first haxui program using hxwidgets, I run into this error which I don't entirely understand (it seems like an error from a generated source):

Error: ./src/hx/widgets/HardBreakWrapper.cpp:6:10: fatal error: custom/hardbreakwrapper.h: No such file or directory

It's entirely possible that I am doing something wrong, but I cannot tell what.

Additionally, when I try to use the latest git HEAD, I also get this message:

./src/hx/widgets/Sizer.hx:36: characters 38-42 : Too many arguments

...which seems like an easy fix, but I am not confident in this realm:

diff --git a/src/hx/widgets/Sizer.hx b/src/hx/widgets/Sizer.hx
index 3710719..8f8e0ef 100644
--- a/src/hx/widgets/Sizer.hx
+++ b/src/hx/widgets/Sizer.hx
@@ -32,8 +32,8 @@ class Sizer extends Object {
         sizerRef.ptr.addSpacer(size);
     }

-    public function addStretchSpacer(size:Int) {
-        sizerRef.ptr.addStretchSpacer(size);
+    public function addStretchSpacer() {
+        sizerRef.ptr.addStretchSpacer();
     }

     public function remove(index:Int):Bool {
ianharrigan commented 5 years ago

Hi!

Any chance you could zip up your project so i can take a look at it? Windows? Linux? What compiler (gcc, VSC)... what version of "stuff" (hxcpp, haxe, etc).

Cheers, Ian

ianharrigan commented 5 years ago

Did you get anywhere with this? The second issue (addStretchSpacer) is fixed now in master... The first is that cant find the include/custom dir (relative to the haxelib)... are you using this lib from git? What is your setup? eg: haxelib list:

hxwidgets: 1.0.0 [dev:Z:\HaxeUI2\hxWidgets\src]
Osndok commented 5 years ago

I haven't had a lot of time available for this, it is really just a proof-of-concept (since the haxeui-demo repo is empty):

As for the haxelib list, it might have changed since then (because I was playing with different versions to try and get it to work), but here it is now:

actuate: [1.8.7]
box2d: [1.2.3]
format: [3.4.1]
haxeui-core: 0.0.4 [git]
haxeui-hxwidgets: [git]
haxeui-openfl: [0.0.2]
haxeui: [1.8.21]
hscript: [2.2.0]
hxcpp: [4.0.4]
hxjava: [3.2.0]
hxp: [1.0.3]
hxWidgets: 1.0.0 [git]
layout: [1.2.1]
lime-samples: [7.0.0]
lime: 2.9.1 [7.0.0]
openfl-samples: [8.4.0]
openfl: 3.6.1 [8.4.1]
3vilguy commented 5 years ago

Hi @ianharrigan !

I'm also getting:

Error: ./src/hx/widgets/HardBreakWrapper.cpp:6:10: fatal error: 'custom/hardbreakwrapper.h' file not found
#include "custom/hardbreakwrapper.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I pretty much just did:

$ brew install wxwidgets

$ haxelib install haxeui-core
$ haxelib install haxeui-hxwidgets

$ haxelib run haxeui-core create hxwidgets

My setup:

Any ideas what could be the issue?

ianharrigan commented 5 years ago

Do you have a "custom/hardbreakwrapper.h" in the "include" dir of the haxelib project? Also, if you go into "EntryMacro.hx" and get it to print out the buildXml what does it look like?

image

3vilguy commented 5 years ago

Yes, include/custom/hardbreakwrapper.h file does exist inside hxWidgets haxelib project.

EntryMacro.hx:

{ expr => EConst(CString(<set name="MAC_USE_CURRENT_SDK" value="1" if="macos" />
                                       <set name="HXCPP_GCC" value="1" if="macos" />
                                       <set name="HXCPP_M64" value="1" if="macos" />
                                       <files id="haxe"><compilerflag value="-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0" />
<compilerflag value="-I/usr/local/include/wx-3.0" />
<compilerflag value="-D_FILE_OFFSET_BITS=64" />
<compilerflag value="-DWXUSINGDLL" />
<compilerflag value="-D__WXMAC__" />
<compilerflag value="-D__WXOSX__" />
<compilerflag value="-D__WXOSX_COCOA__" />
<compilerflag value="" />
<compilerflag value="-I${haxelib:hxWidgets}/../include" />

<compilerflag value="-mmacosx-version-min=10.7" />
<compilerflag value="-std=c++11" />
<compilerflag value="-stdlib=libc++" />
</files>
                                       <target id="haxe" tool="linker" toolid="exe"><lib name="-L/usr/local/lib" />
<vflag name="-framework" value="IOKit"/>
<vflag name="-framework" value="Carbon"/>
<vflag name="-framework" value="Cocoa"/>
<vflag name="-framework" value="AudioToolbox"/>
<vflag name="-framework" value="System"/>
<vflag name="-framework" value="OpenGL"/>
<lib name="-lwx_osx_cocoau_gl-3.0" />
<lib name="-lwx_osx_cocoau_xrc-3.0" />
<lib name="-lwx_osx_cocoau_webview-3.0" />
<lib name="-lwx_osx_cocoau_html-3.0" />
<lib name="-lwx_osx_cocoau_qa-3.0" />
<lib name="-lwx_osx_cocoau_adv-3.0" />
<lib name="-lwx_osx_cocoau_core-3.0" />
<lib name="-lwx_baseu_xml-3.0" />
<lib name="-lwx_baseu_net-3.0" />
<lib name="-lwx_baseu-3.0" />
<compilerflag value="-std=c++11" />
<compilerflag value="-stdlib=libc++" />
<lib name="-lc++" /></target>)), pos => #pos(/Users/3vilguy/Documents/Projects/HaxeUI-Test/.haxelib/hxWidgets/1,0,0/src/wx/widgets/Entry.hx:3: characters 1-7) }
ianharrigan commented 5 years ago

can you pull latest from GH and try again?

The -I${haxelib:hxWidgets}/../include looks wrong

3vilguy commented 5 years ago

Using to latest from Git I'm no longer getting HardBreakWrapper issue (yey, thanks).

It was bit weird later on, because I was getting:

Error: Library hxcpp is not installed
Error: Build failed

Which is weird, because I do have hxcpp installed in local repo. However, after installing in global haxelib folder (/usr/local/lib/haxe/lib/hxcpp) I was able to compile :)

Thank you 👍

ianharrigan commented 5 years ago

Does this now work for the OP @Osndok ? If so can you close it?

Cheers, Ian

Osndok commented 5 years ago

I'll try again later, but I am satisfied with any fix that worked for @3vilguy ...