openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.89k stars 2.55k forks source link

how to add addons #8031

Open mathpopo opened 2 months ago

mathpopo commented 2 months ago

ubuntu22.04 cd OF/examples/graphics/polygonExample make make run

but no make

dimitre commented 2 months ago

try

cd OF/examples/graphics/polygonExample
cp ../scripts/templates/linux/{Makefile,config.make} .
make -j
make RunRelease
mathpopo commented 1 month ago

image ok @dimitre ,thanks! any other example need do like this?

mathpopo commented 1 month ago

@dimitre if i want to add new addons, should i do ? because i just use openFrameworks/scripts/linux/download_libs.sh && compileOF.sh && compilePG.sh, i just add addons code into addon/ ,again use these sh, just in cmakelist: file(GLOB OF_LIBS "${OF_ROOT}/libs/openFrameworksCompiled/lib/linux64/*.a" "${OF_ROOT}/addons/*/libs//lib/linux64/.a" "${OF_ROOT}/libs/tess2/lib/linux64/.a" ) no effect?so coule you tell me ?

dimitre commented 1 month ago

you can edit addons.make file in project folder and add there take a look at examples/templates/allAddonsExample

mathpopo commented 1 month ago

for example : first: ~/disk1/github/openFrameworks/addons/ofxTrueTypeFontUL2$ ls example libs LICENSE.md README.md src senond:

openFrameworks/examples/templates/allAddonsExample$ ls addons.make allAddonsExample.png bin README.md src

addons.make:

add ofxTrueTypeFontUL2 image

above all done!!!

again download_libs.sh && compileOF.sh && compilePG.sh?

dimitre commented 1 month ago

no need to run this scripts. I think this two are enough

make -j
make RunRelease
mathpopo commented 1 month ago

i just want to use file(GLOB OF_LIBS "${OF_ROOT}/libs/openFrameworksCompiled/lib/linux64/.a" "${OF_ROOT}/addons/**/libs//lib/linux64/.a" "${OF_ROOT}/libs/tess2/lib/linux64/.a" ) in which folder to run "make"?~/disk1/github/openFrameworks/examples/templates/allAddonsExample$ ?

(base) chenxin@chenxin-Nitro-AN515-52:~/disk1/github/openFrameworks/examples/templates/allAddonsExample$ make [make: 没有指明目标并且找不到 makefile。 停止。](make: No targets specified and no makefile found. Stop)

dimitre commented 1 month ago

go to the example/project folder and run

cp ../scripts/templates/linux/{Makefile,config.make} .

so you have the default makefiles in this folder and can run make

mathpopo commented 1 month ago

/usr/include/c++/11/string:67:11: note: ‘std::pmr::string’ 67 | using string = basic_string; | ^~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1984:80: error: expected primary-expression before ‘float’ 1984 | void ofxTrueTypeFontUL2::getLayoutData(vector&facePosis,string s, float x, float y,float width,float height,int textAlign){ | ^~~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1984:89: error: expected primary-expression before ‘float’ 1984 | void ofxTrueTypeFontUL2::getLayoutData(vector&facePosis,string s, float x, float y,float width,float height,int textAlign){ | ^~~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1984:97: error: expected primary-expression before ‘float’ 1984 | void ofxTrueTypeFontUL2::getLayoutData(vector&facePosis,string s, float x, float y,float width,float height,int textAlign){ | ^~~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1984:109: error: expected primary-expression before ‘float’ 1984 | void ofxTrueTypeFontUL2::getLayoutData(vector&facePosis,string s, float x, float y,float width,float height,int textAlign){ | ^~~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1984:122: error: expected primary-expression before ‘int’ 1984 | void ofxTrueTypeFontUL2::getLayoutData(vector&facePosis,string s, float x, float y,float width,float height,int textAlign){ | ^~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1987:50: error: return type ‘class ofPath’ is incomplete 1987 | ofPath ofxTrueTypeFontUL2::getCountours(int index){ | ^ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp: In member function ‘void ofxTrueTypeFontUL2::getCountours(int)’: ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1988:23: error: ‘class ofxTrueTypeFontUL2::Impl’ has no member named ‘charOutlines’ 1988 | return mImpl->charOutlines[index]; | ^~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp: In member function ‘int ofxTrueTypeFontUL2::getLoadedCharactersCount()’: ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1993:23: error: ‘class ofxTrueTypeFontUL2::Impl’ has no member named ‘cps’ 1993 | return mImpl->cps.size(); | ^~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp: In static member function ‘static bool ofxTrueTypeFontUL2::initLibraries()’: ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:2007:17: error: ‘FcBool’ was not declared in this scope; did you mean ‘FT_Bool’? 2007 | FcBool result = FcInit(); | ^~ | FT_Bool ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:2008:21: error: ‘result’ was not declared in this scope 2008 | if(!result){ | ^~ In file included from ../../../libs/openFrameworks/3d/ofMesh.inl:8, from ../../../libs/openFrameworks/3d/ofMesh.h:720, from ../../../libs/openFrameworks/graphics/ofTrueTypeFont.h:4, from ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.h:2, from ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1: ../../../libs/openFrameworks/utils/ofLog.h: In instantiation of ‘std::string ofVAArgsToString(const char, Args&& ...) [with Args = {}; std::string = std::__cxx11::basic_string]’: ../../../libs/openFrameworks/utils/ofLog.h:464:35: required from ‘ofLog::ofLog(ofLogLevel, const char, Args&& ...) [with Args = {}]’ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:1731:82: required from here ../../../libs/openFrameworks/utils/ofLog.h:18:33: warning: format not a string literal and no format arguments [-Wformat-security] 18 | size_t n = std::snprintf(buf, sizeof(buf), format, std::forward(args)...); | ~~~^~~~~~~~~~~~~ ../../../libs/openFrameworks/utils/ofLog.h:30:22: warning: format not a string literal and no format arguments [-Wformat-security] 30 | std::snprintf(const_cast<char *>(s.data()), s.size(), format, std::forward(args)...); | ~~~^~~~~~~~~~~~~~~~~~~ ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp: At global scope: ../../../addons/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.cpp:719:13: warning: ‘loadFontFace’ defined but not used [-Wunused-variable] 719 | static bool loadFontFace(string fontname, int _fontSize, FT_Face & face, string & filename){ | ^~~~ make[1]: [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:362:../../../addons/obj/linux64/Release/ofxTrueTypeFontUL2/src/ofxTrueTypeFontUL2.o] 错误 1 make[1]: 离开目录“/home/chenxin/disk1/github/openFrameworks/examples/templates/allAddonsExample” make: [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:131:Release] 错误 2 ---this should be addons error

dimitre commented 1 month ago

Yes this addon probably have to be modified to run corrrectly with latest openFrameworks

mathpopo commented 1 month ago

could you introduce me a ofx like ofxpango?

2bbb commented 1 month ago

@mathpop I think it's best to ask on the forum. https://forum.openframeworks.cc

danoli3 commented 1 month ago

I reckon we can do better with addons / management. I know there's a few solutions but if we can cook a solution into the c++ command line project generator and thus embed it also in the gui I think we will solve a lot of hassles. I'll side quest into project generator stuff while I sort out Android merge.

Lots of blocks we need to fix for the devs