Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » CreateSymbolicLink doesn't compile using MinGW
CreateSymbolicLink doesn't compile using MinGW [message #49145] Tue, 26 December 2017 11:53 Go to previous message
_dka_ is currently offline  _dka_
Messages: 2
Registered: December 2017
Junior Member
Hello all,

Sorry, i use google translator.
I used upp-mingw (last nightly builds and stable upp-mingw-11540).
I want to create a symbolic link to a folder.
I tried to create console applications in projects of different types.

My source (Core console project):

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
	CreateSymbolicLink("","",1);
}


Compiler error:

MyApps_MkLinks.cpp (7): error: 'CreateSymbolicLink' was not declared in this scope
 (): CreateSymbolicLink("","",1);
MyApps_MkLinks.cpp (7): note: suggested alternative: 'CreateHardLink'
 (): CreateSymbolicLink("","",1);
 (): CreateHardLink


So far, I've solved this problem by adding lines from the winbase.h from mingw:

#include <Core/Core.h>
using namespace Upp;

#define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)
WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkA ( LPCSTR lpSymlinkFileName, LPCSTR lpTargetFileName, DWORD dwFlags );
WINBASEAPI BOOLEAN APIENTRY CreateSymbolicLinkW ( LPCWSTR lpSymlinkFileName, LPCWSTR lpTargetFileName, DWORD dwFlags );
#define CreateSymbolicLink __MINGW_NAME_AW(CreateSymbolicLink)

CONSOLE_APP_MAIN
{
	CreateSymbolicLink("","",1);
}


but now there is a link error:

 (): Linking has failed
 (): MyApps_MkLinks/MINGW.Debug.Debug_Full.Main.Noblitz\MyApps_MkLinks.o: In function `Z14ConsoleMainFn_
v':
MyApps_MkLinks/MyApps_MkLinks.cpp (40): undefined reference to `_imp___Z19CreateSymbolicLinkAPKcS0_m@12'
 (): collect2.exe: error: ld returned 1 exit status


Build methods settings:

[Updated on: Tue, 26 December 2017 14:22]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: ParseJSON now throws exception
Next Topic: _mm_pause not defined
Goto Forum:
  


Current Time: Fri Apr 03 01:13:35 CEST 2020

Total time taken to generate the page: 0.01066 seconds