Giter VIP home page Giter VIP logo

Comments (4)

adamjs avatar adamjs commented on June 7, 2024 2

Nice catch! That function was indeed not exported in the latest build, I'll fix it in the next release.

from ultralight.

a-morphous avatar a-morphous commented on June 7, 2024 1

I have confirmed that the C API also does not work on M1 Mac with 1.4 dev, specifically for ulCreateView.

[ 58%] Linking C executable Sample6.app/Contents/MacOS/Sample6
Undefined symbols for architecture arm64:
  "_ulCreateView", referenced from:
      _Init in main.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [samples/Sample 6 - Intro to C API/Sample6.app/Contents/MacOS/Sample6] Error 1
make[1]: *** [samples/Sample 6 - Intro to C API/CMakeFiles/Sample6.dir/all] Error 2
make: *** [all] Error 2

I did this by replacing the SDK in the built samples folder with the 1.4 version, and then modifying Sample 6 (the c API one) to the following code:

#include <Ultralight/CAPI.h>
#include <AppCore/CAPI.h>

ULRenderer renderer = 0;
ULView view = 0;

void Init() {
  ULConfig config = ulCreateConfig();
  renderer = ulCreateRenderer(config);

  ULViewConfig viewConfig = ulCreateViewConfig();
  ULString test = ulCreateString("test");
  ULSession session = ulCreateSession(renderer, false, test);
  view = ulCreateView(renderer, 512, 512, viewConfig, session, 0); // The 0 is because the compiler claimed v1.4dev has a 6th parameter for display_id...however it broke regardless of whether I included it
  ULString str = ulCreateString("<h1>Hello World!</h1>");
  ulViewLoadHTML(view, str);
}

int main() {
  Init();
}

Running Sample 6 without modifications (where it creates an app instead of a renderer) works, as do the other samples that use the C++ API.

from ultralight.

SupinePandora43 avatar SupinePandora43 commented on June 7, 2024

But does the c api example work?

C# bindings do not work yet with the 1.4
It'd be better to use discord for discussing this

from ultralight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.