News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Transfering project from VS to CodeBlocks

Started by user321, June 02, 2013, 10:35:15 PM

Previous topic - Next topic

user321

If you succeded to build it, could you please upload zip of your project? also which compiler are you using?

BlueHazzard

Quote from: user321 on June 04, 2013, 12:04:11 AM
If you succeded to build it, could you please upload zip of your project? also which compiler are you using?
This was a general help, not specific to your problem...
I don't know what you are trying to build. (And i don't have the time to make it for you, this is a good exercise to learn how compiler, linker and IDE work together)

stahta01

#17
FYI:

To convert a project from Compiler A to Compiler B.

You must know Compiler B very well. And, you should know a little about Compiler A.

Next, you need to know the basics of Compilers in General.

And, this project was written to only use C++ Visual Studio for Newbies.

I got it to link by doing three additional things past the Usual.

Note: I have no idea if it will Run or is Safe to run.

1. I defined "VJOY_EXPORTS"

2. I linked directly to the VJoy.dll using absolute path.
This is NOT a good thing to do; but, when you link to a Library you do NOT have the source code for you sometimes need to do it.

If the DLL has C linkage it should be safe.
No Idea what Linkage the DLL has it could be C++.

The third item is NOT one I would expect a Newbie to figure out. I modified the code.
The example should have been written in C if the DLL is really a C DLL; but, it is written in C++.
Either the person writing the sample code did NOT know very much or it is a C++ DLL.
Edit: Saving/Renaming the cpp file as a c files fixes the third problem without needing to edit the file.
Edit4: I am guessing the person who wrote the C++ file did not know very much about C++/C portability.

Original Code

#include "VJoy.h"


Modified Code

extern "C" {
#include "VJoy.h"
}


Note: None of my Answers are for questions allowed on this site; this thread is likely to be deleted or locked.

Edit2: These are answers appropriate to be asked and answered on a programming site like here http://cboard.cprogramming.com/forum.php

Edit2b: But, if you need help doing the three things I did to get the project to compile and link it would be OK to ask how to do it.
Edit3: But, please read the FAQ and the User Manual for items 1; I do NOT know of any FAQ to help with Items 2 and 3.


Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]