编译成功

This commit is contained in:
张壹 2019-10-21 22:40:08 +08:00
parent 4076f6803a
commit bcafb30f35
5 changed files with 9 additions and 5 deletions

View File

@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.15.2) cmake_minimum_required(VERSION 3.15.2)
# cxx # cxx
# 使 # 使
set(CMAKE_C_COMPILER /usr/local/bin/gcc-9)
set(CMAKE_CXX_COMPILER /usr/local/bin/g++-9) set(CMAKE_CXX_COMPILER /usr/local/bin/g++-9)
# #
project(LIBLBFGS VERSION 1.0.0 LANGUAGES CXX) project(LIBLBFGS VERSION 1.0.0)
# #
set(CMAKE_INSTALL_PREFIX /usr/local) set(CMAKE_INSTALL_PREFIX /usr/local)
# #

3
src/lib/config.h Normal file
View File

@ -0,0 +1,3 @@
#define HAVE_CONFIG_H
/* #undef _MSC_VER */
/* #undef USE_SSE */

View File

@ -70,7 +70,7 @@ licence.
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <lbfgs.h> #include "lbfgs.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#define inline __inline #define inline __inline

View File

@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <lbfgs.h> #include "../lib/lbfgs.h"
static lbfgsfloatval_t evaluate( static lbfgsfloatval_t evaluate(
void *instance, void *instance,

View File

@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <lbfgs.h> #include "../lib/lbfgs.h"
class objective_function class objective_function
{ {
@ -119,7 +119,7 @@ protected:
#define N 100 #define N 100
int main(int argc, char *argv) int main(int argc, char *argv[])
{ {
objective_function obj; objective_function obj;
return obj.run(N); return obj.run(N);