/dpt/ - Daily Programming Thread

Anime Edition.

Previous thread: What are you working on Jow Forums?

Attached: teach_me_cpp_senpai.jpg (1440x810, 155K)

Other urls found in this thread:

gist.github.com/gubatron/32f82053596c24b6bec6
twitter.com/AnonBabble

>tfw no nene and Jow Forums-chan to make gamus with

>tfw when trying to learn c++ for ages but don't have time because of work and family shit

Guys what if ms implemented Clippy for build tools?

How can I include or link a dll in such a way that I don't require the dll run it on a different machine?
For example, on my Windows box I use gcc to compile and link to create this executable
gcc -Wall -o objects/ssh_client.o -c ssh_client.c
gcc -static -o ssh_client.exe objects/ssh_client.o /mingw64/bin/libssh.dll

I can only run this executable inside my own shell. ldd reveals this
ldd libssh.dll | grep ssh
libssh.dll => /mingw64/bin/libssh.dll (0x61ac0000)

How can I compile ssh_client.exe so I don't need to install a copy of libssh.dll on another machine?

Didn't mean as a direct response to you.

Clippy as a lot of AI

Attached: aaaaaaaaaa.jpg (1072x1440, 80K)

I'm not on a PC with Linux right now so I'll try to describe it.
I'm compiling a C program that uses threads and semaphores.
In the gcc I'm using the -lpthread parameter
In the .c file I added the semaphore.h and thread.h libraries, no problem
But when I add a sem_init function it says some error about undefined reference.
What am I doing wrong?

Attached: Bob.jpg (184x186, 13K)

Something is driving me insane. I made a run-time length compress implementation in C++. When I tried to test it I ran the command to compile it: clang++ -o program src/main.cpp -std=c++17 -I/home/user/Desktop/Documents/Projects/RleAlgorithm/install_dir/include -L/home/user/Desktop/Documents/Projects/RleAlgorithm/install_dir/lib -lrlecompress

To gives the following error:

/tmp/main-4a3a56.o: In function `main':
main.cpp:(.text+0x6e): undefined reference to `std::vector RleAlgo::compress(std::vector const&)'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)


I know the library is linked correctly and when running nm librlecompress.so it shows the symbols compress and decompress.

For additional information: the library was built using CMake.

Can you show the command you used to compile your program?

I've had trouble storing my images in folders the right way, so I have been making a tag-based image database so I can search by tag instead of hunting down the folder.

I'm prototyping in Node+MySQL, but when I got all the features done, I'll be migrating to GTK+SQLite.

Attached: literally-a-booru-for-your-computer.png (1920x978, 943K)

how do I get the vector angle between two vector positions in a 2D space in godot?

The challenge is modify only one of the files, so parser, queue and the makefile are already written. Using that I have to complete the program.

Attached: Parmake.jpg (515x508, 56K)

I'm having a similar problem, I know that feel bro. Good luck.

gist.github.com/gubatron/32f82053596c24b6bec6

Friendly reminder that the C standard doesn't guarantee that malloc(size) allocates the desired amount of memory if size is greater than 64K.

>greater than 64K
Well, who would need 64 MiB of heap allocated memory in a practical scenario?

>vector angle
>between two vector positions
?

Shit's compiling fine though.
The problem is when I add the sem_init function.
It's not even that I'm writing it wrong or fucking up the parameters.

>i dun need it anyway
God I hate Cniles.

No, kilobytes.

It can't find a reference to the function. Meaning it's been declared but there is no definition of it.

Wait, so are you saying that the C standard guarentees that you will never run out of memory if you only allocate in 64K blocks?

He's joking, retard.

Doesn't matter, that's the typical sort of response you get here whenever someone criticizes C.

He's retarded, joker.

>new job
>Software engineer title
>Very big boy company
>Rewriting pajeet Java code that integrates old system into new system
>salary Equivalent of 120k in NYC

I mean on one hand, yes money. But on the other hand I feel like an IT guy that knows how to code. How to get into more interesting work? Is my first job

But I have included.

Actually, I'm not. I've never need to allocate anymore than a few kilobytes of heap allocated memory.

What the fuck is "cnile"?

Say it out loud.

>Is my first job
Git gud so supervisor senpai notices you.
Refuse to suck his dick no more than 2 times.
Third time's a charm.

Whoops... Sorry.

Are you sure that you aren't fucking up parameter types and that sem_init is in the libraries you included?
Check the .h files

No. But size_t only has to hold a value of up to 65536, so it's perfectly valid for an implementation to define sizeof(size_t)*CHAR_BIT == 2.

That's the header file. It contains all the function prototypes. The actually definitions are in the library which you want to link *correctly* against.

>"senile"
Why not say "senile" instead?

C-nile

Wait, nevermind.

>which you want to link *correctly* against.
With the -lpthread parameter I'm already using?

Dumb as rocks, you are.

Wow. I never knew there was an insult for C programmers. Neat.

Are you linking it against before the source files or after?

what the actual fuck is that

is this the right thread for android studio related questions? i have two overlapping buttons. how do i designate one of the buttons to be in the forefront so i can actually click it? it's visually in the forefront however, when i try to click it, it always clicks the button in the background for some reason.

pubes

>what the actual fuck is that
Male Creatonotos gangis moth with its scent glads out to attract females.

>two overlapping buttons
why and for what?

>its scent glads
in laymens' terms, his hairy balls?

Imagine if you had 4 dicks and when you became erect they each are individually larger than your whole body.

Probably before?
I don't know user, I'm retarded.

Being a Jow Forums fizzbuzzer 101?

do we have to guess the course?

kys

You also need the linker flag -lrt

Gonna take this course at uni. What's the best way to prepare for it in this summer.

Attached: IMG_20180716_201607.png (1080x1091, 216K)

Did you just forget the picture again

get a load of this faggot

A C book

Probably get a copy of C++ Primer

i didn't ask for design input

Is 7 an Amazon Prime?

implement a stack in c++

>2 overlapping buttons

are you trying to scam people with ads?

You can get a free pdf copy somewhere off the internet.

std::stack

haha

now make it threadsafe!

>what is hydrus

[std::mutex]

yes

dude wot?
can't you just use a vector or does this have any advantage?

std::mutex

std::stack // please don't modify while someone else is using this thnx

hahaha

Attached: images.png (300x168, 7K)

It's a stack data structure which means it have the push and pop operations. std::vector is for different purposes.

no

std::condition_variable

You can push and pop with vector as well though.

std::stack is actually just a facade over std::vector, std::list, or std::deque to name a few.

Vectors are continous memory which means every time they need to resize they have to move memory. Theyre wrappers over arrays.
Queues and stacks dont need to.

How the fuck do I learn to program, Everytime I try I look stuff over for 5 minutes and get bored then do something else.

Plz help with this, /dpt/.

Attached: 1529072859628.jpg (681x913, 185K)

Dont. Not everybody i meant to be a programmer, dont try and force the stuoid EVERYBODY NEEDS TO PROGRAM meme.

>what is making something for fun

make something fun. jump head first into unity and make a video game. that'll teach you c#. from there you can easily learn everything else.

>pic
kys

I thought that what you faggots liked.

why the homophobia?

Unity will NOT teach you C#

DLL means dynamically linked, i.e. you cant put it into the exe without some hacky voodoo bullshit.
Either find a static lib or zip it up with the exe.

I'm secretly gay, and frustrated.

fuck off

>static lib
Like libssh.a?

Yes.

checked

win32 is the most convoluted piece of shit to ever exist
why is it so complicated and confusing

Why is programming as a career so extremely dull and boring? The problems I'm solving aren't interesting, they're just tedious and only exist because of poor decisions made by other people in the past

>Why is programming as a career so extremely dull and boring?
It's just boring for you. Also, being forced to do something to make a living can make you hate it. Do porn, see how that goes.

It's the product of decades of C being gangbanged by Rajesh, Pajeet, Zhang, and other retards at M$.

UWP is actually quite sane in comparison.

It was born in the early years where using word sizes was still common and a lot of core windows stuff got written with it.

The .NET stack and UWP exist but dont have the same breadth of access to the underlying system, so youre forced to use once-useful system calls from 1992

>target_link_libraries(${PROJECT_NAME} "stdc++")
also check if ' -stdlib=libstdc++' is in compile flags?

IDK i have one config that I copy between my projects and it works. Anyway, seems that You have included and it compiled, so headers were found. But failed linking, so i guess check this?

> I know the library is linked correctly
You might show us how You done that, so we can yay/nay this.

PS. 3:30AM here, I might not be thinking right now