This is awesome, and I hope I'll be programming on Linux come next season.
I'm trying to set up this toolchain on a 64-bit install of Archlinux, and I'm getting some errors after
- Running the build script for downloading and patching gcc for vxworks
- Editing the toolchain(changing gccdist to true, setting deploy ip)
- Creating a CMakeLists.txt file based off your example
- Running cmake
Maybe this is something of note: while running
Code:
cmake /home/azrathud/vxworks-c++-toolchain/project -DCMAKE_TOOLCHAIN_FILE=/home/
azrathud/vxworks-c++-toolchain/cmake_vxworks/vxworks_toolchain.cmake
Cmake outputs that CMAKE_TOOLCHAIN_FILE is not used
I'm trying to compile
last season's code which is in the src directory specified in the CMakeLists.txt
From the errors, I think gcc cannot find the header files in /usr/local/powerpc-wrs-vxworks/sys-include
Code:
In file included from /home/azrathud/vxworks-c++-toolchain/project/wpilib/ErrorBase.h:12:0,
from /home/azrathud/vxworks-c++-toolchain/project/wpilib/Commands/Command.h:10,
from /home/azrathud/vxworks-c++-toolchain/project/src/CommandBase.h:4,
from /home/azrathud/vxworks-c++-toolchain/project/src/CommandBase.cpp:1:
/home/azrathud/vxworks-c++-toolchain/project/wpilib/Error.h:13:21: fatal error: vxWorks.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/FRC_UserProgram.dir/src/CommandBase.cpp.o] Error 1
make[1]: *** [CMakeFiles/FRC_UserProgram.dir/all] Error 2
make: *** [all] Error 2
I included what I pulled from your WPIlib github repo in the CMakeLists.txt locally, but I looks like from your cmake toolchain file, that I should be placing them in the place under /local .. include/WPILib, yes? Also, I added the sys-include to the list of includes, but it didn't look like it did anything to help.
Code:
cmake_minimum_required(VERSION 2.8)
project(FRC)
aux_source_directory(./src FRC_SOURCES) # I'll just run cmake all the time to
# make sure new files are added
set(FRC_INCLUDES ${WPILIB_INCLUDE_DIR} wpilib ${TOOLCHAIN_PREFIX}/sys-include ) #defined by toolchain
set(FRC_LIBS ${WPILIB_LIBRARY}) # defined by toolchain
add_executable(FRC_UserProgram ${FRC_SOURCES})
set_target_properties(FRC_UserProgram PROPERTIES SUFFIX .out)
target_link_libraries(FRC_UserProgram ${FRC_LIBS})
include_directories(${FRC_INCLUDES})
I think the problem may relate to that I haven't compiled the wpilib into a shared library, like the toolchain suggests. (I have no ${TOOLCHAIN_PREFIX}/lib/libWPILib.a) How would I go about correctly including the patched WPILib and allow that to be linked correctly, etc?