Static Lib Hell

About Monkey 2 Forums Monkey 2 Programming Help Static Lib Hell

This topic contains 14 replies, has 5 voices, and was last updated by  cocon 2 years ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #7555

    DaY
    Participant

    so i wanted to import my Dx11 RenderLib the lib works fine in test apps but i cant seem to get it to work in Mx2.

    [/crayon]

     

    [/crayon]

     

    [/crayon]

     

    am i missing something here?  i would upload the lib but its like 140meg though i do have a debug version thats 35 hmm

    #7556

    DaY
    Participant

    seems i dont know the proper format code!

    [code]
    Mx2cc version 1.1.03

    ***** Building app 'C:/Users/PC_User/Desktop/vEngine/src/Application.monkey2' *****

    Parsing...
    Semanting...
    Translating...
    Compiling...
    Build error: System command 'g++ -I"C:/Monkey2-v1.1.01/modules/" -I"C:/Monkey2-v1.1.01/modules/monkey/native" -I"C:/Users/PC_User/Desktop/vEngine/src/" -std=c++11 -m32 -I"C:/Monkey2-v1.1.01/modules/freetype/freetype-2.6.3/include/" -I"C:/Monkey2-v1.1.01/modules/openal/openal-soft/include/" -I"C:/Monkey2-v1.1.01/modules/gles20/angle/include/" -I"C:/Monkey2-v1.1.01/modules/sdl2/SDL/include/" -c -o "C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/build/_1include_2_0r.cpp.o" "C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/include/_r.cpp"' failed.

    g++ -I"C:/Monkey2-v1.1.01/modules/" -I"C:/Monkey2-v1.1.01/modules/monkey/native" -I"C:/Users/PC_User/Desktop/vEngine/src/" -std=c++11 -m32 -I"C:/Monkey2-v1.1.01/modules/freetype/freetype-2.6.3/include/" -I"C:/Monkey2-v1.1.01/modules/openal/openal-soft/include/" -I"C:/Monkey2-v1.1.01/modules/gles20/angle/include/" -I"C:/Monkey2-v1.1.01/modules/sdl2/SDL/include/" -c -o "C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/build/_1include_2_0r.cpp.o" "C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/include/_r.cpp"

    In file included from C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/include/_r.cpp:69:0:

    C:/Users/PC_User/Desktop/vEngine/src/Application.buildv1.1.03/windows_debug/include/Application_Application.h:48:37: error: expected class-name before '{' token

    struct t_Render_Render : public Game{

    ^

    ***** Fatal mx2cc error *****

    Internal mx2cc build error

    [/code]

    #7559

    Mark Sibly
    Keymaster

    You may need to add something like:

    #Import “mylib/include/*.h”

    #Import “<mylib.h>”

    …to your mylib.monkey2 module file. The first import adds the ‘include dir’ to the module, the second adds the actual header file for the lib.

    Take a look at, say, modules/openal.monkey2 for how to import a ‘prebuilt’ lib.

    #7562

    DaY
    Participant

    it seems to be dx math thats the problem might strip it down and add parts only when it works

    #7563

    abakobo
    Participant

    there are some automatic extern importers, you could have a try

    src/c2mx2.monkey2
    src/cxx2mx2.monkey2

    importing big libs is always not trivial though…

    #7564

    DaY
    Participant

    its gotta be down to dxmath it doesnt like something

    [edited to free up space]

    #7566

    DaY
    Participant

    [edited to free up space]

    suppose im getting fewer errors as i go along think i might have to drop dxmath as even the git version wont work but the gl version of the lib uses glm so i might try and import that lib to check i aint messed the libs up.

    #7572

    abakobo
    Participant

    it could have something to do with compiler optimisation flags (I don’t know how to change them though!)

    #7583

    DaY
    Participant

    Mark if i may ask what version of c++ you using? as i think its a c++11/c++14 thing as im compiling via 2015 and i noticed you pass -std=c++11 to ming.

    i have just compiled angel script and just include it into a project and i get

    [/crayon]
    #7584

    Simon Armstrong
    Participant

    I’m guessing this is MingW specific, haven’t looked into it but maybe start here:

     

    http://stackoverflow.com/questions/9000485/how-to-compile-a-directx-11-app-in-mingw

    #7586

    Mark Sibly
    Keymaster

    Yes, mx2 does use -std=c++11.

    The dxmath problems looks like a calling convention issue – there might be some #defines in dxmath somewhere that you can tweak to fix this.

    As for the angelscript module not building, can you post angelscript.monkey2? Looks like you may have a dodgy #Import in there. I’ve never heard of angelscript before, but looking at the web page now I think it should be relatively easy to port to mx2.

    #7588

    Mark Sibly
    Keymaster

    Had a quick go at building angelscript and it worked first time, results are here:

    http://www.monkey-x.com/mak/angelscript.zip

    That said, I’m not sure how much use it’ll be – from the looks of things, it uses c++ types to interact with the host, so you’ll need to wrap all that stuff.

    #7595

    DaY
    Participant
    [/crayon]

    sure its proberly me being half asleep included the file i was trying to get it to run and link direct from the prebuilt lib as a test as i wanted to know if it would be harder to port my code base in.

    #7605

    DaY
    Participant

    well it compiles now just gotta play with it for a while(angelscript.lib)

    #7667

    cocon
    Participant

    See here: http://stackoverflow.com/questions/9000485/how-to-compile-a-directx-11-app-in-mingw

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.