Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:cpp:libraries:openframeworks [2015/10/09 18:55] alfred [Obtain information] |
wiki2:cpp:libraries:openframeworks [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 10: | Línea 10: | ||
| * **To add an addon after having created the project** you just need to include its name in the ''addons.make'' file. | * **To add an addon after having created the project** you just need to include its name in the ''addons.make'' file. | ||
| * To compile with **C++11** you need to go to ''libs/openFrameworksCompiled/project/makefileCommon'' path and edit the main makefile which is ''compile.project.mk''. You need to search for the rule that does the compilation and add: ''-std=c++0x''. | * To compile with **C++11** you need to go to ''libs/openFrameworksCompiled/project/makefileCommon'' path and edit the main makefile which is ''compile.project.mk''. You need to search for the rule that does the compilation and add: ''-std=c++0x''. | ||
| + | <code cpp> | ||
| + | $(OF_PROJECT_OBJ_OUPUT_PATH)%.o: $(PROJECT_ROOT)/%.cpp | ||
| + | @echo "Compiling" $< | ||
| + | @mkdir -p $(@D) | ||
| + | $(CXX) -c $(OPTIMIZATION_CFLAGS) $(CFLAGS) $(CXXFLAGS) -std=c++0x -MMD -MP -MF $(OF_PROJECT_OBJ_OUPUT_PATH)$*.d -MT $(OF_PROJECT_OBJ_OUPUT_PATH)$*.o -o $@ -c $< | ||
| + | </code> | ||
| + | * Muy probablemente quieras usar otras libs, las tendrías que añadir también en el makefile: | ||
| + | <code cpp> | ||
| + | $(TARGET): $(OF_PROJECT_OBJS) $(OF_PROJECT_ADDONS_OBJS) $(OF_PROJECT_LIBS) $(TARGET_LIBS) | ||
| + | @echo 'Linking $(TARGET) for $(ABI_LIB_SUBPATH)' | ||
| + | @mkdir -p $(@D) | ||
| + | $(CXX) -o $@ $(OF_PROJECT_OBJS) $(OF_PROJECT_ADDONS_OBJS) $(TARGET_LIBS) $(OF_PROJECT_LIBS) $(LDFLAGS) $(OF_CORE_LIBS) -lboost_system -lboost_timer -lboost_thread | ||
| + | </code> | ||
| ===== Useful data ===== | ===== Useful data ===== | ||
| ==== Obtain information ==== | ==== Obtain information ==== | ||
| Línea 32: | Línea 45: | ||
| Crear un listener de UDP: | Crear un listener de UDP: | ||
| <code cpp> | <code cpp> | ||
| + | #include "ofxNetwork.h" | ||
| + | |||
| ofxUDPManager udpConnection; | ofxUDPManager udpConnection; | ||
| Línea 46: | Línea 61: | ||
| * https://github.com/jefftimesten/ofxJSON | * https://github.com/jefftimesten/ofxJSON | ||
| <code cpp> | <code cpp> | ||
| + | #include "ofxJSON.h" | ||
| + | ... | ||
| ofxJSONElement result; | ofxJSONElement result; | ||
| std::string url = "http://127.0.0.1:5000/sketch/1"; | std::string url = "http://127.0.0.1:5000/sketch/1"; | ||