Skip to content

abieos not linkable by C program? #58

@kryton

Description

@kryton

src/abieos.cpp isn't included in static library.
so my simple C program can't compile/link.

#include <stdio.h>
#include "../src/abieos.h"

int main() {

fprintf(stdout,"hello\n");
abieos_context *context =  abieos_create();
abieos_destroy(context);
}

my 'fix' is to include src/abieos.cpp in the library CMakeList.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c14e851..e5efa05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ endif()

 find_package(Threads)

-add_library(abieos STATIC src/abi.cpp src/crypto.cpp include/eosio/fpconv.c)
+add_library(abieos STATIC src/abieos.cpp src/abi.cpp src/crypto.cpp include/eosio/fpconv.c)
 target_include_directories(abieos PUBLIC include external/rapidjson/include)

 add_library(abieos_module MODULE src/abieos.cpp src/abi.cpp src/crypto.cpp include/eosio/fpconv.c)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions