Comments (12)
You should link libi2pd.a and lini2pd_client.a explicitly.
from i2pd.
I excluded libi2pdlang.a
but that didn't work.
I've also explicitly linked the libraries as shown in this CMakeLists.txt (part of a larger project that I am currently working on). Still, I get the same results...
I had a similar issue with another external library but I fixed it by adding external "C" {}
around the includes (of course, this was a C library and not a C++ one)
from i2pd.
I don't know what you are trying to do. Don't use cmake, but regular Makefile.
LIBS = i2pd/libi2pd.a
i2pd/libi2pd_client.a
-l boost_system
-l boost_filesystem
-l boost_program_options
-l boost_date_time
-l ssl
-l crypto
-l pthread
-l z
Everything gets linked properly. If your call your code not from C++ you have to write an external C wrapper, that's not a part of i2pd project.
from i2pd.
A regular Makefile literally made no difference at all. Same result. And my code is primarily C++, not C.
This is my Makefile
by the way. All the required i2pd libraries are in the same directory as the source file (main()
function was moved to main.cpp
)
# Compiler
CXX := g++
# Compiler flags
CXXFLAGS := -std=c++17 -Wall
# Source files
SRCS := i2p.cpp main.cpp
# Output binary
TARGET := main
# Include directories
INC_DIRS := -I../../../external/i2pd/i18n -I../../../external/i2pd/libi2pd -I../../../external/i2pd/libi2pd_client
# Library directories
LIB_DIRS := -Li2pd
# Libraries
LIBS := libi2pd.a libi2pdclient.a -lboost_system -lboost_filesystem -lboost_program_options -lboost_date_time -lssl -lcrypto -lpthread -lz
# Build rule
all: $(TARGET)
$(TARGET): $(SRCS)
$(CXX) $(CXXFLAGS) $(INC_DIRS) $(LIB_DIRS) -o $@ $^ $(LIBS)
# Clean rule
clean:
rm -f $(TARGET)
Trust me, I've cloned i2pd and downloaded the latest source code from the releases page multiple times. I tried building with CMake, g++ via Terminal, and now Makefile - all which have failed.
Maybe I am including the wrong i2pd header files or it could be that my OS sucks, I dunno...
I'll try to upgrade my OS or build on a different computer I guess...
from i2pd.
You must specify the full path to libi2pd.a and libi2pd_client.a
from i2pd.
I tried to build your code. Everything links fine. Ubuntu 22.04
from i2pd.
Strange how it isn't linking properly for me?
I upgraded from Ubuntu 20.04 to 22.04 'cause I thought it'll solve this issue, but I guess not.
Edit: This issue has been resolved by a user on reddit
source: https://www.reddit.com/r/moneromarket/comments/1baavub/comment/kuadhlq/
from i2pd.
Edit: This issue has been resolved by a user on reddit
Didn't I suggest the same?
from i2pd.
from i2pd.
If you don't mind, could you give me some examples on how to use the SAM API for just reading and writing messages via UDP/Datagram? 'cause I dunno what I'm doing and I don't trust ChatGPT 😄
from i2pd.
https://github.com/PurpleBote/pboted uses SAM datagrams.
But if you link i2pd libs directly to your app why do you need SAM API? Create destinations and send datagrams directly from your code.
from i2pd.
Related Issues (20)
- NAT46 support request HOT 3
- SAM stream creation with incompatible crypto key type
- SAM: can't connect to self HOT 9
- [Question] - How to backup current i2pd address and transfer to a new machine? HOT 8
- Weird padding calculation for SSU2Session Token Request HOT 6
- Multi Homing issues with address selection HOT 1
- update/fix default values in config file and remove outdated information HOT 3
- understanding spammy error log entries. HOT 7
- boost undefined symbol error when linking with mold HOT 2
- [Feature] Reseed on network up HOT 6
- Accept Contributions/PRs from Who Involved in Monero HOT 4
- I2PControl: RouterManager method returns invalid JSON when unknown params are passed
- [BUG] Yggdrasil crashing i2pd HOT 2
- Possible to introduce an alternative GUI based on GTK? HOT 4
- i2pd browser is dead HOT 4
- nullptr deref
- not run on qnap armv7 docker HOT 3
- network dead? HOT 20
- SEGV HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i2pd.