How to compile Allegro 4.9.14 using CMake 2.8 - c++

I have never compiled programs using CMake. I have downloaded the latest SVN of Allegro and tried compiling it multiple times, but no luck. I have looked allover the internet and have not found anything helpful. I have chosen to compile it for Visual Studio 9 2008. I don't really know where I have to link the source and the build. The Allegro files are confusing. I don't know if this can be useful, but I also got a hold of the lib files. If anyone knows how I should link the files to properly compile, I would be very glad.
Here is the CMakeCash.Text content:
# This is the CMakeCache file.
# For build in directory: c:/lib/Allegro4.9
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
########################
# INTERNAL cache entries
########################
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=c:/lib/Allegro4.9
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=0
Also, here is the event list, the error is bound to be found inside:
Check for working C compiler: cl
Check for working C compiler: cl -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: cl
Check for working CXX compiler: cl -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Guessed MSVC directory: cl
Allowing MSVC to use SSE instructions
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - not found
Looking for stddef.h
Looking for stddef.h - found
Check size of unsigned short
Check size of unsigned short - done
Using unsigned short
Check if the system is big endian - little endian
Looking for include files ALLEGRO_HAVE_DIRENT_H
Looking for include files ALLEGRO_HAVE_DIRENT_H - not found.
Looking for include files ALLEGRO_HAVE_INTTYPES_H
Looking for include files ALLEGRO_HAVE_INTTYPES_H - not found.
Looking for include files ALLEGRO_HAVE_LINUX_JOYSTICK_H
Looking for include files ALLEGRO_HAVE_LINUX_JOYSTICK_H - not found.
Looking for include files ALLEGRO_HAVE_STDBOOL_H
Looking for include files ALLEGRO_HAVE_STDBOOL_H - not found.
Looking for include files ALLEGRO_HAVE_STDINT_H
Looking for include files ALLEGRO_HAVE_STDINT_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_IO_H
Looking for include files ALLEGRO_HAVE_SYS_IO_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_STAT_H
Looking for include files ALLEGRO_HAVE_SYS_STAT_H - found
Looking for include files ALLEGRO_HAVE_SYS_TIME_H
Looking for include files ALLEGRO_HAVE_SYS_TIME_H - not found.
Looking for include files ALLEGRO_HAVE_TIME_H
Looking for include files ALLEGRO_HAVE_TIME_H - found
Looking for include files ALLEGRO_HAVE_SYS_UTSNAME_H
Looking for include files ALLEGRO_HAVE_SYS_UTSNAME_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_TYPES_H
Looking for include files ALLEGRO_HAVE_SYS_TYPES_H - found
Looking for include files ALLEGRO_HAVE_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_SYS_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_SYS_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_MACHINE_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_MACHINE_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_LINUX_SOUNDCARD_H
Looking for include files ALLEGRO_HAVE_LINUX_SOUNDCARD_H - not found.
Looking for include files ALLEGRO_HAVE_OSATOMIC_H
Looking for include files ALLEGRO_HAVE_OSATOMIC_H - not found.
Looking for getexecname
Looking for getexecname - not found
Looking for mkstemp
Looking for mkstemp - not found
Looking for mmap
Looking for mmap - not found
Looking for mprotect
Looking for mprotect - not found
Looking for sched_yield
Looking for sched_yield - not found
Looking for stricmp
Looking for stricmp - found
Looking for strlwr
Looking for strlwr - found
Looking for strupr
Looking for strupr - found
Looking for sysconf
Looking for sysconf - not found
Looking for fseeko
Looking for fseeko - not found
Looking for ftello
Looking for ftello - not found
Check size of _Bool
Check size of _Bool - failed
Performing Test ALLEGRO_HAVE_PROCFS_ARGCV
Performing Test ALLEGRO_HAVE_PROCFS_ARGCV - Failed
Performing Test ALLEGRO_HAVE_SV_PROCFS_H
Performing Test ALLEGRO_HAVE_SV_PROCFS_H - Failed
Performing Test ALLEGRO_HAVE_VA_COPY
Performing Test ALLEGRO_HAVE_VA_COPY - Failed
Check if constructors are supported - no
Could NOT find DINPUT (missing: DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
CMake Error at CMakeLists.txt:565 (message):
Windows port requires DirectInput (not found).
Configuring incomplete, errors occurred!

If cmake is failing, it should tell you what went wrong, ie: if you're missing required dependencies.
Please post the actual errors you see from cmake, and/or the compiler if cmake itself didn't fail.
edit:
There you go, your errors:
Could NOT find DINPUT (missing: DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
CMake Error at CMakeLists.txt:565 (message):
Windows port requires DirectInput (not found).
That's a common issue and is fixed in newer releases. 4.9.14 is ancient. Please upgrade to the latest release, or even straight from SVN.

First, run cmake from the MSVC command prompt, not the regular command prompt. Then set the INCLUDE and LIB environment variables to point to your directx installation. For example:
set INCLUDE=C:\Program Files\Microsoft DirectX SDK (August 2009)\Include
set LIB=C:\Program Files\Microsoft DirectX SDK (August 2009)\lib\x86
Notice the lack of quotes ("). Do not use quotes. Then delete CMakeCache.txt and run cmake again, and it should find directx.

Related

No compile_commands.json file using cmake with vs code on windows

I am trying to integrate the Clang-Tidy static analysis tool into my build system.
I am getting a few issues with my setup.
Step cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. is not generating compile_commands.json file.
Hence, clang-tidy is giving below error.
>cmake --build . result
Could not auto-detect compilation database from directory "C:/dev/my-project/build/compile_commands.json"
No compilation database found in C:\dev\my-project\build\compile_commands.json or any parent directory
fixed-compilation-database: Error while opening fixed database: no such file or directory
json-compilation-database: Error while opening JSON database: no such file or directory
Running without flags.
Error while processing C:\dev\my-project\src\.
CUSTOMBUILD : error : unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error] [C:\dev\my-project\build\analyze_clang_tidy.vcxproj]
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Clang-tidy.cmake file
set(CLANG_TIDY_CHECKS "-checks='${CLANG_TIDY_CHECKS}'")
add_custom_target(analyze_clang_tidy ALL
COMMAND ${CLANG_TIDY}
-p ${CMAKE_BINARY_DIR}/compile_commands.json
${CLANG_TIDY_CHECKS}
-header-filter='.*'
${CMAKE_CURRENT_SOURCE_DIR}/src/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Static code analysis with Clang-Tidy"
)
Please also find the configuration result
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17763.
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Default build type: Debug
iD MSVC
-- ccache found and enabled
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/my-project/build
I have a simple hello world int main() {...} in my ../src/ folder.
Please suggest to me how to generate the compile_commands.json file using CMake with VS code on windows.
Thank you!
See https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html
Specifically this Note:
Note This option is implemented only by Makefile Generators and the Ninja. It is ignored on other generators.
Instead, you could write a python script which would generate that format for you, similar to this tool: https://github.com/nickdiego/compiledb
Or, actually, you don't need compile_commands.json. You can define CMAKE_<LANG>_CLANG_TIDY variable to trigger clang-tidy automatically: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html
See how I did this for my project 1 2 3

Problems using an external library (GEGELATI)

Recently I start to learn about machine learning and download a library that work with it: GEGELATI for C++, in Visual Studio. Link to the library: https://github.com/gegelati/gegelati. I also download the example "stick-game" from the same page. I follow all the points to build the library and the example, but it throw an error: "can't find gegelati.h". When I saw that, I remember the advice the "cmake .." command gave me when I build the library in the project:
*CMake Warning at CMakeLists.txt:68 (find_package):
By not providing "FindGEGELATI.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GEGELATI",
but CMake did not find one.
Could not find a package configuration file provided by "GEGELATI" with any
of the following names:
GEGELATIConfig.cmake
gegelati-config.cmake
Add the installation prefix of "GEGELATI" to CMAKE_PREFIX_PATH or set
"GEGELATI_DIR" to a directory containing one of the above files. If
"GEGELATI" provides a separate development package or SDK, be sure it has
been installed.*
If you need to know, this is the code in my CMakeList.txt: https://drive.google.com/file/d/1hDkC6coCWaQNb1Cv1QzrJbUMucjYE68y/view?usp=sharing
To solve the problem, I decided to copy the gegelati.h and GEGELATIConfig.cmake files (from the folder where I installed gegelati), but when I tried to compile again, the error E1696 showed up; it can't open gegelati.h.
Finally, I tried to put the gegelati files directly in the "stick-game/lib/gegelatilib" folder and
include its path in the "AdditionalIncludeDirectories". I put an image about this (sorry, it is in Spanish):
The new program output throw me 19 'LNK2019' errors and 8 'LNK2001' errors. Example of two:
Error LNK2019 símbolo externo "public: unsigned int __thiscall Instructions::Set::getNbInstructions(void)const " (?getNbInstructions#Set#Instructions##QBEIXZ) sin resolver al que se hace referencia en la función _main
Error LNK2001 símbolo externo "public: virtual class Learn::LearningEnvironment * __thiscall Learn::LearningEnvironment::clone(void)const " (?clone#LearningEnvironment#Learn##UBEPAV12#XZ) sin resolver
Also, at the beginning, when I install doxygen for use gegelati, it throws some errors:
*Checking Build System
Generating doxygen documentation in C:/Users/Acel Guilts/gegelati/bin/doc
CUSTOMBUILD : warning : tag INPUT: input source 'C:/Users/Acel' does not exist [C:\Users\Acel Guilts\gegelati\bin\doc\d
oc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'Guilts/gegelati/gegelatilib' does not exist [C:\Users\Acel Guilts\gege
lati\bin\doc\doc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'C:/Users/Acel' does not exist [C:\Users\Acel Guilts\gegelati\bin\doc\d
oc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'Guilts/gegelati/doc' does not exist [C:\Users\Acel Guilts\gegelati\bin
\doc\doc.vcxproj]
CUSTOMBUILD : error : source C:/Users/Acel is not a readable file or directory... skipping. [C:\Users\Acel Guilts\gegel
ati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source Guilts/gegelati/gegelatilib is not a readable file or directory... skipping. [C:\Users\Ace
l Guilts\gegelati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source C:/Users/Acel is not a readable file or directory... skipping. [C:\Users\Acel Guilts\gegel
ati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source Guilts/gegelati/doc is not a readable file or directory... skipping. [C:\Users\Acel Guilts
\gegelati\bin\doc\doc.vcxproj]*
Do you have any idea about how to solve the problem?
The installation process of GEGELATI for the latest version of Microsoft Visual Studio on Windows (x64) can be done with the following steps:
Download the application of your choice from the GEGELATI-APPS repository (or any other application built with the library).
Download the latest binary of the GEGELATI library from here. Make sure to select the gegelatilib-x.y.z.zip at the bottom of the page.
Unzip the content of gegelatilib-x.y.z.zip into the lib folder of your application. For example, for the stick-game application, the folder will be stick-game/lib/gegelatilib-0.2.1, and it should contain the following subfolders: bin, CMake, doc, include, lib.
Open a terminal in the stick-game/bin folder, and simply type:
cmake ..
This should produce the following output:
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 6.1.7601.
-- The C compiler identification is MSVC 19.26.28806.0
-- The CXX compiler identification is MSVC 19.26.28806.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Copy GEGELATI DLLs into <YOUR_PATH>/stick-game/bin
-- Configuring done
-- Generating done
-- Build files have been written to: <YOUR_PATH>/stick-game/bin
Now you can open the project by opening the stick-game/bin/stick-game.sln solution. To launch the application from Visual Studio, right-click on the stick-game project in the Solution Explorer and select Set as Startup Project.
Alternatively
Still in the terminal, from the bin directory:
cmake --build . --target stick-game --config Release
Then
.\Release\stick-game.exe
Best,
Karol
Download GEGELATI here and generate it Cmake solution
Download stick-game Project here and generate it Cmake solution
Add path of gegelati.h to Additional include directories. In my case G:\CMake\Sources\gegelati-master\gegelatilib\include\ (a better solution is to use relative path with ../../.. but it is not our problem)
Check that you edit for current configuration (see red arrow)
Find path of the generated GEGELATI libraries, in my case : G:\CMake\Build\gegelati\lib\Debug
6. Add this path (G:\CMake\Build\gegelati\lib\Debug) to Additional library Directories
Add gtestd.lib and GEGELATId.lib in input:
It should be good now!

CMAKE Required header sys/stat.h not found

I am trying to configure the bcl2fastq program that uses CMake. I found the line that triggers this error message
file:bcl2fastq/src/cmake/cxxConfigure.cmake
############## content ####################
..... # ignoring many lines
bcl2fastq_find_header_or_die(HAVE_SYS_STAT_H sys/stat.h)
......# more lines following
error message:
-- time.h found as /usr/include/time.h
-- unistd.h found as /usr/include/unistd.h
CMake Error at cmake/macros.cmake:80 (message):
Required header sys/stat.h not found.
Call Stack (most recent call first):
cmake/cxxConfigure.cmake:41 (bcl2fastq_find_header_or_die)
cxx/CMakeLists.txt:34 (include)
On my system, the sys/stat.h is located in
/usr/include/x86_64-linux-gnu
In the past, I add a symbolic link in /usr/include to the sys/stat.h, which patched the problem. Can someone suggest a better method by modifying the CMake files?
Digging deeper, I found the macros.cmake file in the same directory as cxxConfigure.cmake contains the macro definition:
#
# Macro to find libraries, with support for static-only search
#
macro(bcl2fastq_find_header_or_die variable file)
find_file(${variable} ${file} HINTS ENV C_INCLUDE_PATH ENV CPATH ENV CPLUS_INCLUDE_PATH)
if (${variable})
message(STATUS "${file} found as ${${variable}}")
else (${variable})
message(FATAL_ERROR "Required header ${file} not found.")
endif (${variable})
endmacro(bcl2fastq_find_header_or_die)
Then I did the following:
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
After that, CMake seems to be happy. Not sure this is the proper way to handle this problem.
Exporting the environment variable like
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
is one use.
Moreover, according to the doc on the find_path command, PATHS should be used over HINTS for hard-coded guesses, which means modifying macros.cmake like this
find_file([...] PATHS /usr/include/x86_64-linux-gnu)
is more appropriate. For more flexibility, this could be combined with a PATHS ENV variable, too. The use of PATHS vs HINTS has also been asked in the CMake mailing list here, but the explanation didn't offer much more than the documentation entry.
I created a folder called sys in /usr/include.
Copied over the stat.h into that folder and ran the make command again. The bcl2fastq build completed without any issues.
Write <sys/stat.h> instead of <stat.h> in your code.

cmake: You have called ADD_LIBRARY for library cryptopp without any source files

Windows 64bit using cmake to compile c++ project: github.com/iHateInventNames/synergy-through-usb
I fixed a previous issue in this post: Compile issues: LIBUSB_1 with cmake project on Windows
So when I hit cmake now I get the following error:
> cmake .
-- Found libusb-1.0:
-- - Includes: C:/local/libs/libusbx
-- - Libraries: C:/local/libs/libusbx/libusb-1.0.lib
You have called ADD_LIBRARY for library cryptopp without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
-- Generating done
-- Build files have been written to: C:/local/projects/synergy-usb/synergy-through-usb-master
What does this mean? how can I solve it / move on?
Links to the install instructions
both goto 404 errors...
http://synergy-project.org/projects/synergy/wiki/Readme/?hl=pm
http://synergy-project.org/projects/synergy/wiki/Compiling/?hl=pm
Based on a quick browse through the project's CMakeLists, it would seem you're supposed to unpack tools/cryptopp562.zip into a directory called tools/cryptopp562 before running CMake. This should definitely have been mentioned in the projects' installation instructions, if any.
More precisely, the file tools/CMakeLists.txt contains this code:
set(cpp_dir cryptopp562)
file(GLOB cpp_src ${cpp_dir}/*.cpp)
# ...
add_library(cryptopp STATIC ${cpp_src})
This means that the variable cpp_src is filled with source files taken from directory cryptopp562 (relative to the CMakeList's directory, i.e. tools), and is then used to define the source files of library cryptopp. However, the project's distribution only contains tools/cryptopp562.zip. Unpacking that into directory tools/cryptopp562 should provide the missing files.

Firebreath NPAPI Plugin How to Log

How to output log messages with an NPAPI plugin built with FireBreath in C++.
The log should be available during development and test and/or in Debug builds.
Modified:
The FireBreath way to log is with Log4cplus, and I have attempted to implement as closely as I can to these instructions.
I appended add_firebreath_library(log4cplus) to the bottom of "PluginConfig.cmake".
I have not yet been able to create a log file that I can read on Windows 8. I have browsed through other resources, such as this: FBLOG_TRACE() No logging to Logfile -- FBLOG_INFO() logging OK -- What is the DIFFERENCE
So far, all of my logging attempts are as follows:
#include "logging.h"
...
FBLOG_INFO("my function name", "and some text");
Optional Debug Level:
I am not sure if I have to override getLogLevel() because I am happy with the default level of INFO, and I am not sure exactly where to put it if I do override it:
FB::Log::LogLevel getLogLevel(){
return FB::Log::LogLevel_Trace; // Now Trace and above is logged.
}
Log File Path:
I am also uncertain about the proper path to writing the log file in windows. I have tried:
- outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, "C:/logs/XXXX/yyyy.log"));
- outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, "C:\logs\XXXX\yyyy.log"));
- outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, "/logs/XXXX/yyyy.log"));
etc.
Prep Script Errors:
After enabling Log4cplus in "PluginConfig.cmake" with add_firebreath_library(log4cplus), I get some "not found" errors in my prep script on Windows, but the script otherwise appears to complete successfully, and my plugin builds without error, so I have chosen to so far ignore these errors. But, here they are:
Note: Partial path replacement with 'XXXXX'.
Z:\XXXXX\firebreath>firebreath-dev\prep2010.cmd projects fbbuildwin
A subdirectory or file fbbuildwin already exists.
Using projects in: "Z:\XXXXX\firebreath\projects"
Generating build files in: "Z:\XXXXX\firebreath\fbbuildwin"
NOTE: The build files in "Z:\XXXXX\firebreath\fbbuildwin" should *NEVER* be modified directly.
When needed, make project changes in cmake files and re-run this script.
Project-specific cmake files are found in [plugin dir]\CMakeLists.txt and
[plugin dir]\Win\projectDef.cmake.
Note that parameters for cmake should be enclosed in double quotes, e.g. "-DVERBOSE=1"
CMAKE parameters:
Z:\XXXXX\firebreath\fbbuildwin>cmake -G "Visual Studio 10" -DFB_PROJECTS_DIR="Z:\dmanpearl On My Mac\pixelmonks\LaasTech\firebreath\projects" "Z:\XXXXX\firebreath\firebreath-dev"
-- Balanced size/speed optimization project dir: Z:/XXXXX/firebreath/projects
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Threads:
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - not found
-- Looking for include file errno.h
-- Looking for include file errno.h - found
-- Looking for include file iconv.h
-- Looking for include file iconv.h - not found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - not found
-- Looking for include file sys/syscall.h
-- Looking for include file sys/syscall.h - not found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - not found
-- Looking for include file sys/timeb.h
-- Looking for include file sys/timeb.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/file.h
-- Looking for include file sys/file.h - not found
-- Looking for include file syslog.h
-- Looking for include file syslog.h - not found
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - not found
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - not found
-- Looking for include file netinet/tcp.h
-- Looking for include file netinet/tcp.h - not found
-- Looking for include file netdb.h
-- Looking for include file netdb.h - not found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - not found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file stdio.h
-- Looking for include file stdio.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file wchar.h
-- Looking for include file wchar.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - not found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - not found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for 5 include files stdlib.h, ..., float.h
-- Looking for 5 include files stdlib.h, ..., float.h - found
-- Looking for gmtime_r
-- Looking for gmtime_r - not found
-- Looking for localtime_r
-- Looking for localtime_r - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - not found
-- Looking for getpid
-- Looking for getpid - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for stat
-- Looking for stat - found
-- Looking for lstat
-- Looking for lstat - not found
-- Looking for fcntl
-- Looking for fcntl - not found
-- Looking for lockf
-- Looking for lockf - not found
-- Looking for flock
-- Looking for flock - not found
-- Looking for htons
-- Looking for htons - not found
-- Looking for ntohs
-- Looking for ntohs - not found
-- Looking for htonl
-- Looking for htonl - not found
-- Looking for ntohl
-- Looking for ntohl - not found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for _vsnprintf
-- Looking for _vsnprintf - found
-- Looking for vsprintf_s
-- Looking for vsprintf_s - found
-- Looking for vswprintf_s
-- Looking for vswprintf_s - found
-- Looking for vfprintf_s
-- Looking for vfprintf_s - found
-- Looking for vfwprintf_s
-- Looking for vfwprintf_s - found
-- Looking for _vsnprintf_s
-- Looking for _vsnprintf_s - found
-- Looking for _vsnwprintf_s
-- Looking for _vsnwprintf_s - found
-- Looking for mbstowcs
-- Looking for mbstowcs - found
-- Looking for wcstombs
-- Looking for wcstombs - found
-- Looking for ENAMETOOLONG
-- Looking for ENAMETOOLONG - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - not found
-- Looking for __FUNCTION__
-- Looking for __FUNCTION__ - found
-- Looking for __PRETTY_FUNCTION__
-- Looking for __PRETTY_FUNCTION__ - not found
-- Looking for __func__
-- Looking for __func__ - not found
-- Performing Test LOG4CPLUS_HAVE___SYNC_ADD_AND_FETCH
-- Performing Test LOG4CPLUS_HAVE___SYNC_ADD_AND_FETCH - Failed
-- Performing Test LOG4CPLUS_HAVE___SYNC_SUB_AND_FETCH
-- Performing Test LOG4CPLUS_HAVE___SYNC_SUB_AND_FETCH - Failed
-- Performing Test LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS
-- Performing Test LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS - Failed
-- Performing Test LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
-- Performing Test LOG4CPLUS_HAVE_C99_VARIADIC_MACROS - Success
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for clock_nanosleep
-- Looking for clock_nanosleep - not found
-- Looking for nanosleep
-- Looking for nanosleep - not found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - not found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - not found
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY - Failed
-- Performing Test HAVE_DECLSPEC_DLLEXPORT
-- Performing Test HAVE_DECLSPEC_DLLEXPORT - Success
-- Performing Test HAVE_CXX11_THREAD_LOCAL
-- Performing Test HAVE_CXX11_THREAD_LOCAL - Failed
-- Performing Test HAVE_GCC_THREAD_EXTENSION
-- Performing Test HAVE_GCC_THREAD_EXTENSION - Failed
-- Performing Test HAVE_DECLSPEC_THREAD
-- Performing Test HAVE_DECLSPEC_THREAD - Success
-- Performing Test LOG4CPLUS_HAVE_CXX11_ATOMICS
-- Performing Test LOG4CPLUS_HAVE_CXX11_ATOMICS - Failed
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of socklen_t
-- Check size of socklen_t - failed
Adding library log4cplus
Generating plugin configuration files in Z:/XXXXX/firebreath/fbbuildwin/projects/LaasTech/gen
-- Configuring done
-- Generating done
-- Build files have been written to: Z:/XXXXX/firebreath/fbbuildwin
My Environment:
I am currently building my plugin on Mac and Windows (Mountain Lion and Windows 8).
I am testing in the following browsers:
Mac: Safari & Chrome.
Windows: IE 10 and Chrome.
FWIW: My Win installation for development is in a Mac VMWare Fusion v5.0 Guest.
Summary:
Please help me get Log4cplus working in my plugin with an accessible log file.
It looks like you're on the right track, but you're missing a very important piece -- you can't write to C:\logs, since only an admin has permissions to do that.
As to the "not found" "errors", those aren't errors... just status messages. That's part of building log4cplus, it's looking to see what your platform supports. You can safely ignore those.
If you look on the Tips and Tricks page you'll find some useful examples.
The main one I'm referring to comes from a gist I created some time back; you'll need to add_boost_library(filesystem) but you can then use this code to find a valid location to put your logs in. The code currently detects if the log path (which will be in %AppData%\LocalLow\CompanyName\logs with this code) exists and only writes the log if it does. It also uses a timestamp and a process id to ensure uniqueness to plugin instance.
#include <boost/filesystem.hpp>
#include "SystemHelpers.h"
using namespace boost::filesystem;
/// ...
void getLoggingMethods( FB::Log::LogMethodList& outMethods )
{
path appDataPath = FB::System::getLocalAppDataPath("CompanyName");
path logDirPath = appDataPath / "logs";
if (exists(logDirPath) && is_directory(logDirPath)) {
std::stringstream ss;
time_t seconds = time(NULL);
boost::thread::id threadId = boost::this_thread::get_id();
ss << seconds << "_" << threadId << ".log";
path logPath = logDirPath / ss.str();
fprintf(stderr, "logging to %s", logPath.string().c_str());
outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, logPath.string()));
}
#ifndef NDEBUG
outMethods.push_back(std::make_pair(FB::Log::LogMethod_Console, std::string()));
#endif
}
// ...