Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abieos not linkable by C program? #58

Open
kryton opened this issue May 18, 2020 · 1 comment
Open

abieos not linkable by C program? #58

kryton opened this issue May 18, 2020 · 1 comment

Comments

@kryton
Copy link

kryton commented May 18, 2020

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)
@kryton
Copy link
Author

kryton commented May 19, 2020

#51 seems to have a better solution to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant