Error compiling gstreamer app in petalinux - gstreamer

I'm trying to compile a custom gstreamer app in petalinux with the next header files:
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
#include <gio/gio.h>
The petalinux project already has the sysroot library sources populated after run:
petalinux-build --sdk
petalinux-package --sysroot
But compiling the app (petalinux-build -c myapp) I've got the next error:
| myapp.c:25:10: fatal error: gst/gst.h: No such file or directory
| #include <gst/gst.h>
| ^~~~~~~~~~~
| compilation terminated.
The make file is:
APP = myapp
# Add any other object files to this list below
APP_OBJS = myapp.o
all: build
build: $(APP)
$(APP): $(APP_OBJS)
$(CC) $(LDFLAGS) -o $# $(APP_OBJS) $(LDLIBS)
clean:
-rm -f $(APP) *.elf *.gdb *.o
%.o : %.c
$(CC) -c $(CFLAGS) -o $# $< $(shell pkg-config --cflags --libs gstreamer-1.0 glib-2.0)
And the recipe:
#
# This file is the myapp recipe.
#
SUMMARY = "Simple myapp application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://myapp .c \
file://Makefile \
"
S = "${WORKDIR}"
do_compile() {
oe_runmake
}
do_install() {
install -d ${D}${bindir}
install -m 0755 myapp ${D}${bindir}
Does anyone have an idea what I'm missing and how to add correctly the gstreamer paths for compilation?
EDIT
As suggested I added the DEPENDS line in the recipe:
#
# This file is the myapp recipe.
#
SUMMARY = "Simple myapp application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://myapp .c \
file://Makefile \
"
S = "${WORKDIR}"
DEPENDS = "glib-2.0 gstreamer1.0"
RDEPENDS_${PN} = "gstreamer1.0-plugins-base gstreamer1.0-plugins-good"
do_compile() {
oe_runmake
}
do_install() {
install -d ${D}${bindir}
install -m 0755 myapp ${D}${bindir}
But unfortunately still giving same error...any ideas what could be wrong/missing?
Thanks in advance.

I think you are missing the DEPENDS pointing to the GStreamer packages needed to get you code compiled. Having them at the image is not enough to have this recipe build.
You could take a look at the recipe to build the RTSP server of GStreamer (http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.16.1.bb?h=master)
DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base"

I finally got it working, what I've done is instead to use the makefile to compile , is to use the recipe and more importantly to add inherit pkgconfig line, in order to force to populate sysroot during compilation, this is the final working recipe, hope it can help to someone else with same issue:
#
# This file is the myapp recipe.
#
SUMMARY = "Simple myapp application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://myapp .c \
file://Makefile \
"
S = "${WORKDIR}"
DEPENDS = "glib-2.0 gstreamer1.0"
RDEPENDS_${PN} = "gstreamer1.0-plugins-base gstreamer1.0-plugins-good"
inherit pkgconfig
do_compile() {
${CC} ${WORKDIR}/myapp.c -o myapp ${CFLAGS} ${LDFLAGS} `pkg-config --cflags --libs gstreamer-1.0`
}
do_install() {
install -d ${D}${bindir}
install -m 0755 myapp ${D}${bindir}
}

Related

Makefile error when building Veins project with Omnet++

I've built a number of projects with Veins on Omnet++ without issues at this stage, and I decided to implement CAM messages into a simulation. However, upon building I arrive at the following error:
12:41:23 **** Incremental Build of configuration release for project v2x ****
make MODE=release all
cd src && make make[1]: Entering directory '/home/veins/workspace.omnetpp/v2x/src'
Creating executable: ../out/clang-release/src/v2x /usr/bin/ld: cannot open output file ../out/clang-release/src/v2x: Is a directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]:
*** [Makefile:117: ../out/clang-release/src/v2x] Error 1 make[1]: Leaving directory '/home/veins/workspace.omnetpp/v2x/src'
make: *** [Makefile:2: all]
Error 2 "make MODE=release all" terminated with exit code 2.
Build might be incomplete.
12:41:24 Build Failed. 3 errors, 0 warnings. (took 549ms)
My Makefile reads:
#
# OMNeT++/OMNEST Makefile for v2x
#
# This file was generated with the command:
# opp_makemake -f --deep -KINET_PROJ=/home/veins/src/inet -KLTE_PROJ=/home/veins/src/simulte -KVEINS_INET_PROJ=/home/veins/src/veins/subprojects/veins_inet -KVEINS_PROJ=/home/veins/src/veins -DINET_IMPORT -DVEINS_IMPORT -DVEINS_INET_IMPORT -I$$\(INET_PROJ\)/src -I$$\(LTE_PROJ\)/src -I$$\(VEINS_INET_PROJ\)/src -I$$\(VEINS_PROJ\)/src -I. -L$$\(INET_PROJ\)/src -L$$\(LTE_PROJ\)/src -L$$\(VEINS_PROJ\)/src -L$$\(VEINS_INET_PROJ\)/src -lINET$$\(D\) -llte$$\(D\) -lveins$$\(D\) -lveins_inet$$\(D\)
#
# Name of target to be created (-o option)
TARGET_DIR = .
TARGET_NAME = v2x$(D)
TARGET = $(TARGET_NAME)$(EXE_SUFFIX)
TARGET_IMPLIB = $(TARGET_NAME)$(IMPLIB_SUFFIX)
TARGET_IMPDEF = $(TARGET_NAME)$(IMPDEF_SUFFIX)
TARGET_FILES = $(TARGET_DIR)/$(TARGET)
# User interface (uncomment one) (-u option)
USERIF_LIBS = $(ALL_ENV_LIBS) # that is, $(TKENV_LIBS) $(QTENV_LIBS) $(CMDENV_LIBS)
#USERIF_LIBS = $(CMDENV_LIBS)
#USERIF_LIBS = $(TKENV_LIBS)
#USERIF_LIBS = $(QTENV_LIBS)
# C++ include paths (with -I)
INCLUDE_PATH = -I$(INET_PROJ)/src -I$(LTE_PROJ)/src -I$(VEINS_INET_PROJ)/src -I$(VEINS_PROJ)/src -I.
# Additional object and library files to link with
EXTRA_OBJS =
# Additional libraries (-L, -l options)
LIBS = $(LDFLAG_LIBPATH)$(INET_PROJ)/src $(LDFLAG_LIBPATH)$(LTE_PROJ)/src $(LDFLAG_LIBPATH)$(VEINS_PROJ)/src $(LDFLAG_LIBPATH)$(VEINS_INET_PROJ)/src -lINET$(D) -llte$(D) -lveins$(D) -lveins_inet$(D)
# Output directory
PROJECT_OUTPUT_DIR = ../out
PROJECTRELATIVE_PATH = src
O = $(PROJECT_OUTPUT_DIR)/$(CONFIGNAME)/$(PROJECTRELATIVE_PATH)
# Object files for local .cc, .msg and .sm files
OBJS = \
$O/v2x/GeneralMessageSerializer.o \
$O/v2x/VeinsInetApplicationBase.o \
$O/v2x/VeinsInetManager.o \
$O/v2x/VeinsInetManagerBase.o \
$O/v2x/VeinsInetManagerForker.o \
$O/v2x/VeinsInetMobility.o \
$O/v2x/VeinsInetSampleApplication.o \
$O/v2x/VeinsInetSampleMessageSerializer.o \
$O/v2x/GeneralMessage_m.o \
$O/v2x/VeinsInetSampleMessage_m.o
# Message files
MSGFILES = \
v2x/GeneralMessage.msg \
v2x/VeinsInetSampleMessage.msg
# SM files
SMFILES =
# Other makefile variables (-K)
INET_PROJ=/home/veins/src/inet
LTE_PROJ=/home/veins/src/simulte
VEINS_INET_PROJ=/home/veins/src/veins/subprojects/veins_inet
VEINS_PROJ=/home/veins/src/veins
#------------------------------------------------------------------------------
# Pull in OMNeT++ configuration (Makefile.inc)
ifneq ("$(OMNETPP_CONFIGFILE)","")
CONFIGFILE = $(OMNETPP_CONFIGFILE)
else
CONFIGFILE = $(shell opp_configfilepath)
endif
ifeq ("$(wildcard $(CONFIGFILE))","")
$(error Config file '$(CONFIGFILE)' does not exist -- add the OMNeT++ bin directory to the path so that opp_configfilepath can be found, or set the OMNETPP_CONFIGFILE variable to point to Makefile.inc)
endif
include $(CONFIGFILE)
# Simulation kernel and user interface libraries
OMNETPP_LIBS = $(OPPMAIN_LIB) $(USERIF_LIBS) $(KERNEL_LIBS) $(SYS_LIBS)
ifneq ($(PLATFORM),win32.x86_64)
LIBS += -Wl,-rpath,$(abspath $(INET_PROJ)/src) -Wl,-rpath,$(abspath $(LTE_PROJ)/src) -Wl,-rpath,$(abspath $(VEINS_PROJ)/src) -Wl,-rpath,$(abspath $(VEINS_INET_PROJ)/src)
endif
COPTS = $(CFLAGS) $(IMPORT_DEFINES) -DINET_IMPORT -DVEINS_IMPORT -DVEINS_INET_IMPORT $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)
SMCOPTS =
# we want to recompile everything if COPTS changes,
# so we store COPTS into $COPTS_FILE (if COPTS has changed since last build)
# and make the object files depend on it
COPTS_FILE = $O/.last-copts
ifneq ("$(COPTS)","$(shell cat $(COPTS_FILE) 2>/dev/null || echo '')")
$(shell $(MKPATH) "$O")
$(file >$(COPTS_FILE),$(COPTS))
endif
#------------------------------------------------------------------------------
# User-supplied makefile fragment(s)
-include makefrag
#------------------------------------------------------------------------------
# Main target
all: $(TARGET_FILES)
$(TARGET_DIR)/% :: $O/%
#mkdir -p $(TARGET_DIR)
$(Q)$(LN) $< $#
ifeq ($(TOOLCHAIN_NAME),clang-msabi)
-$(Q)-$(LN) $(<:%.dll=%.lib) $(#:%.dll=%.lib) 2>/dev/null
endif
$O/$(TARGET): $(OBJS) $(wildcard $(EXTRA_OBJS)) Makefile $(CONFIGFILE)
#$(MKPATH) $O
#echo Creating executable: $#
$(Q)$(CXX) $(LDFLAGS) -o $O/$(TARGET) $(OBJS) $(EXTRA_OBJS) $(AS_NEEDED_OFF) $(WHOLE_ARCHIVE_ON) $(LIBS) $(WHOLE_ARCHIVE_OFF) $(OMNETPP_LIBS)
.PHONY: all clean cleanall depend msgheaders smheaders
.SUFFIXES: .cc
$O/%.o: %.cc $(COPTS_FILE) | msgheaders smheaders
#$(MKPATH) $(dir $#)
$(qecho) "$<"
$(Q)$(CXX) -c $(CXXFLAGS) $(COPTS) -o $# $<
%_m.cc %_m.h: %.msg
$(qecho) MSGC: $<
$(Q)$(MSGC) -s _m.cc -MD -MP -MF $O/$(basename $<)_m.h.d $(MSGCOPTS) $?
%_sm.cc %_sm.h: %.sm
$(qecho) SMC: $<
$(Q)$(SMC) -c++ -suffix cc $(SMCOPTS) $?
msgheaders: $(MSGFILES:.msg=_m.h)
smheaders: $(SMFILES:.sm=_sm.h)
clean:
$(qecho) Cleaning $(TARGET)
$(Q)-rm -rf $O
$(Q)-rm -f $(TARGET_FILES)
$(Q)-rm -f $(call opp_rwildcard, . , *_m.cc *_m.h *_sm.cc *_sm.h)
cleanall:
$(Q)$(CLEANALL_COMMAND)
$(Q)-rm -rf $(PROJECT_OUTPUT_DIR)
help:
#echo "$$HELP_SYNOPSYS"
#echo "$$HELP_TARGETS"
#echo "$$HELP_VARIABLES"
#echo "$$HELP_EXAMPLES"
# include all dependencies
-include $(OBJS:%=%.d) $(MSGFILES:%.msg=$O/%_m.h.d)
It's correct in saying that clang-release/src/v2x is a directory, but it has always been so (even before making the recent changes) and it hasn't produced this error.
Other than the MakeFile error, there is no other error in any of the scripts for the project.
You want to create the executable file clang-release/src/v2x but you can't because that file already exists and is a directory.
The name of the file you attempt to create is
v2x$(D)$(EXE_SUFFIX) and nowhere in your Makefile do you have Make variables D or EXE_SUFFIX defined, so they evaluate to empty strings.
Probably you want to make sure you have D and EXE_SUFFIX defined somewhere.
There is a $(CONFIGFILE) you are including, Make finds it but you did not provide the text of it, check if these variables should be defined in there but are not.

Issue while linking GLFW3 precompiled Libs to C++ Project using Makefile

following issue: i'm currently working on some small c++ project, and i use imgui for the user interface. For that to work tho, i also need glfw(3). So i downloaded both the precompiled headers for osx and windows (https://www.glfw.org/download). And i added them to my project.
+---shared
+---lib
\---glfw
+---osx
| libglfw.3.dylib
| libglfw3.a
|
\---win
glfw3.dll
libglfw3.a
libglfw3dll.a
The next step (at least what i tried) was adding the lib .a file in the linkin process after creating the object files from my own sourcecode. I did this by specifying the -Lshared/lib/glfw/$(OS) path as well as the -lglfw3 flag. I did not get an error from those two. But when i run the linker, i get the following error message:
g++ -g -Wall -c -o src/core/src/main.o src/core/src/main.cpp
g++ -g -Wall -Ishared/include -Lshared/lib/glfw/win -lglfw3 -o bin/core src/core/src/main.o
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/core/src/main.o:C:\Users\REDACTED\Desktop\LS/src/core/src/main.cpp:10: undefined reference to `glfwSetErrorCallback'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:78: core] Error 1
As far as i understand, this means that the linking of the library was not successfull.
( the code from src/core/src/main.cpp for completeness )
#include <stdio.h>
#include "../../../shared/include/glfw/glfw3.h"
static void glfw_error_callback(int error, const char *description)
{
}
int main(int argc, char *argv[])
{
glfwSetErrorCallback(glfw_error_callback);
printf("Hello World!\n");
return 0;
}
makefile code:
# ------------------------
# --- Global Settings ----
# ------------------------
CC = g++
# --------------------
# --- Common Flags ---
# --------------------
CFLAGS = -g -Wall
LDFLAGS = -I$(INCLUDE)
# Add correct glfw bins for either windows or osx
ifeq ($(OS), Windows_NT)
LDFLAGS += -L$(LIB)/glfw/win
else
LDFLAGS += -L$(LIB)/glfw/osx
endif
LDFLAGS += -lglfw3
# --------------
# --- Paths ----
# --------------
SRC = src
SHARED = shared
INCLUDE = $(SHARED)/include
LIB = $(SHARED)/lib
BIN = bin
DOCS = docs
# ---------------------
# --- Project Paths ---
# ---------------------
pCORE = $(SRC)/core
pIMPORTER = $(SRC)/importer
pEXPORTER = $(SRC)/exporter
pPROCESSOR = $(SRC)/processor
pUNIVERSALCLIENT = $(SRC)/universalclient
# --------------------------
# --- Housekeeping Tasks ---
# --------------------------
clean:
ifeq ($(OS), Windows_NT)
-del /s /q *.o
-rmdir /s /q $(BIN)
else
-find . -type f -name '*.o' -exec rm -f {} \;
-rm -rf $(BIN)
endif
clean_objs:
ifeq ($(OS), Windows_NT)
-del /s /q *.o
else
-find . -type f -name '*.o' -exec rm -f {} \;
-rm -rf $(BIN)
endif
setup:
ifeq ($(OS), Windows_NT)
-mkdir $(BIN)
else
-mkdir -p $(BIN)
endif
# ------------------------------------
# --- Shared Libraries Build Rules ---
# ------------------------------------
# ---------------------------
# --- Project Build Rools ---
# ---------------------------
pCORE_SRC = $(wildcard $(pCORE)/src/*.cpp)
pCORE_OBJ = $(patsubst %.cpp, %.o, $(pCORE_SRC))
core: $(pCORE_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN)/core $^
$(pCORE_OBJ): $(pCORE_SRC)
$(CC) $(CFLAGS) -c -o $# $<
i worked myself through many documentations on how to link a library. Does someone understand whats going wrong or could someone explain it to me?
( regarding cmake: please don't ask - i can't use it for this project )

SCons: Make sure a library gets built before a program

I'm trying to port my wayland compositor from make to scons, but I'm having trouble with the build order. I need xdg-shell-protocol to be generated with wayland-scanner and built before anything else. With make, something like this is all it takes:
WLSCAN_INFO = #echo " WLSCAN " $#;
CC_INFO = #echo " CC " $#;
CFLAGS= -g \
-Werror \
-I. \
-DWLR_USE_UNSTABLE
LIBS = "-Lxdg-shell-protocol.h" \
$(shell pkg-config --cflags --libs wlroots) \
$(shell pkg-config --cflags --libs wayland-server) \
$(shell pkg-config --cflags --libs xkbcommon) \
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
XDG_SHELL_DEPS = xdg-shell-protocol.c xdg-shell-protocol.h
xdg-shell-protocol.h:
$(WLSCAN_INFO)$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $#
xdg-shell-protocol.c: xdg-shell-protocol.h
$(WLSCAN_INFO)$(WAYLAND_SCANNER) private-code \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $#
OBJS = \
xdg-shell-protocol.o \
output.o \
renderer.o \
input.o \
xdg.o \
cursor.o \
keyboard.o \
main.o
%.o: %.c xdg-shell-protocol.h
$(CC_INFO)$(CC) $(CFLAGS) -c $(LIBS) -o $# $<
wlc: $(OBJS)
$(CC_INFO)$(CC) $(CFLAGS) $(LIBS) -o $# $(OBJS)
clean:
rm -f wlc $(XDG_SHELL_DEPS) *.o
.DEFAULT_GOAL = wlc
.PHONY: wlc clean
With scons, I tried this:
CCFLAGS = "-fdiagnostics-color=always -g -Werror -DWLR_USE_UNSTABLE"
CPPPATH = ["./", "./include"]
env = Environment()
env.Append(CCFLAGS = CCFLAGS)
env.Append(CPPPATH = ["./", "./include"])
env.ParseConfig("pkg-config --cflags --libs wlroots")
env.ParseConfig("pkg-config --cflags --libs wayland-server")
env.ParseConfig("pkg-config --cflags --libs xkbcommon")
env.Command( source = "",
target = "xdg-shell-protocol.h",
action = "`pkg-config --variable=wayland_scanner wayland-scanner` server-header \
`pkg-config --variable=pkgdatadir wayland-protocols`/stable/xdg-shell/xdg-shell.xml \
$TARGET"
)
env.Command( source = "",
target = "xdg-shell-protocol.c",
action = "`pkg-config --variable=wayland_scanner wayland-scanner` private-code \
`pkg-config --variable=pkgdatadir wayland-protocols`/stable/xdg-shell/xdg-shell.xml \
$TARGET"
)
xdg_shell_protocol = env.Library(
target = "xdg-shell-protocol",
source = [
"xdg-shell-protocol.h",
"xdg-shell-protocol.c"
]
)
wlc = env.Program(
target = "wlc",
source = [
Glob("input/*"),
Glob("output/*"),
Glob("shell/*"),
"main.c",
],
LIBS=[xdg_shell_protocol], LIBPATH="."
)
env.Depends(wlc, "xdg-shell-protocol.h")
)
But wlc always gets built before xdg_shell_protocol, and ends up failing because xdg-shell-protocol.h hasn't been generated yet. I also tried:
Defining an explicit dependency by adding env.Depends(wlc, "xdg-shell-protocol.h") or env.Depends(wlc, xdg_shell_protocol) at the end,
Setting LIBS = ["xdg-shell-protocol"] in wlc,
Not using Library and just adding xdg-shell-protocol.h and xdg-shell-protocol.c to the beginning of source in wlc.
But main.c or some other source file always ends up being compiled first and fails because xdg-shell-protocol.h doesn't exist yet.
What am I doing wrong?
EDIT:
Expanded ... above (note that the makefile is from before I moved source files to subdirectories, which was the main reason I decided to change build systems).
Output of $ scons --tree=prune
Please post the full file, the '...''s may be relevant.
Do any of your Command()'s specify the source argument?
What's line 1 of: include/shell/xdg.h ?
try adding this line
env.Depends('input/cursor.c', 'xdg-shell-protocol.h')
NOTE: This is not a good solution, but will help figure out what the issue is.
Now.. Try changing your Program(..) to this, and remove your explicit Depends().
cpppath = env['CPPPATH'] + ['/usr/include']
wlc = env.Program(
target = "wlc",
source = [
Glob("input/*"),
Glob("output/*"),
Glob("shell/*"),
"main.c",
],
LIBS=[xdg_shell_protocol],
CPPPATH=cpppath,
)
The problem is caused by the source scanner not seeing the dependency on xdg-shell-protocol.h because it comes from including /usr/include/wlr/types/wlr_xdg_shell.h, which wouldn't normally be scanned (this was the genesis of the suggestion above to add /usr/include to CPPPATH but that didn't seem to be good enough), and thus you don't get the order you would - forcing that header to get generated early - if it noticed that dependency. From your workaround, I think you can simplify to just this:
env.Depends("include/shell/xdg.h", "xdg-shell-protocol.h")
Which may still end up not being the prettiest answer...
Apparently I have to define the explicit dependency for each source file:
wlc_source = [
"main.c",
Glob("input/*.c"),
Glob("output/*.c"),
Glob("shell/*.c"),
]
for source in wlc_source:
env.Depends(source, xdg_shell_protocol)
wlc = env.Program(
target = "wlc",
source = wlc_source
)
This fixes the issue, but I don't think this is the best solution.

The L6218E Error when calling VxGUI Constructor

I am trying to compile using Vrxcc Compiler in VeriFone sdk.
when i want to create a graphical application for Vx675 pose Payment, The compiler show this error
error : L6218E: Undefined symbol VxGUI::VxGUI() (referred from Main.o)
Main.cpp is
#include <stdio.h>
#include <svc.h>
#include <svc_gui.h>
void main()
{
VxGUI *m_GUIObj;
m_GUIObj = new VxGUI();
}
And the MakeFile is
#
################### Paths ##################
#
ACTIncludes = $(EVOACT)include
EOSIncludes = $(EOSSDK)\include
GUIIncludes = $(GUISDK)\Include
CardslotInclude=$(VCARDSLOT)\Include
DTKTOOLS=C:\eVoAps\Tools
################### App Source Paths ##################
SrcDir = .
################### Compiler/Linker/Outhdr Output Paths ##################
ObjDir = .\vobj
OutDir = .\vbin
###################for release...##################
ACTStaticLibraries = $(EVOACT)\Output\RV\Files\Static\Release
ACTSharedLibraries = $(EVOACT)\OutPut\RV\Files\Shlib1\Release
VMACLibraries = $(EVOVMAC)\Output\RV\Lib\Files\Debug
EOSLibararuies = $(EOSSDK)\lib
GUISDKLibraries= $(GUISDK)\lib
VRXSDKLobraries= $(EVOSDK)\lib
VCARDSLOTLobraries= $(VCARDSLOT)\Output\RV\Files\Static
#
######################### Options for Tools ########################
#
############# Compiler Options ############
Includes = -I$(ACTIncludes) -I$(EOSIncludes) -I$(GUIIncludes) -I$(CardslotInclude)
# for release version change the COptions to
#COptions = -DLOGSYS_FLAG -DVERIFONE
COptions = -D_VERIFONE -DVERIFONE -DEVO -p -W -D ARM -D _ARM -g -D _MAKE_VX_
VRXHDRPARAM= -s 300000 -h 4000000
#
######################### Dependencies ########################
#
AppObjects = $(ObjDir)\Main.o
#Using ACT static library.
ACTLibs = \
$(ACTStaticLibraries)\act2000.a \
$(EOSLibararuies)\CEIF.o \
$(EOSLibararuies)\svc_net.o \
$(EOSLibararuies)\elog.o \
$(GUISDKLibraries)\libvxguisdk.so
#
######################### sample Target Definition ########################
#
pseudoOut : $(OutDir)\Hello.out
$(EVOSDK)\bin\vrxhdr $(VRXHDRPARAM) -l ceif.lib=N:/ceif.lib -l net.lib=N:/net.lib -l elog.lib=N:/elog.lib $(OutDir)\Hello.out
$(OutDir)\Hello.out : $(AppObjects)
$(EVOSDK)\bin\vrxcc -map -p $(AppObjects) $(ACTLibs) -o Hello.out
move Hello.out $(OutDir)
del /F /Q $(ObjDir)\*.o
######################## Compile #########################
$(ObjDir)\Main.o : $(SrcDir)\Main.cpp
$(EVOSDK)\bin\vrxcc -c $(Includes) $(COptions) $(SrcDir)\Main.cpp -e"-" | "$(DTKTOOLS)\fmterrorARM.exe"
move Main.o $(ObjDir)\Main.o
please help me to resolve this problem.
Have fixed the problem above?
If not, please pay attention that, when you use the libvxgui, you must use C++ syntax and generate a .vso file instead of .out bin file.
insert the -vsoapp option in the CC and Link options and the output must be .vso file.
COptions = -g -b -p -vsoapp -map -armcc,"--diag_suppress 1300\,611\,9,--apcs=/fpic --export_all_vtbl" -DLOGSYS_FLAG -DLOGSYS_NEW_API_STYLE
LOptions = -g -p -vsoapp -b -k -map
$(VRXSDK)/bin/vrxcc $(LOptions) $(AppObjects) $(Libs) -o $#
$(VRXSDK)/bin/vrxhdr -s $(STACK_SIZE) -h $(HEAP_SIZE) -lnet.lib=N:/net.lib -lceif.lib=N:/ceif.lib -lssl.lib=N:/ssl.lib -lelog.lib=N:/elog.lib $(OutDir)/$(OutFile)
$(ObjDir)/%.o: $(SrcFiles)/%.c
$(VRXSDK)/bin/vrxcc -c $(COptions) $(Includes) $< -o $#
$(ObjDir)/%.o: $(SrcFiles)/%.cpp
$(VRXSDK)/bin/vrxcc -c $(COptions) $(Includes) $< -o $#
I have used VxGUI and including with QT Objects with success.
If you have more problems, let me know. I can send a working project to you.
Best regards,
Leandro

CMake compile-time defines

I am new to using CMake and am attempting to transfer our previous Makefiles into CMakeLists. I have one file, *dsplink_defines.txt* that has the following compile-time defines.
*-DOS_LINUX -DMAX_DSPS=1 -DMAX_PROCESSORS=2 -DID_GPP=1 -DOMAPL1XX -DPROC_COMPONENT -DPOOL_COMPONENT -DNOTIFY_COMPONENT -DMPCS_COMPONENT -DRINGIO_COMPONENT -DMPLIST_COMPONENT -DMSGQ_COMPONENT -DMSGQ_ZCPY_LINK -DCHNL_COMPONENT -DCHNL_ZCPY_LINK -DZCPY_LINK -DKFILE_DEFAULT -DDA8XXGEM -DDA8XXGEM_PHYINTERFACE=SHMEM_INTERFACE -DGPP_SWI_MODE -D_REENTRANT -DVERIFY_DATA -DDDSP_DEBUG*
Our previous Makefile took care of this in the following manner and took care of this by using shell cat starting on line 8:
BIN = ../../build/bin
TMP = build
BUILD_DEF = -DBUILD=$(BUILD_VERSION) -DBUILD_DATE=$(BUILD_DATE)
# these files are captured from the DSPLink Sample build directory (and the named changed)
# they contain the appropriate includes and flags to build a dsplink application.
DSPLINK_INCLUDES = $(shell cat ../dsplink_config/dsplink_includes.txt)
DSPLINK_FLAGS = $(shell cat ../dsplink_config/dsplink_flags.txt)
DSPLINK_DEFINES = $(shell cat ../dsplink_config/dsplink_defines.txt)
DSPLINK_LIBS = $(DSPLINK_PACKAGE_DIR)/dsplink/gpp/export/BIN/Linux/OMAPL1XX/RELEASE/dsplink.lib
#Our project variables
INCLUDE = -I../framework -I../io_master -I../logging -I../../dsp/include - I../flagDictionary
#TOOLCHAIN = ${FACTORY_DIR}/build_armv5l-timesys-linux-uclibcgnueabi/toolchain/bin
TOOLCHAIN = /OMAP-L137/timesys/SDK/omapl137_evm/toolchain/bin
PLATFORM=armv5l-timesys-linux-uclibcgnueabi
#Compile Options
CC=$(TOOLCHAIN)/$(PLATFORM)-g++
LINKER=$(TOOLCHAIN)/$(PLATFORM)-g++
CFLAGS+= $(BUILD_DEF) $(INCLUDE) $(DSPLINK_DEFINES) $(DSPLINK_FLAGS) $(DSPLINK_INCLUDES)
DEBUG = -O
#list of things to compile.
FW_BUILD_DIR=../framework/build
LOG_BUILD_DIR=../logging/build
FLAG_DICT_BUILD_DIR=../flagDictionary/build
FRAMEWORK_OBJECTS= $(FW_BUILD_DIR)/com.o \
$(FW_BUILD_DIR)/application.o \
$(FW_BUILD_DIR)/memoryManagerBase.o \
$(FW_BUILD_DIR)/memoryManager.o \
$(FW_BUILD_DIR)/arguments.o \
$(FW_BUILD_DIR)/lockManager.o \
$(FW_BUILD_DIR)/controlCom.o \
$(FW_BUILD_DIR)/paths.o \
$(LOG_BUILD_DIR)/subsystemLogMasks.o \
$(LOG_BUILD_DIR)/logger.o
FLAG_DICT_OBJECTS= $(FLAG_DICT_BUILD_DIR)/flagEntry.o \
$(FLAG_DICT_BUILD_DIR)/flagDictionary.o
OBJECTS = spidev_test.o sysMon.o
EXES = sysMon
all: $(OBJECTS) $(EXES)
.c.o:
mkdir -p build
$(CC) -c $(CFLAGS) $(DEBUG) -o $(TMP)/$# $<
.cpp.o:
mkdir -p build
$(CC) -c $(CFLAGS) $(DEBUG) -o $(TMP)/$# $<
spidev_test: $(FRAMEWORK_OBJECTS) spidev_test.o
$(LINKER) -lpthread -lc -o $(BIN)/$# $(DSPLINK_LIBS) build/spidev_test.o $(FRAMEWORK_OBJECTS)
sysMon: $(FRAMEWORK_OBJECTS) sysMon.o
$(LINKER) -lpthread -lc -o $(BIN)/$# $(DSPLINK_LIBS) build/sysMon.o $(FLAG_DICT_OBJECTS) $(FRAMEWORK_OBJECTS)
deploy:
../../build/deploy
How do I pass these in using a CMakeList
This should work:
file(READ path/to/dsplink_defines.txt defines) #read file into variable 'defines'
string(REPLACE " " ";" defines "${defines}") #turn space separation into CMake list
add_definitions(${defines})
Of course, if you have full control of the file and can change its format to use semicolons for separation instead of spaces, you can do that and skip the string() line (probably speeding up your CMake processing a little bit by this).