BewareMyPower commented on issue #17279:
URL: https://github.com/apache/pulsar/issues/17279#issuecomment-1232976657

   I also tried the 2.10.1 RPM package and it works well with GCC 4.8.
   
   ```
   lrwxrwxrwx 1 root root       19 Aug 31 13:48 /usr/lib/libpulsar.so -> 
libpulsar.so.2.10.1
   -rwxr-xr-x 1 root root 10636144 Jun 13 07:57 /usr/lib/libpulsar.so.2.10.1
   lrwxrwxrwx 1 root root       24 Aug 31 13:48 /usr/lib/libpulsarnossl.so -> 
libpulsarnossl.so.2.10.1
   -rwxr-xr-x 1 root root  7569800 Jun 13 07:57 
/usr/lib/libpulsarnossl.so.2.10.1
   ```
   
   ```bash
   g++ SampleProducer.cc -std=c++11 -I /pulsar/pulsar-client-cpp/include -L 
/usr/lib -lpulsar
   export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
   ./a.out
   ```
   
   Outputs:
   
   ```
   0x16536c8
   2022-08-31 13:56:48.473 INFO  [139834303919872] ExecutorService:41 | Run 
io_service in a single thread
   2022-08-31 13:56:48.473 INFO  [139834337716672] ClientConnection:189 | 
[<none> -> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2022-08-31 13:56:48.473 INFO  [139834337716672] ConnectionPool:96 | Created 
connection for pulsar://localhost:6650
   2022-08-31 13:56:48.474 INFO  [139834303919872] ClientConnection:375 | 
[127.0.0.1:51658 -> 127.0.0.1:6650] Connected to broker
   2022-08-31 13:56:48.575 INFO  [139834303919872] HandlerBase:64 | 
[persistent://public/default/my-topic, ] Getting connection from pool
   2022-08-31 13:56:48.901 INFO  [139834303919872] ProducerImpl:189 | 
[persistent://public/default/my-topic, ] Created producer on broker 
[127.0.0.1:51658 -> 127.0.0.1:6650] 
   2022-08-31 13:56:49.008 INFO  [139834337716672] ClientImpl:498 | Closing 
Pulsar client with 1 producers and 0 consumers
   2022-08-31 13:56:49.008 INFO  [139834337716672] ProducerImpl:661 | 
[persistent://public/default/my-topic, standalone-0-0] Closing producer for 
topic persistent://public/default/my-topic
   2022-08-31 13:56:49.016 INFO  [139834303919872] ProducerImpl:704 | 
[persistent://public/default/my-topic, standalone-0-0] Closed producer
   2022-08-31 13:56:49.017 INFO  [139834284959488] ClientConnection:1560 | 
[127.0.0.1:51658 -> 127.0.0.1:6650] Connection closed
   2022-08-31 13:56:49.017 INFO  [139834284959488] ClientConnection:263 | 
[127.0.0.1:51658 -> 127.0.0.1:6650] Destroyed connection
   2022-08-31 13:56:49.018 INFO  [139834303919872] ExecutorService:47 | Event 
loop of ExecutorService exits successfully
   2022-08-31 13:56:49.018 INFO  [139834337716672] ProducerImpl:628 | Producer 
- [persistent://public/default/my-topic, standalone-0-0] , 
[batchMessageContainer = { BatchMessageContainer [size = 0] [bytes = 0] 
[maxSize = 1000] [maxBytes = 131072] [topicName = 
persistent://public/default/my-topic] [numberOfBatchesSent_ = 2] 
[averageBatchSize_ = 0.5] }]
   ```
   
   I suspect there are multiple GCC compilers in your environment and you 
didn't set the related environment variables (`PATH` and `LD_LIBRARY_PATH`) 
well. Could you show the `ldd` result of your executable file and the GCC 
version?
   
   ```bash
   ldd <your-executable>
   g++ --version
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to